在iPad应用程序中包含同一系列的多种字体 [英] Including multiple fonts of the same family in an iPad application

查看:517
本文介绍了在iPad应用程序中包含同一系列的多种字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我必须包含多个相同字体族的字体时,我在iPad应用程序中使用自定义字体时出现问题。



基本上一些字体被渲染其他人,特别是大胆的。
在我的例子中,我有这四种字体:



Tungsten-Medium >
钨黑(确定)

钨钢



系统发现所有这些事实都没有问题 / strong>,但当我选择粗体半粗体时,结果是黑色字体!



这个问题会影响像UILabel和UITextField这样的本地组件,还会影响我在应用程序中使用的自定义CSS 文档。



我在项目资源和Info.plist文件中正确设置了一切,我甚至试图转换ttf格式的字体,但结果不会改变。



我使用的iOS sdk 4.2和iPad应用程序,重要的是要知道在这之前os(在3.2)我的字体被正确渲染!



到目前为止,我发现的唯一的工作解决方案是编辑字体和为每个字体设置不同的字体系列,但这意味着在代码中有很多工作和

解决方案

我发现一个解决方案阅读其他论坛。老实说,我认为这是一个解决方案,而不是一个真正的解决方案。



我使用字体管理器工具(Transtype pro)来编辑字体元数据。我为每个字体设置了一个特定的OT字体系列,字段PS字体名称具有相同的值。
避免框架混淆同一家族的字体,而不触及代码。



丑陋,但它工作。


I have a problem using custom fonts inside my iPad application when I have to include more than one font of the same font family.

Basically some fonts get rendered like others, especially the bold ones. In my case I have these fours fonts:

Tungsten-Medium (ok)
Tungsten-Black (ok)
Tungsten-Bold
Tungsten-Semibold

the system found all these in fact I have no problem with medium or black but when I choose the bold or the semibold the result is the black font!

this issue affects the native components like UILabel and UITextField but also an html documents with custom css that I'm using inside my application.

I set-up everything correctly in the in the project resources and in the Info.plist file, I even tried to convert the fonts in the ttf format but the result does not change.

I'm using the iOS sdk 4.2 for and iPad application, it's important to know that prior to this os (in 3.2) my fonts were rendered correctly!

The only working solution I found until now is to edit the fonts and set a different font family for each one but this implies a lot of work inside the code and the html so I would avoid this.

what should I try?

解决方案

I found a solution reading other forums. Honestly, I think it's more a workaround than a real solution.

I used a font manager tool (Transtype pro) to edit the fonts metadata. I set a specific "OT Font family" for each font with the same value of the field "PS font name". This avoid the framework to confuse fonts of the same family without touching the code.

Ugly, but it works.

这篇关于在iPad应用程序中包含同一系列的多种字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆