Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is NSFontManager lying to me ?



Hi Robert,

I was discussing this issue with a Mac IT Admin and he emailed me the following link:
http://www.adobe.com/support/techdocs/329299.html


It's an Adobe Tech Doc. It seems that Adobe apps have similar issues. He stated that it could be when the Application (Acrobat Reader?) was first installed and the font exist on a the Adobe CD.

Not really sure how "AdobeFnt06.lst" can add/affect the "availableFonts".

Hope this helps.

Thanks,
John Nunez



On Feb 27, 2006, at 8:10 AM, Robert Clair wrote:

A friend was testing an app for me and it crashed on his system at start-up. The immediate problem was a piece of code like this:

NSArray* fontList = [[NSFontManager sharedFontManager] availableFonts];
int fontCount = [fontList count];
for ( j=0; j < fontCount; j++ )
{
NSFont* font =
[NSFont fontWithName: [fontList objectAtIndex: j] size: 18.0];


NSDictionary* fontStringAttributes =
[NSDictionary dictionaryWithObject: font
forKey: NSFontAttributeName];


          ...

    }

The problem is that font came back nil at some point and [NSDictionary dictionaryWithObject: forKey] spit up and crashed because it didn't like the nil.

OK - My fault for not checking for nil and easy to fix. But the larger issue is why is NSFontManger telling me a font is available when NSFont refuses to create an instance ?

On further investigation the guilty fonts are:

     GloucesterMT-ExtraCondensed

and

     AbadiMT-CondensedExtraBold

Looking in the usual font locations there are no font files of these names nor does

find / -name "*GloucesterMT-ExtraCondensed*" -print > findResults, etc show up any font files. A good reason not to create an instance.

A Spotlight search showed that those names appear in:

  ~Library/Application Support/Adobe/TypeSpt/AdobeFnt06.lst.

I don't know about AdobeFnt.lst files, but a little Googling shows they seem to be the cause of lots of trouble. The friend is a math type not a graphic arts type and says he didn't consciously install those fonts.

Bob Clair



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/john% 40coolmacgames.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Why is NSFontManager lying to me ? (From: Robert Clair <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.