FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Unicode characters in xBrowse
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM

Unicode characters in xBrowse

Posted: Wed Jun 13, 2018 01:24 PM
When showing Unicode characters (2 and 3 superscript) in the xBrowse column, it looks strange. In addition to Unicode characters, some additional character is displayed.

oBrw:={||HB_UTF8CHR(HexToNum(aRow[1]))}

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: Unicode characters in xBrowse

Posted: Wed Jun 13, 2018 05:42 PM

Can you please provide a sample with the numbers you are trying to display?
Also please let us know the FWH version you are using.

You need to use "Segoe UI Symbol" font in Windows 8.1/10 or "Segoe MDL2 Assets" font for Windows 10

Meanwhile please see fwh\samples\uisymbol.prg which displays HB_UTF8CHR(n)

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: Unicode characters in xBrowse

Posted: Wed Jun 13, 2018 06:10 PM
Simple sample:
This works on Windows 8.1 or Windows 10
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local aData := {}
   local oFont, oSymbol
   local oDlg, oBrw
   local n

   for n := 0xE100 to 0XE120
      AAdd( aData, { n, HB_UTF8CHR( n ) } )
   next

   DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-20
   if IsWindows10()
      DEFINE FONT oSymbol NAME "Segoe MDL2 Assets" SIZE 0,-20
   else
      DEFINE FONT oSymbol NAME "Segoe UI Symbol" SIZE 0,-20
   endif

   DEFINE DIALOG oDlg SIZE 250,500 PIXEL TRUEPIXEL FONT oFont
   @ 20,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg DATASOURCE aData ;
      AUTOCOLS NOBORDER

   oBrw:aCols[ 1 ]:bEditValue := { || HB_NUMTOHEX( oBrw:aRow[ 1 ] ) }
   oBrw:aCols[ 2 ]:oDataFont  := oSymbol
   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont, oSymbol

return nil

Regards



G. N. Rao.

Hyderabad, India
Posts: 811
Joined: Tue May 06, 2008 04:28 AM

Re: Unicode characters in xBrowse

Posted: Thu Jun 14, 2018 02:28 AM

Hi Rao,

I tried your sample but having unresolved external "_HB_FUN_HB_NUMTOHEX", there are symbols (navigation... etc) i'd like to use for my project.

:wink:

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: Unicode characters in xBrowse

Posted: Thu Jun 14, 2018 02:43 AM

You are using xHarbour.
Use NUMTOHEX instead of HB_NUMTOHEX

Using in your project:

fwh\samples\uisymbol.prg shows all symbols and their ascii values. for fonts "Segoe MDL2 Assets"( W10 only), "Segoe UI Symbol" (W8.1 and W10) and Wingdings 1,2,3 for all versions prior to 8.1.

Usage:
@ r,c BTNBMP PROMPT "Save" RESOURCE 0xE105 SIZE .........

FWH understands that the number 0xE105 should be displayed as a symbol.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion