Re: Common Font Style Names
Re: Common Font Style Names
- Subject: Re: Common Font Style Names
- From: Matt Neuburg <email@hidden>
- Date: Sat, 5 Feb 2011 14:53:19 -0800
On Fri, 04 Feb 2011 13:00:56 -0600, Gordon Apple <email@hidden> said:
>This used to work, but not under iOS 4.
>
>- (NSString*)styleNameForIndex:(NSUInteger)index
>inFontFamily:(NSString*)famName {
> NSString* fontName = [[UIFont fontNamesForFamilyName:famName]
>objectAtIndex:index];
> CTFontRef fontRef = CTFontCreateWithName((CFStringRef)fontName, 0.0,
>NULL);
> CFStringRef style = CTFontCopyName(fontRef, kCTFontStyleNameKey);
> CFRelease(fontRef);
> return [(NSString*)style autorelease];
>}
>
>Now I get names like "Oblique" instead of "Italic". Is there a better way
>to get the common style names for display?
>
I doubt anything has actually changed. Some fonts, like Courier and Helvetica, have an oblique variant; some have an italic variant; some have neither. Exactly what font family are you starting with? m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.apeth.net/matt/default.html#applescriptthings_______________________________________________
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