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)字体大小不能随意设置,当放 ...
随机推荐
- Ruby准备工作
解释性语言,自上而下执行,纯面向对象,跨平台,动态绑定,没有多重继承.NetBeans sun公司开发irb指令可快速实时输入并返回结果 quit 或者exitrdoc hello.rb 生成html ...
- Mongodb千万级数据在python下的综合压力测试及应用探讨
http://rfyiamcool.blog.51cto.com/1030776/1329351
- zoj 1670 Jewels from Heaven
题意:三个人,在给定正方形内,求第一个人拿到珠宝的概率.珠宝随机出现在正方形内. 思路:中垂线+半平面相交. #include<cstdio> #include<cstring> ...
- ROW_NUMBER 使用
WITH t_pageAS( SELECT ROW_NUMBER() OVER ( ORDER BY table_name ) AS row_index,column_name FROM table_ ...
- empty(trim($str))报错原因
最近写程序的时候发现一个这样的问题,一个if判断如下: [php] if (!empty(trim($ch_url))) { ... } [/php] 执行程序报出如下错误: [code] Fatal ...
- 安装sql server 出现挂起问题
1.安装SQL Server的时候出现的情况.“以前的某个程序已在安装计算机上创建挂起的文件操作.运行安装之前必须重新启动计算机”的提示. 2.解决方法 关于SQL安装被挂起的修复大家可能都遇到过当S ...
- leetcode@ [318] Maximum Product of Word Lengths (Bit Manipulations)
https://leetcode.com/problems/maximum-product-of-word-lengths/ Given a string array words, find the ...
- Bzoj-2705 Longge的问题 欧拉函数
题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=2705 题意: 求 sigma(gcd(i,n), 1<=i<=n<2^3 ...
- SecureCRT配置显示的字符集
- 转载总结 C# 多态(虚方法,抽象,接口实现)
前言:我们都知道面向对象的三大特性:封装,继承,多态.封装和继承对于初学者而言比较好理解,但要理解多态,尤其是深入理解,初学者往往存在有很多困惑,为什么这样就可以?有时候感觉很不可思议,由此,面向对象 ...