I'm trying to write an app and don't know how to start.
I'll have a selector with a list of true type fonts.
Each font will represent a different set of chars. Example
*arial-font
*arabic-font
*russian-font
*cyrillic-font
When the user select one of them, I should list all chars
available in the font.
With ansi characterset it's easy, just loop from 0-255 and
print the char representation of an integer value, but I don't
know how to achieve this.
How to achieve what? As Victor has pointed out, anything to do
directly with fonts is platform dependent, and you'll have to
ask specifically in a newsgroup for that platform. This
includes the question of how the font is encoded (ISO 8859-n,
JIS, various Unicode formats, etc.). After that, it's just a
simple for loop from the smallest encoding to the largest,
skipping illegal encodings, and probably non-printable
characters. Except, of course, that the number of characters
can be quite large: Unicode defines over a million, and I think
most far eastern encodings (e.g. JIS) will have tens of
thousands. So I'm not sure how you're going to list them all.
And while I'm at it: with ASCII (not ANSI) characters, the range
is 0-127, not 0-255, and characters in the range 0-31,127 are
control characters, with no printable representation (and which,
depending on the display device, may cause some other behavior).
Also: Arial is a font, but Arabic, Russian and Cyrillic aren't.
Arabic and Cyrillic are alphabets, and Arabic and Russian are
languages (and Russian is a nationality, and ...). I think you
probably need to learn a bit more about the domain first, before
you start even thinking about how to program the problem.
Although it may be more than you need, the absolute reference
here is, I think, "Fonts and Encodings", by Yannis Haralambous,
O'Reilly, ISBN 0-596-10242-9 (or 2-84177-273-X for the original
French). At the very least, skim over the introduction, and
read the first chapter (which deals with the numerous
pre-Unicode font encodings). (On the Web, Roman Czyborra has
one of the most informative sites I've seen, but I often have
problems accessing it.)