Welcome to Soft32 Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Finding raw font file data from an ATSUFontID or font name

 
   Soft32 Home -> Mac -> Programmer Help RSS
Next:  [ANNOUNCE] Jun for Java (Jun729)  
Author Message
Daniel Walter

External


Since: Jun 24, 2009
Posts: 2



(Msg. 1) Posted: Wed Jun 24, 2009 9:25 pm
Post subject: Finding raw font file data from an ATSUFontID or font name
Archived from groups: comp>sys>mac>programmer>help (more info?)

I have a library that requires either a path to a ttf file or the raw
data that is contained in a ttf file. I would like to get this data
from an ATSUFontID for an installed system font. Is this possible on
a Mac?
Back to top
Login to vote
David Phillip Oster

External


Since: Jul 21, 2005
Posts: 1426



(Msg. 2) Posted: Wed Jun 24, 2009 11:17 pm
Post subject: Re: Finding raw font file data from an ATSUFontID or font name [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
<037a153d-30cc-44b0-82d8-8d9d8dd44208 DeleteThis @m18g2000vbi.googlegroups.com>,
Daniel Walter <d2walter DeleteThis @gmail.com> wrote:

> I have a library that requires either a path to a ttf file or the raw
> data that is contained in a ttf file. I would like to get this data
> from an ATSUFontID for an installed system font. Is this possible on
> a Mac?

Sure. see "Curves In Quickdraw"
http://www.mactech.com/articles/develop/issue_08/Reed_text.html The
sample code shows how to parse a ttf file.
Back to top
Login to vote
Daniel Walter

External


Since: Jun 24, 2009
Posts: 2



(Msg. 3) Posted: Thu Jun 25, 2009 8:11 am
Post subject: Re: Finding raw font file data from an ATSUFontID or font name [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Jun 25, 2:17 am, David Phillip Oster <os....DeleteThis@ieee.org> wrote:
> In article
> <037a153d-30cc-44b0-82d8-8d9d8dd44....DeleteThis@m18g2000vbi.googlegroups.com>,
>  Daniel Walter <d2wal....DeleteThis@gmail.com> wrote:
>
> > I have a library that requires either a path to a ttf file or the raw
> > data that is contained in a ttf file.  I would like to get this data
> > from an ATSUFontID for an installed system font.  Is this possible on
> > a Mac?
>
> Sure. see "Curves In Quickdraw"http://www.mactech.com/articles/develop/issue_08/Reed_text.htmlThe
> sample code shows how to parse a ttf file.

My goal is to find the ttf file or the ttf file data. I don't have
this file, all I have is a ATSUFontID.

Daniel
Back to top
Login to vote
Reinder Verlinde

External


Since: Jul 23, 2007
Posts: 258



(Msg. 4) Posted: Fri Jun 26, 2009 3:20 pm
Post subject: Re: Finding raw font file data from an ATSUFontID or font name [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
<037a153d-30cc-44b0-82d8-8d9d8dd44208 RemoveThis @m18g2000vbi.googlegroups.com>,
Daniel Walter <d2walter RemoveThis @gmail.com> wrote:

> I have a library that requires either a path to a ttf file or the raw
> data that is contained in a ttf file. I would like to get this data
> from an ATSUFontID for an installed system font. Is this possible on
> a Mac?

<http://lists.apple.com/archives/carbon-dev/2008/Feb/msg00429.html>
seems to indicate that you can do:

ATSFontRef ref = (ATSFontRef) targetATSUFontID;

If not, try FMGetATSFontRefFromFont. It takes a FMFont, but according to
ATSUnicodeTypes.h, we have:

typedef FMFont ATSUFontID;

However, I think that call is deprecated.

Once you have a ATSFontRef, you should be able to do

FSRef fileRef;
OSStatus status = ATSFontGetFileReference( ref, &fileRef);

to get a file reference. If you really need the path, you will have to
do some FSGetCatalogInfo calls from there to build that path. I would
not go that route, but use the FSRef directly to attempt to read the
data. I do not know whether that will succeed when the font is activated.

Similarly, the FMGetATSFontRefFromFont or ATSFontGetFileReference calls
may fail if a font is installed but not activated. The documentation
does not make that clear to me.

Reinder
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Is there any program to get details of font from a font file - Hai all I am new bie in objecrive c. I want to do a program to read font from cd/system and change the text in text..

Is file a font file? - How can detect a file without extension is font file or not in cocoa? or any other I tried with CFStringRef..

Application font? - I'd like to have an application make use of a custom font I want to package with my application. Is this something tha...

Help with application font/bundle - I'm working on a Carbon application that I need to include a custom font with. I'm having trouble integrating the fon...

Retrieving A Selected Font - All right. I need to provide a means for users of my application to select a couple of fonts for output text. How do I....

Font panel "changeAttributes:" - Hi, I have a table, and I am trying to set the font of a cell. I am using the NSDocument object to set the font by..
       Soft32 Home -> Mac -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum

Categories:
 Windows
 Linux
  Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]