How to Use Custom TTF Font on iOS
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的更多相关文章
- (转)在iOS中使用icon font
http://ued.taobao.org/blog/?p=8579 在开发阿里数据iOS版客户端的时候,由于项目进度很紧,项目里的所有图标都是用最平常的背景图片方案来实现.而为了要兼容普通屏与Ret ...
- 在iOS中使用icon font
博文转载至 http://www.cocoachina.com/industry/20131111/7327.html 在开发阿里数据iOS版客户端的时候,由于项目进度很紧,项目里的所有图标都是用最平 ...
- iOS:自定义字体
转自: <iOS tips: Custom Fonts> Post by Steve Vlaminck My good friend google told me that using a ...
- 在 iOS 中使用 iconfont
如何使用自定义字体 在讲icon font之前,首先先来看看普通自定义字体是如何在ios中使用的,两个原理是一样的.这里以KaushanScript-Regular为例: Step 1: 导入字体 ...
- iOS.OpenSource.AllInOne
Open Source Project for iOS 所有和iOS相关的Open Source Project的汇总. 功能点 开源项目 iOS Gallery RMGallery https: ...
- The iOS Design Cheat Sheet 界面设计速参
http://ivomynttinen.com/blog/the-ios-7-design-cheat-sheet/ With the release of iOS 7, app designers ...
- NGUI 3.5教程(六)Font字体
字体是UI很重要的一部分.今天用NGUI 3.5,制作一下字体. 以下是我做的一个射击游戏的DEMO.子弹数量,就使用了NGUI的字体显示.效果例如以下: 步骤: 1,寻找(或者制作)字体.我这里图方 ...
- iOS 7设计备忘单
With the release of iOS 7, app designers and developers will need to adjust their visual language to ...
- libgdx学习记录9——FreeType,ttf中文显示
前面讲到使用Hireo创建的BitmapFont以显示中文字体.这种方式效率很高,当所要显示的字的总数较少,并且大小比较固定时,可以采用这种方式. 但是这种也有弊端: (1)字体大小不能随意设置,当放 ...
随机推荐
- EntityFramework版本下载和更新
安装指定版本的Package(例如:EntityFramework 5.0): PM> Install-Package EntityFramework -ProjectName MusicSto ...
- VISUAL SVN安装 及客户端使用
1.为什么要用VisualSVN Server,而不用Subversion? 回答: 因为如果直接使用Subversion,那么在Windows 系统上,要想让它随系统启动,就要封装SVN Serve ...
- eclipse 项目报错问题
所有的问题在windoes-->show view--->Problems里查看
- 第一章:绪论-Python开发工具的安装
书中提到了操作系统平台尽量选 *nix.我这里选用的是 ubuntu 14.04 , 下面的操作均以此操作系统为例说明. 操作系统安装教程可以去网站上找,推荐用虚拟机的方式,Windows下可用的虚拟 ...
- curl命令学习(转载的)
原文地址: http://www.thegeekstuff.com/2012/04/curl-examples/ curl是网络上常用一个命令,简单来说就是可以上传下载,甚至可以当成下载工具使用,比如 ...
- Discuz资料整理
1.截取字符串:messagecutstr(strip_tags($post['message']), 160);
- c功能实战
1,linux C连接ftp实现简单的上传下载; libcurl/libftp/busybox; oracle查看用户信息 1. 查询oracle中所有用户信息 select * from dba_u ...
- Java File 类的使用方法详解
Java File类的功能非常强大,利用Java基本上可以对文件进行所有的操作.本文将对Java File文件操作类进行详细地分析,并将File类中的常用方法进行简单介绍,有需要的Java开发者可以看 ...
- Java中4大基本加密算法解析
简单的java加密算法有: BASE64 严格地说,属于编码格式,而非加密算法 MD5(Message Digest algorithm 5,信息摘要算法) SHA(Secure Hash Algor ...
- Python用特殊符号切割字符串并生成list(简单)
采用re模块,可以指定字符进行切割,例如切割IP地址: import socket import re localIP = socket.gethostbyname(socket.gethostnam ...