• 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: Getting font info
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting font info


  • Subject: Re: Getting font info
  • From: Brian Webster <email@hidden>
  • Date: Fri, 31 May 2002 15:44:21 -0500

On Friday, May 31, 2002, at 02:49 PM, cocoa-dev-
email@hidden wrote:

Getting an NSDictionary from the FontAttributes of the attributed string
dict = [as fontAttributesInRange:NSMakeRange(0,1)];

And finally, reading the font attribute and checking it for the "Bold"
string.

Try this:

NSFont *font = [dict objectForKey:NSFontAttributeName];
if(([[NSFontManager defaultManager] traitsOfFont:font] & NSBoldFontMask) != 0)
//the font is bold

--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Objective C array
  • Next by Date: Re: Objective C array
  • Previous by thread: Re: Getting font info
  • Next by thread: Re: Getting font info
  • Index(es):
    • Date
    • Thread