Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the correct way to Embed Fonts with Unicode names?





> What is the correct way to Embed Fonts with Unicode names?

What do you mean by embed?

From the existing font I am taking part of character sets or bitmaps and use it as a new font in my application.

>
>
> 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?

Yes, sorry for the typo.

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.

Actually I wanted to give the user option of selecting a name for this font. So the user may choose a name which is a mixture of Japanese/Chinese/English letters, say. But now, from your these words I infer that such a feature is impossible with FOND resources. Am I right? I can only give a name of specific Mac encoding only. 

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.

Sorry, at least for this version I have to deal with Quickdraw only :-(.

>
> 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


--
Sam

 _______________________________________________
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

This email sent to email@hidden

References: 
 >What is the correct way to Embed Fonts with Unicode names? (From: Sam <email@hidden>)
 >Re: What is the correct way to Embed Fonts with Unicode names? (From: Nathan Taylor <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.