mkto
mkto

Reputation: 4665

helvetica neue light conflicts with helvetica neue ultra light

I am including these two font files into my project:

HelveticaNeueLight.ttf HelveticaNeueUltraLight.ttf

In the plist, I have something like this:

<key>UIAppFonts</key>
<array>
<string>HelveticaNeueLight.ttf</string>
<string>HelveticaNeueUltraLight.ttf</string>
</array>

If I type the plist in the above method, all text fields will show ultra light even if in code I set the font for some labels to be light.

But If I change the sequence:

<key>UIAppFonts</key>
<array>
    <string>HelveticaNeueUltraLight.ttf</string>
    <string>HelveticaNeueLight.ttf</string>
</array>

Then now all fields show light, none of the fields showing ultra light.

So these two font styles are conflicting with each other, any solution?

Upvotes: 1

Views: 712

Answers (1)

Jano
Jano

Reputation: 63707

There is a limit on the amount of fonts from one family you can show per application, but I don't think it's documented anywhere. If you print the hash of the font object you'll see even using two different names the object loaded is the same. It seems that iOS recognizes what you are trying to do, but chooses to ignore it.

If you edit the font file with a font editor and change the family name it will load normally.

Yes, it's bizarre.

Upvotes: 2

Related Questions