Jump to content

Recommended Posts

Posted

I'm trying to display a Unicode character on a label but get an rectangle instead
is it possible to successfully display all Unicode characters on GUI on labels buttons etc?
the one i'm trying to display is ChrW(11034) which is

$square = GUICtrlCreateLabel(ChrW(11034),10,20, 10, 15)

 

Posted (edited)

I don't think setting the font will help, some Unicode characters just wont get drawn correcly, setting the font on the phone unicode chr messes it up
 

#include <GUIConstantsEx.au3>
GUICreate("GUI")

;first line
GUICtrlCreateLabel(chrw(11034), 10, 10)
GUICtrlCreateLabel(chrw(11034), 30, 10)
GUICtrlSetFont(-1, 10, 600, -1, "WingDings 3")

;Second line
GUICtrlCreateLabel(chrw(9742), 10, 30)
GUICtrlCreateLabel(chrw(9742), 30, 30)
GUICtrlSetFont(-1, 10, 600, -1, "WingDings 3")
;11034

GUISetState(@SW_SHOW) ; will display an empty dialog box
; Loop until the user exits.
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop

    EndSwitch
WEnd

EDIT:
oh well after playing with WingDings fonts i got enough symbols that will do the job, so i will end up using that instead,

thanks Deye

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Local $hGUI = GUICreate("Example", 1200, 650)
GUISetState(@SW_SHOW, $hGUI)

$X=1
$Y=1
$max = 1180

GUICtrlCreateLabel("WingDings", $X, $Y,79,21,$WS_BORDER)
$X+=80
For $XX=1 to 256
GUICtrlCreateLabel(chr($XX), $X, $Y,21,21,$WS_BORDER)
GUICtrlSetFont(-1, 13, 600, -1, "WingDings")
GUICtrlCreateLabel($XX, $X, $Y+20,21,21,$WS_BORDER)
    $X+=20
    if $X > $max Then
        $X=1
        $Y+=45
    EndIf
Next
$X+=40
GUICtrlCreateLabel("WingDings 2", $X, $Y,79,21,$WS_BORDER)
$X+=80
For $XX=1 to 256

GUICtrlCreateLabel(chr($XX), $X, $Y,21,21,$WS_BORDER)
GUICtrlSetFont(-1, 13, 600, -1, "WingDings 2")
GUICtrlCreateLabel($XX, $X, $Y+20,21,21,$WS_BORDER)
    $X+=20
    if $X > $max Then
        $X=1
        $Y+=45
    EndIf
Next
$X+=40
GUICtrlCreateLabel("WingDings 3", $X, $Y,79,21,$WS_BORDER)
$X+=80
For $XX=1 to 256

GUICtrlCreateLabel(chr($XX), $X, $Y,21,21,$WS_BORDER)
GUICtrlSetFont(-1, 13, 600, -1, "WingDings 3")
GUICtrlCreateLabel($XX, $X, $Y+20,21,21,$WS_BORDER)
    $X+=20
    if $X > $max Then
        $X=1
        $Y+=45
    EndIf
Next


GUISetState(@SW_SHOW) ; will display an empty dialog box
; Loop until the user exits.
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop

    EndSwitch
WEnd

 

 

Edited by jvds

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...