Re: Font Style Names for iPhone/iPad
Yes, but no support for actually doing anything useful with CoreText. Can't comment on eventualities, but let's just say I'm not happy. (Sneezy from pollen, Sleepy from too much coding, Grumpy about lack of text support, but definitely not Happy :-) On 4/14/10 10:10 AM, Matt Moriarity matt.moriar...@gmail.com wrote: Core Text is available in 3.2, which I believe is no longer under NDA. On Tue, Apr 13, 2010 at 1:04 PM, Kyle Sluder kyle.slu...@gmail.com wrote: On Apr 13, 2010, at 7:34 AM, Fritz Anderson fri...@manoverboard.org wrote: Has discussion of post-3.1 API been cleared? I understood that the moderator has to expressly say so, and I see no reason not to, but I never saw such a message. Also, the OP wanted a solution that worked for iPhone as well. Didn't even think about it. I used the Mac Core Text reference. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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/matt.moriarity%2Bml%40gmail. com This email sent to matt.moriarity...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Font Style Names for iPhone/iPad
On 12 Apr 2010, at 5:15 PM, Kyle Sluder wrote: Ah, in that case you're going to need to do a little bit more work. But CTFont does everything you need. Take a look at kCTFontStyleNameKey and friends. Has discussion of post-3.1 API been cleared? I understood that the moderator has to expressly say so, and I see no reason not to, but I never saw such a message. Also, the OP wanted a solution that worked for iPhone as well. — F ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Font Style Names for iPhone/iPad
On Apr 13, 2010, at 7:34 AM, Fritz Anderson fri...@manoverboard.org wrote: Has discussion of post-3.1 API been cleared? I understood that the moderator has to expressly say so, and I see no reason not to, but I never saw such a message. Also, the OP wanted a solution that worked for iPhone as well. Didn't even think about it. I used the Mac Core Text reference. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Font Style Names for iPhone/iPad
http://www.alexcurylo.com/blog/2008/10/05/snippet-available-uifonts/ On Mon, Apr 12, 2010 at 5:03 PM, Gordon Apple g...@ed4u.com wrote: How do I get a list of style names for a particular font family for iPhone/iPad? I can get the full font names and have my own font picker which shows those. However, that is not what I really want. I want the secondary list to show the common names, i.e., Bold, Italic, etc., like is shown in the iPad Pages app, not the full font names. In MacOS, NSFileManager has a means to do that. I can't find any equivalent in iPhone OS. I thought of using the full name to create a CGFont, but that still doesn't lead me to the short names that I want. Any ideas? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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/edolecki%40gmail.com This email sent to edole...@gmail.com -- http://ericd.net Interactive design and development ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Font Style Names for iPhone/iPad
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 (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Font Style Names for iPhone/iPad
On Mon, Apr 12, 2010 at 2:47 PM, Fritz Anderson fri...@manoverboard.org wrote: 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. See CTFontCopyDisplayName and file a bug that this should be accessible from UIFont. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Font Style Names for iPhone/iPad
Thanks for the response, but that is what I have now and am trying to get away from. I want ³normal², ³bold² and ³Italic², not ³Veranda², ³Veranda-Bold² and ³Veranda-Italic² for the secondary list. In many cases it might be possible to strip the font Family name, but the font naming convention is not consistent. Some even use contractions. If you look at the font list in Pages on the iPad, it does what I want. On 4/12/10 4:08 PM, Eric E. Dolecki edole...@gmail.com wrote: http://www.alexcurylo.com/blog/2008/10/05/snippet-available-uifonts/ On Mon, Apr 12, 2010 at 5:03 PM, Gordon Apple g...@ed4u.com wrote: How do I get a list of style names for a particular font family for iPhone/iPad? I can get the full font names and have my own font picker which shows those. However, that is not what I really want. I want the secondary list to show the common names, i.e., Bold, Italic, etc., like is shown in the iPad Pages app, not the full font names. In MacOS, NSFileManager has a means to do that. I can't find any equivalent in iPhone OS. I thought of using the full name to create a CGFont, but that still doesn't lead me to the short names that I want. Any ideas? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com http://lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/edolecki%40gmail.com This email sent to edole...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Font Style Names for iPhone/iPad
On Mon, Apr 12, 2010 at 3:08 PM, Gordon Apple g...@ed4u.com wrote: Thanks for the response, but that is what I have now and am trying to get away from. I want ³normal², ³bold² and ³Italic², not ³Veranda², ³Veranda-Bold² and ³Veranda-Italic² for the secondary list. In many cases it might be possible to strip the font Family name, but the font naming convention is not consistent. Some even use contractions. If you look at the font list in Pages on the iPad, it does what I want. Ah, in that case you're going to need to do a little bit more work. But CTFont does everything you need. Take a look at kCTFontStyleNameKey and friends. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Font Style Names for iPhone/iPad
Thanks. That did it. I just needed a display name. I used the following when loading the picker view: - (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]; } My first shot at a FontPicker subclass of UIPickerView was almost as wide as the iPad. After moving to a two-line UILabel and using the short style names, I've got it slimmed down to being usable on an iPhone. BTW, general info in case anybody is interested -- If you are going to use dependent columns in a UIPickerView, the only way I could figure out to do it is to use a timer to poll it for changes in the primary column so you can reload the dependent column. On 4/12/10 5:15 PM, Kyle Sluder kyle.slu...@gmail.com wrote: On Mon, Apr 12, 2010 at 3:08 PM, Gordon Apple g...@ed4u.com wrote: Thanks for the response, but that is what I have now and am trying to get away from. I want ³normal², ³bold² and ³Italic², not ³Veranda², ³Veranda-Bold² and ³Veranda-Italic² for the secondary list. In many cases it might be possible to strip the font Family name, but the font naming convention is not consistent. Some even use contractions. If you look at the font list in Pages on the iPad, it does what I want. Ah, in that case you're going to need to do a little bit more work. But CTFont does everything you need. Take a look at kCTFontStyleNameKey and friends. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com