Script/encoding for next dialog

Script/encoding for next dialog

Post by quit » Sat, 31 Jan 2004 07:06:18


I have identified a problem in some code I have cobbled together to
work out metrics of dialog controls. (Thank you for the help so far).

I use getThemeFont ( ... , smSystemScript , ... ) to get a font name

but then, based on http://www.yqcomputer.com/
call ATSUFindFindFromName ( ... , kFontMacintoshPlatform ,
kFontRomanScript , kFontNoLanguage , ...)

It isn't very surprising that this doesn't work on a Japanese system.
The first call is returning a Japanese font name, which is unsuitable
for this use. (?)

But here's where I get lost: the dialog is in fact displayed with Mac
Roman text (not a Japanese font). The application is apparently
running with English selected (a loose term, since I don't know the
right terminology). I do not control the application, as my code is a
plug-in.

Anyway, the key question is: if I am about to use NewColorDialog, how
do I discover the Encoding and Script which will be used to interpret
the strings within the controls of the dialog template? I probably
have the documentation, but can't seem to pick up a "big picture" of
this, only details.

And here's a bonus question: if I can find this information, can I
also change it, so as to display dialogs with MY choice of Encoding
and Script? That would help make localised dialogs display more
reliably. Is it safe to change it only to start the dialog, and then
change it right back...?

Thanks in advance for any insight.
----------------------------------------
Aandi Inston XXXX@XXXXX.COM http://www.yqcomputer.com/
Please support usenet! Post replies and follow-ups, don't e-mail them.
 
 
 

Script/encoding for next dialog

Post by Benjamin R » Sat, 31 Jan 2004 23:34:42

Hi Aandi,


XXXX@XXXXX.COM (Aandi Inston) writes:

You may want to use Font Manager functions to go directly from
QuickDraw font ids to ATS font families, see
FMGetATSFontFamilyRefFromFontFamily() and similar functions.

If you want to stick with your current scheme going through the family
name, ATSFontFamilyFindFromQuickDrawName() should help.


Each font has a number of names in various localizations. So it's not
surprising that the canonical ATS name and the QuickDraw name are not
always the same. At the minimum, you'd have to specify the right
script (the default font encoding) in your call to
ATSUFindFindFromName() above.


Don't know about that one. Shouldn't dialog resources be tagged with
the script somewhere? A dialog resource usually contains text, so it
depends on that information.


benny