Font SEGOE and PB IDE

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5500
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Font SEGOE and PB IDE

Post 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 :shock:
I can named easily a folder with : Miscellaneous symbols, Mongolian, Syriac, Chinese, etc .... and that ...without adding something or download other font 8)

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 :idea:
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 :oops:

Thanks in advance for your help

Have a good day
ImageThe happiness is a road...
Not a destination
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Font SEGOE and PB IDE

Post 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.
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
AZJIO
Addict
Addict
Posts: 2225
Joined: Sun May 14, 2017 1:48 am

Re: Font SEGOE and PB IDE

Post 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")
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5500
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Font SEGOE and PB IDE

Post by Kwai chang caine »

"Salut" Boddhi :wink:

Aaah OK ! thanks for your precious explanation 8)
I stupidly believed that if it's the same name of font, it's exactely the full font :oops:
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 :idea:
In all case again thanks 8)

@AZJIO
Whaoooouuuhh !!!
Very splendid idea you have, and give to me, thanks a lot 8)
Thanks to your nice code i can see, in one click all the table of characters the IDE can write :shock: in fact....not so much :lol:
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 :wink:
ImageThe happiness is a road...
Not a destination
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5500
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Font SEGOE and PB IDE

Post 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 :shock:
Surely not all, but nothing to see with PB IDE :wink:

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 ?

Image

Image

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 

ImageThe happiness is a road...
Not a destination
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Font SEGOE and PB IDE

Post 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.
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Bitblazer
Enthusiast
Enthusiast
Posts: 766
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Font SEGOE and PB IDE

Post by Bitblazer »

Did you try GNU Unifont?
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5500
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Font SEGOE and PB IDE

Post 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 8)
Bitblazer wrote: Fri May 31, 2024 6:09 pm Did you try GNU Unifont?
Thanks for your link that I did not know 8)
I have answer you on the over thread :wink:
ImageThe happiness is a road...
Not a destination
User avatar
Blue
Addict
Addict
Posts: 972
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Re: Font SEGOE and PB IDE

Post 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 ?
PB Forums : Proof positive that 2 heads (or more...) are better than one :idea:
AZJIO
Addict
Addict
Posts: 2225
Joined: Sun May 14, 2017 1:48 am

Re: Font SEGOE and PB IDE

Post 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.
User avatar
Blue
Addict
Addict
Posts: 972
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Re: Font SEGOE and PB IDE

Post 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…
PB Forums : Proof positive that 2 heads (or more...) are better than one :idea:
Post Reply