Helvetica Neue Light 与 Helvetica Neue Ultra Light 冲突
我将这两个字体文件包含到我的项目中:
HelveticaNeueLight.ttf HelveticaNeueUltraLight.ttf
在 plist 中,我有这样的内容:
<key>UIAppFonts</key>
<array>
<string>HelveticaNeueLight.ttf</string>
<string>HelveticaNeueUltraLight.ttf</string>
</array>
如果我在上面的方法中键入 plist,所有文本字段都将显示超浅色,即使在代码中我将某些标签的字体设置为浅色。
但如果我改变顺序:
<key>UIAppFonts</key>
<array>
<string>HelveticaNeueUltraLight.ttf</string>
<string>HelveticaNeueLight.ttf</string>
</array>
那么现在所有字段都显示光,没有一个字段显示超光。
那么这两种字体样式相互冲突,有什么解决办法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每个应用程序可以显示的一个系列的字体数量是有限制的,但我认为没有任何记录。如果打印字体对象的哈希值,您将看到即使使用两个不同的名称,加载的对象也是相同的。 iOS 似乎识别出了您正在尝试执行的操作,但选择忽略它。
如果您使用字体编辑器编辑字体文件并更改系列名称,它将正常加载。
是的,这很奇怪。
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.