iOS自定义字体位移 [英] iOS Custom Font displaced

查看:217
本文介绍了iOS自定义字体位移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于一个项目,我买了一个 OTF 字体并将其包含在我的项目中(添加到plist文件等)。它可以工作,我可以在我的按钮上设置字体,但标签被取代。我添加了截图,以便您查看我的问题。任何人都知道问题是什么?



系统:iOS 3测试版的iOS 3测试版,但iOS 5.1.1上存在相同问题





编辑:



我发现了一条关于这个问题的帖子。



http://www.andyyardley。 com / 2012/04/24 / custom-ios-fonts-and-how-to-fix-the-vertical-position-problem /

解决方案

好的,现在我明白了:)看看我在问题中链接的博客帖子。


http:// www .andyyardley.com / 2012/04/24 / custom-ios-fonts-and-how-to-fix-the-vertical-position-problem /


摘要:




  • 下载Apple字体工具套件

  • 终端:ftxdumperfuser -t hhea -A d font.ttf

  • XML目录中创建的文件

  • 使用文本编辑器打开XML并调整ascender,descender的设置

  • 终端:ftxdumperfuser -t hhea -A f font .ttf

  • 为你的projekt添加自定义字体(不要忘记plist项目)


  • For a project I bought a OTF font and included it into my project (with adding to plist file etc). It works and I can set the font on my buttons, but the label is displaced then. I added a screenshot so you can see my issue. Anyone an idea what the problem can be?

    system: iPad 3 with iOS 6.0 beta, but same problem on iOS 5.1.1

    EDIT:

    I found a post about the problem.

    http://www.andyyardley.com/2012/04/24/custom-ios-fonts-and-how-to-fix-the-vertical-position-problem/

    解决方案

    Ok, now I got it :) Just look at the blogpost I linked in my question.

    http://www.andyyardley.com/2012/04/24/custom-ios-fonts-and-how-to-fix-the-vertical-position-problem/

    summary:

    • Download the Apple Font Tool Suite
    • Terminal: ftxdumperfuser -t hhea -A d font.ttf
    • XML file created in the directory
    • Open XML with Text Editor and adjust the settings of ascender, descender
    • Terminal:ftxdumperfuser -t hhea -A f font.ttf
    • Add custom font to your projekt(dont forget plist item)

    这篇关于iOS自定义字体位移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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