Unicode characters in xBrowse

Unicode characters in xBrowse

Postby Natter » Wed Jun 13, 2018 1: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:bStrData:={||HB_UTF8CHR(HexToNum(aRow[1]))}

Image
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: Unicode characters in xBrowse

Postby nageswaragunupudi » Wed Jun 13, 2018 5: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
User avatar
nageswaragunupudi
 
Posts: 10662
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Unicode characters in xBrowse

Postby nageswaragunupudi » Wed Jun 13, 2018 6:10 pm

Simple sample:
This works on Windows 8.1 or Windows 10
Code: Select all  Expand view  RUN
#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

Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10662
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Unicode characters in xBrowse

Postby fraxzi » Thu Jun 14, 2018 2: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Unicode characters in xBrowse

Postby nageswaragunupudi » Thu Jun 14, 2018 2: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
User avatar
nageswaragunupudi
 
Posts: 10662
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 56 guests