On 4 Apr '08, at 3:37 PM, Jens Alfke wrote:

In my application's user interface I want to use some TrueType fonts which are not built into the OS. (Yes, they're free and their licenses allow this sort of use.) I thought I remembered a way to embed fonts in an application bundle, or to programmatically load a font from a file; but I'm drawing a blank now when I try to look it up.

FYI, Ben Stiglitz emailed me an even simpler solution that requires no code at all:

Begin forwarded message:

From: Benjamin Stiglitz <[EMAIL PROTECTED]>
Date: 4 April, 2008 11:02:06 PM PDT
To: Jens Alfke <[EMAIL PROTECTED]>
Subject: Re: How do I embed a font in an app?

ATSFontActivateFromFileSpecification is deprecated in Leopard, but the new replacement function, ATSFontActivateFromFileReference, is identical except for taking an FSRef instead of an FSSpec. So it makes the code even simpler.

Even better is an Info.plist key for all the fonts you could want: ATSApplicationFontsPath. http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/PListKeys.html#/ /apple_ref/doc/uid/20001431-SW8

-Ben

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to