• 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: fontDescriptorWithFamily: method often doesn't produce a valid descriptor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >fontDescriptorWithFamily: method often doesn't produce a valid descriptor (From: Dave Fernandes <email@hidden>)
 >Re: fontDescriptorWithFamily: method often doesn't produce a valid descriptor (From: John Labovitz <email@hidden>)

  • Prev by Date: [MEET] September CocoaHeads Mac Developer Meetings
  • Next by Date: NSURLRequest and WebKit/NSURLConnection crash
  • Previous by thread: Re: fontDescriptorWithFamily: method often doesn't produce a valid descriptor
  • Next by thread: NSButtonCell image leaking?
  • Index(es):
    • Date
    • Thread