Re: fontDescriptorWithFamily: method often doesn't produce a valid descriptor
Re: fontDescriptorWithFamily: method often doesn't produce a valid descriptor
- Subject: Re: fontDescriptorWithFamily: method often doesn't produce a valid descriptor
- From: Dave Fernandes <email@hidden>
- Date: Tue, 4 Sep 2007 15:18:13 -0400
Thanks! NSFontManager did the trick.
Dave
On Sep 4, 2007, at 2:46 AM, John Labovitz wrote:
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:
This email sent to email@hidden