Page 1 of 1
Font SEGOE and PB IDE
Posted: Fri May 31, 2024 12:26 pm
by Kwai chang caine
Hello at all,
I see the default font Segoe UI of windows is able to write all or nearly all the UNICODE characters
I can named easily a folder with : Miscellaneous symbols, Mongolian, Syriac, Chinese, etc .... and that ...without adding something or download other font
Then i say to me, if i use the same font Segoe UI than Windows in my lover IDE PB, i can also writing all the UNICODE characters inside him
And well no

in the IDE the SEGOE font not be able to write all the UNICODE characters, i obtain numerous interrogation point "?" in place, and i not understand why
Thanks in advance for your help
Have a good day
Re: Font SEGOE and PB IDE
Posted: Fri May 31, 2024 1:49 pm
by boddhi
Salut KCC,
Not all of them, just those that are present in the charsets.
Some Unicode ranges are not supported.
E.g.: Code 127199 is present, range [127200-127369] is not but 127370 is.
It may also depend on the font version.
In IDE, Consolas font do the job too.
Also, the '?' is often the sign of a problem converting from utfX to utfY or ASCII.
Re: Font SEGOE and PB IDE
Posted: Fri May 31, 2024 2:18 pm
by AZJIO
Code: Select all
EnableExplicit
Define *mem, i, *c.Character, max = $FFFF, count, CountCharacter = 100
*mem = AllocateMemory(max * 2 + max * 2 / CountCharacter + 4)
*c = *mem
If *mem
For i = 32 To max
*c\c = i
*c + 2
count + 1
If count > CountCharacter
*c\c = 10
*c + 2
count = 0
EndIf
Next
*c\c = 0
SetClipboardText(PeekS(*mem))
FreeMemory(*mem)
EndIf
MessageRequester("Done", "Paste into the editor from the clipboard")
Re: Font SEGOE and PB IDE
Posted: Fri May 31, 2024 3:18 pm
by Kwai chang caine
"Salut" Boddhi
Aaah OK ! thanks for your precious explanation
I stupidly believed that if it's the same name of font, it's exactely the full font

And perhaps Windows download in background, or do something automaticaly for can write all the characters without user intervention ?
And PB IDE not do that
I use the usefull code of AZJIO for see that neither SEGOEI nor CONSOLAS can write all the characters, numerous ? are writing
Perhaps it's possible to create a simple simple GadgetEditor who can writing all the characters of the world like Windows do ? and adding it into tools of IDE, just for the moment where we coding application using UNICODE of the word
In all case again thanks
@AZJIO
Whaoooouuuhh !!!
Very splendid idea you have, and give to me, thanks a lot

Thanks to your nice code i can see, in one click all the table of characters the IDE can write

in fact....not so much

Fortunately, and for once, Windows is much less lazy, because with the poor quantity of characters the IDE can write, i can't use my idea of "Folder one letter name"
Again thanks for your usefull tool, i keep in preciously in my pocket

Re: Font SEGOE and PB IDE
Posted: Fri May 31, 2024 3:55 pm
by Kwai chang caine
Kwai chang caine wrote: Fri May 31, 2024 3:18 pmPerhaps it's possible to create a simple simple GadgetEditor who can writing all the characters of the world like Windows do ?
I have do a little test with nice tool of AZJIO and see the native EditorGadget() of PB can write numerous foreigners characters
Surely not all, but nothing to see with PB IDE
1/ I don't know the font it use ?
2/ Perhaps it's possible to boost it for it can write all characters of the world ?
Code: Select all
Define *mem, i, *c.Character, max = $FFFF, count, CountCharacter = 100
OpenWindow(0, 0, 0, 1900, 1000, "EditorGadget", #PB_Window_SystemMenu)
EditorGadget(0, 8, 8, 1876, 975)
*mem = AllocateMemory(max * 2 + max * 2 / CountCharacter + 4)
*c = *mem
If *mem
For i = 32 To max
*c\c = i
*c + 2
count + 1
If count > CountCharacter
*c\c = 10
*c + 2
count = 0
EndIf
Next
*c\c = 0
FreeMemory(*mem)
SetGadgetText(0, PeekS(*mem))
Repeat
WindowEvent()
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Re: Font SEGOE and PB IDE
Posted: Fri May 31, 2024 5:38 pm
by boddhi
Kwai chang caine wrote:
1/ I don't know the font it use ?
2/ Perhaps it's possible to boost it for it can write all characters of the world ?
1) The default system font: If no change, on Win10, "SEGOE UI" and on Win11, "SEGOE UI variable"
2) As already said, it depends on the used font and its supported Unicode ranges. I needed such a font with all ranges supported for a tool and never found. Even DejaVu font can't do better.
And I don't think I'm saying stupidity when I say that EditorGadget() can only display one font per gadget.
Re: Font SEGOE and PB IDE
Posted: Fri May 31, 2024 6:09 pm
by Bitblazer
Re: Font SEGOE and PB IDE
Posted: Fri May 31, 2024 6:55 pm
by Kwai chang caine
boddhi wrote: Fri May 31, 2024 5:38 pm
1) The default system font: If no change, on Win10, "SEGOE UI" and on Win11, "SEGOE UI variable"
2) As already said, it depends on the used font and its supported Unicode ranges. I needed such a font with all ranges supported for a tool and never found. Even DejaVu font can't do better.
And I don't think I'm saying stupidity when I say that EditorGadget() can only display one font per gadget.
Thanks for your new explanation
Thanks for your link that I did not know
I have answer you on the over thread

Re: Font SEGOE and PB IDE
Posted: Sat Jun 01, 2024 4:55 am
by Blue
AZJIO wrote: Fri May 31, 2024 2:18 pm
Code: Select all
EnableExplicit
Define *mem, i, *c.Character, max = $FFFF, count, CountCharacter = 100
*mem = AllocateMemory(max * 2 + max * 2 / CountCharacter + 4)
[...]
Darn good,
AZJIO !
How did you come up with the fancy number you used to reserve memory ?
Re: Font SEGOE and PB IDE
Posted: Sat Jun 01, 2024 4:47 pm
by AZJIO
Blue wrote: Sat Jun 01, 2024 4:55 am
How did you come up with the fancy number you used to reserve memory ?
max * 2 - number of characters, 2 bytes for each character.
max * 2 / CountCharacter - number of lines. For each line you need to allocate space for the end of line character - LF.
add space for Null at the end.
Re: Font SEGOE and PB IDE
Posted: Sat Jun 01, 2024 7:24 pm
by Blue
AZJIO wrote: Sat Jun 01, 2024 4:47 pm
max * 2 - number of characters, 2 bytes for each character.
max * 2 / CountCharacter - number of lines. For each line you need to allocate space for the end of line character - LF.
add space for Null at the end.
Brilliant. And thanks for shining some light into my dim brain…