• 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: John Labovitz <email@hidden>
  • Date: Mon, 3 Sep 2007 23:46:14 -0700

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


  • Follow-Ups:
    • Re: fontDescriptorWithFamily: method often doesn't produce a valid descriptor
      • From: Dave Fernandes <email@hidden>
References: 
 >fontDescriptorWithFamily: method often doesn't produce a valid descriptor (From: Dave Fernandes <email@hidden>)

  • Prev by Date: fontDescriptorWithFamily: method often doesn't produce a valid descriptor
  • Next by Date: Re: check if a file path is useable
  • Previous by thread: fontDescriptorWithFamily: method often doesn't produce a valid descriptor
  • Next by thread: Re: fontDescriptorWithFamily: method often doesn't produce a valid descriptor
  • Index(es):
    • Date
    • Thread