This question is extremely similar to UILabel with custom font displays *wrong* custom font, except I need to use three fonts from this family simultaneously. I am using Myriad Pro, just like that question, but I need to use Bold, Semibold, and Regular.
Currently, when I try to use Bold via a macro defined as:
#define MYRIAD_BOLD(x) [UIFont fontWithName:@"MyriadPro-Bold" size:(x)]
..it gives me Semibold. If I remove Semibold from the plist entries for "Fonts provided by application" (as is the "answer" for the similar question linked above), Bold is correctly returned, but (obviously) Semibold is no longer usable.
Any ideas as to why I would (seemingly) be limited to two custom fonts at once? (from the same family, at least?)
BTW, here is the NSLog output for [UIFont fontNamesForFamilyName:@"Myriad Pro"]
:
Myriad Pro font names: (
"MyriadPro-Semibold",
"MyriadPro-Regular",
"MyriadPro-Bold"
)
Thanks!
In a bizarre but somewhat anticipated workaround, I found that I could actually use a third variation by opening the font up in an editor (I just grabbed the first one I found) and changing the family name, repackaging it as an otf, and adding the new file to the application plist. I left the fontName
the same.
The bizarre part is that it still loads with the same font name and shows up under the +fontNamesForFamilyName:
response for Myriad Pro.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With