Hi there;
We have an application running under QNX 4.25 / Photon 1.14. We’d like to
add foreign language support. Most of our draw operations for a significant
part of the system pass through the function: PgDrawText.
To summarize my questions at the start:
-
How do I make the system show me specific characters from a given
character set? -
How do I find out the relationship between 16 bit Unicode values and the
characters that will be displayed for them.
I’ve played around with this, and I’ve had some luck making non-US
characters appear.
The approach I’ve tried is:
static PxTransCtrl * myTrans;
int srctaken, dstmade;
char str[SOME_BYTES]; // Input from calling function
char utf[1024 * MB_LEN_MAX];
myTrans = PxTranslateSet(NULL, “ISO_8859-2:1987”); // done just once
PxTranslateToUTF(trans, str, strlen(str), &srctaken, utf, (1024 *
MB_LEN_MAX), &dstmade);
PgSetFont(“pcterm12”);
PgDrawText(utf, dstmade, &Pos, Pg_BACK_FILL);
I can make this give me ASCII output kinds of US characters when I stay
below 0x7F for input characters. This is just as I expect. When I give it
characters above 0x7F the data out of the PxTranslateToUTF starts doing it’s
translation thing, and the characters coming out the PgDrawText function
take on that international look I’m after. All well and good.
The big question is: how do I make it show me specific characters from a
specific set? An interesting set to look at would be Korean, or Cyrillic.
A limitation I can see here is that the data I’m feeding my function are 8
bit values. How do I find out what characters go with 16 bit Unicode values?
Is there a way to look at a font and see the characters in it? Some of the
font files in the /usr/photon/font directory look kind of small (some as
small as 3k). No way are they completely populated with 64k characters.
I can look at the characters that come out of the PxTranslateToUTF function.
They look like normal ASCII characters as long as I stay below 0x7F (I
expected this).
When I put characters above 0x7F into the str array, then I get “translated”
characters out the other side. This is again kind of what I would expect.
Is there a way to look at a font file and see what characters are available
in it?
Thanks for any help you can give.
Steve Shumway
Software Engineer
Facts, Inc.