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: fontDescriptorWithFamily: method often doesn't produce a valid descriptor



On Sep 3, 2007, at 11:19 PM, Dave Fernandes wrote:

Am I using NSFontDescriptor's fontDescriptorWithFamily mehtod correctly? I would like to substitute fonts in an attributed string with a font from a different family, but with the same typeface, etc. as the original font in the string.

Your code looks okay at first glance.

I've had trouble converting fonts using NSFontDescriptor. I had the same trouble as you -- I'd get nil back instead of a new font descriptor, even though my parameters seemed reasonable.

I found that NSFontManager's conversion routines were more reliable (you probably want -convertFont:toFamily:). It also seems like the better place to ask for font conversions, since you can subclass NSFontManager to perform your own brand of font conversion.

Honestly, I'm still trying to figure out what NSFontDescriptor *is* good for, besides being another way to describe a font.

--John

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >fontDescriptorWithFamily: method often doesn't produce a valid descriptor (From: Dave Fernandes <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.