• 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
Common Font Style Names
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Common Font Style Names


  • Subject: Common Font Style Names
  • From: Gordon Apple <email@hidden>
  • Date: Fri, 04 Feb 2011 13:00:56 -0600
  • Thread-topic: Common Font Style Names

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?


_______________________________________________

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

  • Prev by Date: Re: Home-brewed code is 100X faster than -[NSScanner scanDecimal:] ??
  • Next by Date: Is childrenKeyPathForNode robust?
  • Previous by thread: Processing Video Frame in Realtime
  • Next by thread: Re: Common Font Style Names
  • Index(es):
    • Date
    • Thread