UIFont fontWithName: limited to downloading 2 variations per family

This question is very similar to UILabel with custom fonts * incorrect * custom font , except that I need to use three fonts from this family at the same time. I am using Myriad Pro, just like this question, but I need to use Bold, Semibold and Regular.

Currently, when I try to use Bold with a macro defined as:

#define MYRIAD_BOLD(x) [UIFont fontWithName:@"MyriadPro-Bold" size:(x)]

.. that gives me Semibold. If I remove Semibold from the plist entries for “Fonts provided by the application” (as well as the “answer” for a similar question related above), Bold returns correctly, but (obviously) Semibold is no longer used.

Any ideas as to why I (apparently) would restrict myself to two regular fonts at once? (from the same family, at least?)

By the way, here is the NSLog output for [UIFont fontNamesForFamilyName:@"Myriad Pro"]:

Myriad Pro font names: ( "MyriadPro-Semibold", "MyriadPro-Regular", "MyriadPro-Bold" )

Thank!

+5
source share
2 answers

In a fancy, but somewhat expected workaround, I found that I could actually use the third variation by opening the font in the editor (I just grabbed the first one I found) and changing the last name, repacking it as otf, and adding a new file to the application plan. I left fontNamethe same.

The bizarre part is that it still loads with the same font name and appears below the answer +fontNamesForFamilyName:for Myriad Pro.

+6
source

" ". , , PostScript xcode.

.

0

All Articles