Page 1 of 2
Unicode character in ListIconGadget not rendered correctly
Posted: Thu Sep 06, 2018 7:21 am
by Kukulkan
Hello,
I use a ListIconGadget and set the font explicitely to be "Arial Unicode MS". The font is installed on the system. Then, I use a unicode character ✔ do mark done items (U+2714 or ✔ in HTML). I'm using PB 5.46 LTS here (32 Bit).
In all Windows versions I have access to, and also for many customers, this works fine. But two customers currently reporting the problem that the character is rendered like a rectangle only:
I double checked and the font Arial Unicode MS is also installed on their system. Looks like it is Windows 7 in both cases.
Any idea what is causing the characters to not display correctly there? I have no idea
Best,
Kukulkan
Re: Unicode character in ListIconGadget not rendered correct
Posted: Thu Sep 06, 2018 12:50 pm
by Dude
Got some demo code so I can run and test on my Win 7 machine?
Re: Unicode character in ListIconGadget not rendered correct
Posted: Thu Sep 06, 2018 1:22 pm
by Kukulkan
Sorry, I missed that. It is a big project but in general, this will reproduce it:
Code: Select all
CompilerIf #PB_Compiler_Unicode = #False
Debug "Please compile Unicode mode!"
End
CompilerEndIf
If OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(0, 5, 5, 290, 90, "Status", 100, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
myFont.i = LoadFont(#PB_Any, "Arial Unicode MS", 9)
SetGadgetFont(0, FontID(myFont.i))
AddGadgetColumn(0, 1, "Description", 250)
AddGadgetItem(0, -1, "✔"+Chr(10)+"Done")
AddGadgetItem(0, -1, "↻"+Chr(10)+"Progressing")
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
At the affected Windows 7 customers, the symbols in he first column just render as ▯. The font "Arial Unicode MS" is installed and available (at least it tells so if we try to install again using the ttf file).
Re: Unicode character in ListIconGadget not rendered correct
Posted: Fri Sep 07, 2018 9:10 am
by srod
Works fine here on Win 7.
Tested with PB 4.50x86, PB 5.70LTS x64, PB 5.70LTS x86.
Re: Unicode character in ListIconGadget not rendered correct
Posted: Fri Sep 07, 2018 9:23 am
by Kukulkan
Hi srod,
thanks. It works for me, too. On all my machines I have. But I have two customers with Windows 7 32 Bit where the same executable (just the source above) does not work. The two symbols are just displayed as rectangles and the Font Arial Unicode MS is installed.
Re: Unicode character in ListIconGadget not rendered correct
Posted: Fri Sep 07, 2018 9:54 am
by srod
Try getting one of these customers to run the following to see what font is actually being used :
Code: Select all
CompilerIf #PB_Compiler_Unicode = #False
Debug "Please compile Unicode mode!"
End
CompilerEndIf
If OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(0, 5, 5, 290, 90, "Status", 100, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
myFont.i = LoadFont(#PB_Any, "Arial Unicode MS", 9)
SetGadgetFont(0, FontID(myFont.i))
GetObject_(FontID(myFont), SizeOf(LOGFONT), lf.LOGFONT)
MessageRequester("Font?", PeekS(@lf\lfFaceName))
AddGadgetColumn(0, 1, "Description", 250)
AddGadgetItem(0, -1, "✔"+Chr(10)+"Done")
AddGadgetItem(0, -1, "↻"+Chr(10)+"Progressing")
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
Re: Unicode character in ListIconGadget not rendered correct
Posted: Fri Sep 07, 2018 10:09 am
by Marc56us
Also try using Chr() codes instead of characters
Code: Select all
...
AddGadgetItem(0, -1, Chr(10004) + Chr(10) + "Done")
AddGadgetItem(0, -1, Chr(8635) + Chr(10) + "Progressing")
...
Re: Unicode character in ListIconGadget not rendered correct
Posted: Fri Sep 07, 2018 10:18 am
by Dude
Kukulkan wrote:using PB 5.46 LTS here (32 Bit)
Hmm, I couldn't reproduce your problem with 5.62, and unfortunately 5.46 is not downloadable from the PureBasic Museum, so I can't test that.
How about you download 5.62, install it to a new folder, and test your code there? Just to see if maybe you should upgrade to it.
Re: Unicode character in ListIconGadget not rendered correct
Posted: Fri Sep 07, 2018 10:26 am
by Marc56us
Hmm, I couldn't reproduce your problem with 5.62, and unfortunately 5.46 is not downloadable from the PureBasic Museum, so I can't test that.
5.46 LTS is not in the museum because it's the actual LTS
(Look in the middle of download page of your user account. It is there)
Re: Unicode character in ListIconGadget not rendered correct
Posted: Fri Sep 07, 2018 10:31 am
by Little John
Re: Unicode character in ListIconGadget not rendered correct
Posted: Fri Sep 07, 2018 12:32 pm
by Dude
Marc56us wrote:5.46 LTS is not in the museum because it's the actual LTS
Oh yeah, I missed that.
Tried the code above with 5.46 on Win 7 but it works fine here. I was hoping it'd fail so I could help troubleshoot (I love little challenges) but I can't do anything further.
Can you try other Unicode characters in a different font? I know you said "Arial Unicode MS" is on their PC, but do we know for sure it's the legit font, etc... I'd be trying another Unicode font next.
Re: Unicode character in ListIconGadget not rendered correct
Posted: Fri Sep 07, 2018 1:23 pm
by Kukulkan
Hello Guys,
thank you all for your tips and help! Really great!
I already found that Google Chrome issue a few days ago but Chrome was not installed on that machine. Playing with the Font settings of Windows did also not change anything. I also assume it is not really a PB thing but a Windows issue. Sadly, it is an important customer and I have to help him. I do not have direct access to that system. It is just a customer sending me screenshots and is doing what I tell him. But he is also no IT expert. Sadly, TeamViewer is blocked in his company. Really a bad situation
Anything else I can try? I will try to get closer using GetObject_() to determine the Font name used. But for this I have to compile a special version for the customer. And because it is not a Pro, I have to also create a Setup etc...
I will update here if I know something more.
Re: Unicode character in ListIconGadget not rendered correct
Posted: Fri Sep 07, 2018 1:51 pm
by Marc56us
Anything else I can try?
Use #PB_ListIcon_CheckBoxes
- Checked = Done
- Unchecked = Progressing

Re: Unicode character in ListIconGadget not rendered correct
Posted: Fri Sep 07, 2018 1:56 pm
by Kukulkan

That will not work because I need the following:
✔ = done
↑ = uploading
↓ = downloading
↻ = Sync in progress
And the available icon in the first column per line is already used for the filetype (file/folder etc).
Re: Unicode character in ListIconGadget not rendered correct
Posted: Fri Sep 07, 2018 6:22 pm
by Little John
If you do not find out the cause of the issue, then you can try other fonts.
E.g. here on Windows 10, the pre-installed versions of
contain the glyph for character U+2714.
(There are also other check marks such as U+2705 and U+2713. However, I doubt that their glyphs will be displayed on systems where the glyph for U+2714 is not displayed.)