Syntax Trouble with ATSFontActivate

Having trouble using an XCmd or XFcn? Post your questions here.

Syntax Trouble with ATSFontActivate

Postby JoeKoomen2011 » Fri Jun 04, 2010 9:01 am

I can't seem to get ATSFontActivate to work for me. Has anyone here used it successfully? Please show me a sample of your code if possible. I'm sure it's a syntax problem on my part. (I could probably use the same for ATSFontDeactivate.)
Joe Koomen
>> Random! ...Damn near killed 'em! <<
User avatar
JoeKoomen2011
 
Posts: 464
Joined: Thu Mar 12, 2009 1:38 pm

Re: Syntax Trouble with ATSFontActivate

Postby JoeKoomen2011 » Fri Jun 04, 2010 9:30 am

Okay. Problem wasn't with my syntax. The "font name" is not the same as the file's name. When you open it up in a font editor you find that there's lots of other characters...
Joe Koomen
>> Random! ...Damn near killed 'em! <<
User avatar
JoeKoomen2011
 
Posts: 464
Joined: Thu Mar 12, 2009 1:38 pm

Re: Syntax Trouble with ATSFontActivate

Postby Mike » Fri Jun 04, 2010 11:17 am

Joe Koomen wrote:I can't seem to get ATSFontActivate to work for me. Has anyone here used it successfully? Please show me a sample of your code if possible. I'm sure it's a syntax problem on my part. (I could probably use the same for ATSFontDeactivate.)


I've been using it in my recent apps with no problems. Here's an example from one of my projects:
Code: Select all
  writeLog("Setting up application specific fonts")
  global gFontRef
  put projPath(this proj) & "Yenco Symbols.ttf" into tPath
  put ATSFontActivate(tPath) into gFontRef
  writeLog("Font setup complete")


It is my understanding that when you quit your app the font is automatically deactivated so you shouldn't need to explicitly use ATSFontDeactivate unless for some reason you want to stop having access to your font prior to quitting.

HTH
Mike Yenco
YENCO.COM
User avatar
Mike
 
Posts: 215
Joined: Sun Jul 06, 2008 8:54 am
Location: Massachusetts, USA

Re: Syntax Trouble with ATSFontActivate

Postby JoeKoomen2011 » Fri Jun 04, 2010 1:23 pm

Thanks Mike, good to know.

My big issue is fonts whose names are different in the System than they are named in the finder. Even font utilities like Suitcase don't show the name that SuperCard wants to see. I have to crack them open to find out what they're really called.

To be frank, I've been embedding fonts in the resource fork since forever. I'm finally getting with the times....
Joe Koomen
>> Random! ...Damn near killed 'em! <<
User avatar
JoeKoomen2011
 
Posts: 464
Joined: Thu Mar 12, 2009 1:38 pm

Re: Syntax Trouble with ATSFontActivate

Postby Mike » Sat Jun 05, 2010 7:38 am

Joe Koomen wrote:Thanks Mike, good to know.

My big issue is fonts whose names are different in the System than they are named in the finder. Even font utilities like Suitcase don't show the name that SuperCard wants to see. I have to crack them open to find out what they're really called.

To be frank, I've been embedding fonts in the resource fork since forever. I'm finally getting with the times....


Hi Joe,

I don't know. You could look through the following PDF for some clues perhaps (this was the original reference I believe I pointed Mark to although I believe it was the HTML version of this which no longer seems to be available*):

http://developer.apple.com/legacy/mac/library/documentation/Carbon/Conceptual/ATS_Concepts/ManagingFonts.pdf

*It seems that Apple has now depreciated the ATS stuff and has moved to Core Text instead (at least, that's what turned up when I went back to try to find the HTML version of the ATS Font documentation).
Mike Yenco
YENCO.COM
User avatar
Mike
 
Posts: 215
Joined: Sun Jul 06, 2008 8:54 am
Location: Massachusetts, USA


Return to Using Externals

Who is online

Users browsing this forum: No registered users and 2 guests