On 12 Apr 2010, at 4:08 PM, Eric E. Dolecki wrote:
> http://www.alexcurylo.com/blog/2008/10/05/snippet-available-uifonts/
That gets you things like "CourierNewPS-BoldItalicMT," which the OP made clear
he doesn't want. He wants to know how to get the two strings "Courier New" and
"Bold Italic." The first can come from [UIFont familyNames], as shown in the
sample you link to, but it doesn't show how to get the style name.
I don't have ready access to the documentation (AppKiDo iPhone isn't speaking
to me just now), which may have an easier answer, but I fear the answer is one
of these:
1. Apple can do it because it already knows the names of its fonts and can keep
the translations in a table. They can afford to do this because the iWork
developers get privileged access to that information, and can coordinate with
updates that might add more fonts in the future.
You could do the same, but would be subject to bit rot as the OS changes.
2. Fake the variant names:
a. If there is only one variant, use the family name and call it
"Regular." Or don't offer a variant, as your need may be.
b. Otherwise, take the portion of the variant name that follows the
"-", strip off trailing capital letters, and insert spaces in front of embedded
caps.
Again, an OS update could break this.
It surprises me that font variants seem not to be accessible in the abstract in
iPhone OS as of the versions we are permitted to discuss here. On the Mac side,
NSFont and NSFontDescriptor provide a mechanism that you can put a font or font
name into, and get strings or masks back.
— F
_______________________________________________
Cocoa-dev mailing list ([email protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]