Laurence Harris <email@hidden> replied:
I'm confused. Your example uses ASCII text, but you say the problem
is with drawing Symbol and Wingdings. It sounds like you're trying to
do a direct conversion of the old technique you were using in your
QuickDraw code. The best thing to do in Mac OS X is to use Unicode
for your text and let DrawThemeTextBox use whatever font it needs for
each character.
Larry
Yes, it's a "direct conversion" attempt. Sorry :-)
A complete rewrite is in the works, but in the short term I'm pressing
DrawThemeTextBox(cfstr, kThemeCurrentPortFont, etc) into service to
render
antialiased text (simple strings) in a user-selected (QD) font.
(I'm no Unicode expert, but I'm pretty sure Unicode doesn't specify
the
exact font to render Unicode text, otherwise we'd be re-encoding
the text
every time a user chose Times New Roman instead of another Roman
font like
Bodoni or Futura. I do know that Symbol, etc contain glyphs that
Unicode
uses to render standard "unusual" characters such as the mathematical
summation symbol "sigma", etc. But I'll bet there's no Unicode
character
defined for most of the glyphs in a Wingdings font.)
However, it's clear from experimentation that changing the string
formulation from:
CFStringAppendCString(cfstr, "Hello World!",
GetApplicationTextEncoding());
to
CFStringAppendCString(cfstr, "Hello World!",
GetThemeFontTextEncoding ());
produces different results when that cfstr is passed to
DrawThemeTextBox(),
a successful change in the case of Apple's Trutype Symbol font, but
not in
the case of any in the Wingding family.
DrawThemeTextBox works well for nearly every other QuickDraw font I
set for
the current port.
So I'm hoping there's something obvious to a font/theme expert
that's wrong
in my use of DrawThemeTextBox or the CFStringAppendCString encoding
(thus
my CC to Deborah Goldsmith).