Unicode character in ListIconGadget not rendered correctly

Everything else that doesn't fall into one of the other PB categories.
User avatar
Kukulkan
Addict
Addict
Posts: 1415
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Unicode character in ListIconGadget not rendered correctly

Post 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:

Image

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
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Unicode character in ListIconGadget not rendered correct

Post by Dude »

Got some demo code so I can run and test on my Win 7 machine?
User avatar
Kukulkan
Addict
Addict
Posts: 1415
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: Unicode character in ListIconGadget not rendered correct

Post 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).
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Unicode character in ListIconGadget not rendered correct

Post by srod »

Works fine here on Win 7.

Tested with PB 4.50x86, PB 5.70LTS x64, PB 5.70LTS x86.
I may look like a mule, but I'm not a complete ass.
User avatar
Kukulkan
Addict
Addict
Posts: 1415
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: Unicode character in ListIconGadget not rendered correct

Post 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.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Unicode character in ListIconGadget not rendered correct

Post 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
I may look like a mule, but I'm not a complete ass.
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: Unicode character in ListIconGadget not rendered correct

Post 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")
  ...
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Unicode character in ListIconGadget not rendered correct

Post 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.
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: Unicode character in ListIconGadget not rendered correct

Post 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 :wink:
(Look in the middle of download page of your user account. It is there)
Little John
Addict
Addict
Posts: 4812
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Unicode character in ListIconGadget not rendered correct

Post by Little John »

I just searched with Google:
https://www.google.com/search?q=unicode ... +windows+7

This yielded several results, e.g.
https://superuser.com/questions/520355/ ... y-as-boxes
https://bugs.chromium.org/p/chromium/is ... l?id=42984

Whatever the problem actually is, it looks to me that it is probably not a PureBasic problem.
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Unicode character in ListIconGadget not rendered correct

Post by Dude »

Marc56us wrote:5.46 LTS is not in the museum because it's the actual LTS
Oh yeah, I missed that. :oops:

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.
User avatar
Kukulkan
Addict
Addict
Posts: 1415
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: Unicode character in ListIconGadget not rendered correct

Post 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.
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: Unicode character in ListIconGadget not rendered correct

Post by Marc56us »

Anything else I can try?
Use #PB_ListIcon_CheckBoxes
  • Checked = Done
  • Unchecked = Progressing
:wink:
User avatar
Kukulkan
Addict
Addict
Posts: 1415
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: Unicode character in ListIconGadget not rendered correct

Post by Kukulkan »

:D 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).
Little John
Addict
Addict
Posts: 4812
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Unicode character in ListIconGadget not rendered correct

Post 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.)
Post Reply