Display ALL characters for a given font?

Hi,
Is it possible with Xojo to display all characters for any selected font?

I would like to be able to select a font, from my installed fonts, and then have every character in that font displayed.
Any pointers to if this is even possible, and if so - where to start, would be appreciated.

Thank you all in advance.

With MBS Plugin you can get list of all characters in a font and show them.

CoreText does it as well as DynaPDF.

Christian - do you have an example of this? If so, do you have the link, as I can never find anything on your site - it is too huge :slight_smile:

Thanks.

[code]Sub Action()
TextArea1.TextFont = “Arial”
Dim T as String
For i as integer = 32 to &hFBB0
T = T+chr(i)
next
TextArea1.Text = T

End Sub
[/code]

Thanks Michel.

What does &hFBB0 refer to?
I am trying to work out why there is a hex code there, as opposed to an integer?

I tried googling it, but the results seemed to display nothing relevant?

The application just hangs and does nothing, but if I change &hFBB0 to 255 for example, - I can then see lots of characters?

Thanks Michel.

&HFBBO is the highest normally define UNICODE value
but not all encodings go that far, and not all fonts have characters in all the codepoints

Thanks Dave,
Hmmm, the application just hangs when I use &hFBB0, so I now have no idea what to change it to?

[quote=193899:@Richard Summers]Thanks Dave,
Hmmm, the application just hangs when I use &hFBB0, so I now have no idea what to change it to?[/quote]

It does not hang, it just takes a while for all the characters to populate the string. You said ALL characters. Arial happens to contain approximately 3500 character positions.

A standard character set can be for instance 32 to 255 decimal.

&hFBB0=64,432

Holy Moly - that just froze my app also!

Seems like this is not going to be possible. If I use the maximum number (64432) - the app hangs, and I have no way of finding out the maximum integer required for any given font.

Arghhhhhhh.

if you breakpoint the code…
the issue is NOT creating the “T” string… it is inserting that string into the Text Area

I ran it… and it took about 2 seconds to get to the TextArea.text=T line

and about 30-45 seconds to insert into textarea

but you need to insure the encoding on “T” is correct

Sorry Dave, I don’t quite understand?
I created an empty project, then dragged in a TextArea - then put Michel’s code into the window.open event.

Are you saying you did the same, and you only had to wait 2 seconds for all the characters to display?
If so, that’s weird. When I run the app - the window doesn’t even appear. I just get the spinning beach ball of doom?

no…

this took 2 seconds

 TextArea1.TextFont = "Arial"
  Dim T as String
  For i as integer = 32 to &hFBB0
    T = T+chr(i)
  next

this took about 45 seconds

  TextArea1.Text = T

Holyyyyyyy Molyyyyyyy! :slight_smile:
I guess that definitely isn’t the route to go then :slight_smile:

PS
You edited your post (added the last 2 lines), and now it looks like I’m a dummy who doesn’t understand simple English :wink:

Thanks Dave - I appreciate you taking the time to help.

what exactly are you attempting to do? perhaps there is a “better way”

It is probably possible to display that instantly with a declare, but it does take time in pure Xojo.

You may want to do that in a timer instead, so it displays right away something :

Add a multiple timer with a period of 1 to your window with this in its Action event :

[code]Sub Action()
static char as integer = 32
if char < &hFBB0 then
TextArea1.Text = TextArea1.Text + chr(char)
char = char+1
else
me.enabled = False
end if

End Sub
[/code]

I simply want to display all characters for any font selected by the user.

Nothing more, nothing less :slight_smile:

[quote=193912:@Richard Summers]I simply want to display all characters for any font selected by the user.

Nothing more, nothing less :)[/quote]

The Edit/Emoji and symbols menu option does that very nicely…

or FONT BOOK in OSX

Thanks guys.
I tried Michel’s new code, but it still takes around the same amount of time - except that it displays the characters in a typewriter style (character by character).

Unfortunately, this is still phenomenally slow :frowning:

I need MY APP to do this however, as opposed to using third party apps.

Thanks for all the help.