iPhone开发:如何使用自定义字体? [英] iPhone Development: how to use custom fonts?

查看:141
本文介绍了iPhone开发:如何使用自定义字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的photoshop设计中使用了一种特殊的字体,


  1. ?或


  2. 我需要先将它们转换为图片吗?

  3. ol>

    解决方案

      UIFont * font = [UIFont fontWithName:@MyFontsize:20]; 
    [label setFont:font];

    其中MyFont是项目中的TrueType或OpenType文件(不包含文件扩展名)并且label将是UILabel的实例。


    I used a special font in my photoshop design,

    1. is it possible to use these fonts natively in the iphone app? or

    2. do I need to convert them into an image first?

    3. If this is the only way to do it, what do you do with dynamic text?

    解决方案

    UIFont *font = [UIFont fontWithName:@"MyFont" size:20];
    [label setFont:font];
    

    Where "MyFont" would be a TrueType or OpenType file in your project (sans the file extension), and label would be an instance of UILabel.

    这篇关于iPhone开发:如何使用自定义字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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