Re: Getting font info
Re: Getting font info
- Subject: Re: Getting font info
- From: email@hidden
- Date: Fri, 31 May 2002 16:08:12 -0500
D'oh! That was supposed to be in response to Carl's query about
Objective-C arrays. Sorry, folks.
email@hidden
Sent by: To: email@hidden
cocoa-dev-admin@list cc:
s.apple.com Subject: Re: Getting font info
05/31/02 03:51 PM
There's probably a better answer, but off the top of my head:
Wouldn't it be possible to make an NSMatrix of your classCredit
NSTextFields, then use an NSEnumerator to step through them?
-Joe
Brian Webster
<email@hidden> To:
email@hidden
Sent by: cc: Peter Schols
<email@hidden>
cocoa-dev-admin@list Subject: Re: Getting
font info
s.apple.com
05/31/02 03:44 PM
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.
_______________________________________________
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.
_______________________________________________
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.