iOS custom fonts with font weight


My previous post was a quick one to rescue a great post for editing font info with TTX FontTools.

I had the need of this tool because I was having troubles to make a UILabel getting the fontweight bold of a custom font of my current project. My project has a specific font with different weights, so different files and there was no way to make my UILabel getting a bold weight.

I tried to add a “-Bold” to the fontName, like this:

[UIFont fontWithName:@”Name of the font-Bold” size:15];

But this didn’t really work. With TTX I wanted to change the font name of family name so that I could just use a completely new one. What I realized with the xml generate from TTX is that the fontName wasn’t really the one displayed in FontBook window (on MAC).

In the xml try to use the font name under the item:

<CFFFont name=”MyFontName-Bold”>

This one is the that works with iOS labels!

Leave a Reply

Your email address will not be published. Required fields are marked *