Re: custom fonts
Re: custom fonts
- Subject: Re: custom fonts
- From: Alex Zavatone <email@hidden>
- Date: Tue, 23 Jul 2013 12:55:13 -0400
OK.
It appears that there is info on this ranging on solutions over the past few years 'til recently.
First of all, there are only certain types of fonts that are supported on iOS, and some that may appear supported are "web" fonts (no idea what that means) and aren't supported even if they appear to be of a supported font type.
I'd recommend trying this out with a simple case first, not with the font you want. Take a font that is on your system that is of a supported type, but not present in iOS.
I believe that .ttf and otf are font file formats that are supported.
Add that Font to your project and in the app's .plist, add this key:
UIAppFonts
or
Fonts provided by application
It sounds like you already did this though, but I'm including the steps I took for success.
Ignore trying to add the font in the IB, as previously mentioned. This can be a frustrating waste of time. I've never gotten it to work at all.
Make sure to check the file name for the font that you added. The name I needed to use to get the font to display was the name of the font file minus the font extension. Other people's notes have indicated otherwise, but this worked for me.
The two fonts that was working with were the 3ds otf font and BebasNeue.otf.
The first problem that I had was the the first version of BebasNeue.otf that I had handy was a web font and would not display at all.
Both of the lines of code below worked for a TVC cell using the Subtitle style. Just try commenting out the lines for Bebas Neue and verify that it works with Lucidia Grande first.
UIFont *newFont;
detailFont = [UIFont fontWithName:@"Lucida Grande" size:22.0];
newFont = [UIFont fontWithName:@"BebasNeue" size:22.0];
cell.textLabel.font = newFont;
UIFont *detailFont;
detailFont = [UIFont fontWithName:@"Lucida Grande" size:14.0];
detailFont = [UIFont fontWithName:@"BebasNeue" size:14.0];
cell.detailTextLabel.font = detailFont;
What's odd here is that the version of BebasNeue that was a "web font" worked just fine in a UIWebView, but didn't display at all in a label.
I'll send you something offline to help you test.
Cheers.
On Jul 20, 2013, at 5:16 AM, Max Haas wrote:
> Hi,
>
> I should add in IOS 6 a font to an app for iPad. It's a font with musical notation (like Sonata). Unfortunately the possibility with UIAppFonts key in the Info.plist does not work. Thanks for any hint.
>
> Max
> _______________________________________________
>
> 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
_______________________________________________
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