Cocos2d-x uses FontLabel to draw customer ttf font before v2.0.3(including v2.0.3). Now it uses UIFont directly to draw system fonts and customer ttf fonts.

Now, inorder to use customer ttf font, you should do some more work. I will use TestCpp as example to describe the steps.

  • Add your custom font files into your project using XCode as a resource

  • Add full name of customer ttf into your application's info.plist

  • Use ttf file in codes(only use font name without directory and .ttf)
    Please refer to samples/TestCpp/Classes/FontTest/FontTest.cpp for detail information.
    On iOS, use just pass font name(without relative path to Resources and file extension) to CCLabelTTF create an instance of CCLabelTTF. On other platforms, you should use full name(including relative path to Resources and file extension).

How to Use Custom TTF Font on iOS的更多相关文章

  1. (转)在iOS中使用icon font

    http://ued.taobao.org/blog/?p=8579 在开发阿里数据iOS版客户端的时候,由于项目进度很紧,项目里的所有图标都是用最平常的背景图片方案来实现.而为了要兼容普通屏与Ret ...

  2. 在iOS中使用icon font

    博文转载至 http://www.cocoachina.com/industry/20131111/7327.html 在开发阿里数据iOS版客户端的时候,由于项目进度很紧,项目里的所有图标都是用最平 ...

  3. iOS:自定义字体

    转自: <iOS tips: Custom Fonts> Post by Steve Vlaminck My good friend google told me that using a ...

  4. 在 iOS 中使用 iconfont

    如何使用自定义字体 在讲icon font之前,首先先来看看普通自定义字体是如何在ios中使用的,两个原理是一样的.这里以KaushanScript-Regular为例:   Step 1: 导入字体 ...

  5. iOS.OpenSource.AllInOne

    Open Source Project for iOS 所有和iOS相关的Open Source Project的汇总. 功能点 开源项目   iOS Gallery RMGallery https: ...

  6. The iOS Design Cheat Sheet 界面设计速参

    http://ivomynttinen.com/blog/the-ios-7-design-cheat-sheet/ With the release of iOS 7, app designers ...

  7. NGUI 3.5教程(六)Font字体

    字体是UI很重要的一部分.今天用NGUI 3.5,制作一下字体. 以下是我做的一个射击游戏的DEMO.子弹数量,就使用了NGUI的字体显示.效果例如以下: 步骤: 1,寻找(或者制作)字体.我这里图方 ...

  8. iOS 7设计备忘单

    With the release of iOS 7, app designers and developers will need to adjust their visual language to ...

  9. libgdx学习记录9——FreeType,ttf中文显示

    前面讲到使用Hireo创建的BitmapFont以显示中文字体.这种方式效率很高,当所要显示的字的总数较少,并且大小比较固定时,可以采用这种方式. 但是这种也有弊端: (1)字体大小不能随意设置,当放 ...

随机推荐

  1. windows系统下的文件夹链接功能mklink/linkd

    vista及以上系统的mklink命令可以创建文件夹的链接(感觉像是文件夹的映射).因为是从底层实现文件夹链接,所以这个链接是对应用程序透明的. (windows 2000,xp,server 200 ...

  2. 修改linux用户密码

    对于初学者来说,如何修改linux用户密码也不是件容易的事,其实非常简单,下面举例说明: 如果是以root身份登录,修改root密码.只要输入 passwd 就会出现: New password:  ...

  3. CentOS 7.0 安装 python3.X 脚本

    #!/bin/sh #第一个Linux下的脚本,太多不明白的地方,只是依着网上的例子照葫芦画瓢,能正常运行即可 #运行环境 CentOS 7.0 版本 #首行指定程序的路径,以#号开头的行是注释行 # ...

  4. 如何理解Stay hungry,stay foolish?

    People know about this words because of Steve Jobs.Me too. Hungry,对知识我们一般不会用hungry,我们会用curious,什么时候我 ...

  5. tomcat memory leak

    Struts + Hibernate做项目,重新部署项目会出现Memory Leak严重报错.虽然不影响使用,但还是有风险.经实验发现是Hibernate的session没有关闭.....粗心....

  6. HW6.21

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  7. android中OnItemClickListener的参数解释

    @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) {} ...

  8. Win7 NFS 设置详解 | X-Space

    Win7 NFS 设置详解 | X-Space Win7 NFS 设置详解

  9. 安装Python

    因为Python是跨平台的,它可以运行在Windows.Mac和各种Linux/Unix系统上.在Windows上写Python程序,放到Linux上也是能够运行的. 要开始学习Python编程,首先 ...

  10. light oj 1214 - Large Division

    1214 - Large Division   PDF (English) Statistics Forum Time Limit: 1 second(s) Memory Limit: 32 MB G ...