Page 1 of 1

How to include font with app

Posted: Wed Dec 23, 2009 9:06 pm
by WilliamL
I have a program that uses a font (New York) that doesn't seem to be pre-installed on the new Macs. I would like to put the font in the 'Contents' folder so the app can use that font. Is there any way to do that?

Right now my strategy is to try to load the preferred font and if that fails then load a font that is part of the system (at least I think Geneva is required).

Code: Select all

Global font$
Enumeration 1 ; font #s
    #fontsize14
    #fontsize18
    #fontsize12
EndEnumeration
font$="New York"
If LoadFont(#fontsize14,font$,16)
    LoadFont(#fontsize12,font$,12)
    LoadFont(#fontsize18,font$,18)
Else
    font$="Geneva"
    ;MessageRequester("Loading fonts...","Preferred font not found"+Chr(13)+"...will use Geneva.")
    LoadFont(#fontsize14,font$,14)
    LoadFont(#fontsize12,font$,12)
    LoadFont(#fontsize18,font$,18)
EndIf
How do you suggest I handle it?

Re: How to include font with app

Posted: Thu Dec 31, 2009 3:40 am
by Airr
You would want to place the font in Contents/Resources, and then use the ATSFontActivateFromFileReference api to notify the system that the font is available (you can set it so that only your app knows about the font, or the globally for the system).

Here's the link to the Apple Type Services Documentation...

AIR.