• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [Q] FMDeactivateFonts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] FMDeactivateFonts


  • Subject: Re: [Q] FMDeactivateFonts
  • From: Mark de Jong <email@hidden>
  • Date: Mon, 20 May 2002 15:59:04 -0700

Hi.

I've asked this question on both Apple's and Omni Group's development lists and have received no responses whatsoever. Can't any of you at least give me a clue as to how I might approach debugging this problem? (If I sound desperate, it's probably because I am. <grin>)

Thanks.

-- Mark

On Saturday, May 18, 2002, at 11:52 PM, Mark de Jong wrote:

Hi!

I've written a Cocoa application that allows previewing of fonts. I'd like to be able to display fonts regardless of whether they've been activated by the system or not, so I use FMActivateFonts() to activate them and then use FMDeactivateFonts() when I'm done with them.

What I've noticed is that the fonts display fine as long as I never call FMDeactivateFonts(). Once I call FMDeactivateFonts(), and then try to re-activate them and view them, I get an error like this:

----------
Failed to set font ("CGS Helvetica-Bold 15.98 pt. P [] (0x0190fca0) fobj=0x01911840, spc=0.00") ATSUStyle 0x14BF850
----------

When I use gdb to view an NSFont, I notice the following. If FMDeactivateFonts() has not been called, then:

(gdb) po aFont
"CGS Helvetica-Bold 16.00 pt. P [] (0x019528c0) fobj=0x01952440, spc=4.45"

However, as soon as FMDeactivateFonts() has been called on the font and a subsequent FMActivateFonts() is called, I get:

(gdb) po aFont
"CGS Helvetica-Bold 16.00 pt. P [] (0x0193ff90) fobj=0x01951e70, spc=0.00"

and the font displays incorrectly, or sometimes doesn't display at all. It seems to be due to the "spc=0.00" rather than "spc=4.45".

Is there some trick to using FMActivateFonts() and FMDeactivateFonts() correctly? Here's a snippet of code that I use:

...
if( activate ) {
err = FMActivateFonts( &myFontFSSpec, NULL, NULL, globalScope ? kFMUseGlobalScopeOption : kFMDefaultOptions );
}
else {
err = FMDeactivateFonts( &myFontFSSpec, NULL, NULL, kFMDefaultOptions );
}
...

where "activate" and "globalScope" are booleans passed into the method. I have tried the different constant variations for local and global scope without any change in symptom. I have also used "NULL" as the last parameter to FMDeactivateFonts() with no change. Depending on the documentation I have found, the constants passed in these functions have different names.

Thanks, in advance, for any insight you can offer into this dilemma.

-- Mark
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >[Q] FMDeactivateFonts (From: Mark de Jong <email@hidden>)

  • Prev by Date: Re: Vertical Split View...
  • Next by Date: How to programmatically set the app version number?
  • Previous by thread: [Q] FMDeactivateFonts
  • Next by thread: AltiVec optimization in Cocoa?
  • Index(es):
    • Date
    • Thread