What is the correct way to Embed Fonts with Unicode names?
What do you mean by embed?
I want to embed fonts in to my application with the font names being
some unicode names. But later when I do list the fonts with
CreateStandardFontName the name comes some junk characters. During
AddResource to add FOND/sfnt I do pass the font name in UTF8 encoding.
Where exactly do we specify the encoding of this font name so that we
get the name correctly in the menu returned by CreateStandardFontName?
I assume you mean CreateStandardFontMenu? If so, the font name comes
from the FOND resource if the font has one. The FOND is a older
resource and does not support Unicode names. They need to be in a Mac
encoding. The script is encoding in the FOND resource ID. If you need
to deal with Unicode fonts and font names, I suggest you move away
from Quickdraw, and I would suggest you use the Font panel instead of
CreateStandardFontMenu.
I can see TextEncoding information available in the FontFamilyRef
(FMGetFontFamilyTextEncoding). But I may be embedding any of the
available fonts with a Unicode name. Thank you for any help.
This is the encoding of the font based on the FOND resource ID and
generally has nothing to do with names that may come from the font
name table. However, it does provide the system with the encoding of
the family name (from FOND resource ID) which is used with the font
menu. If this is not correct, then the encoding in the menu will
likely be wrong.
The script code is encoded in the FOND resource ID via the follow:
scriptCode = ((resourceID - 16384) / 512) + 1;
Please refer to Inside Mac: Text page B-6 as a reference.
-Nathan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden