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)字体大小不能随意设置,当放 ...
随机推荐
- 真机无法接收到android.provider.Telephony.SMS_RECEIVED的问题
小米2S有一个设定会导致,App无法接收到android.provider.Telephony.SMS_RECEIVED广播. 解决方案 关闭系统短信优先设置 短信-设置-高级设置-系统短信优先 ...
- Spring--通过注解来配置bean
Spring通过注解配置bean 基于注解配置bean 基于注解来配置bean的属性 在classpath中扫描组件 组件扫描(component scanning):Spring能够从classpa ...
- (翻译)Entity Framework技巧系列之十 - Tip 37 - 41
提示37. 怎样进行按条件包含(Conditional Include) 问题 几天前有人在StackOverflow上询问怎样进行按条件包含. 他们打算查询一些实体(比方说Movies),并且希望预 ...
- android Bitmap getByteCount和getRowBytes
今天做图像缓存需要计算Bitmap的所占的内存空间,于是研究了下Bitmap关于内存占用的API 1.getRowBytes:Since API Level 1,用于计算位图每一行所占用的内存字节数. ...
- android和ios的系统特性区别
1. 删除:android是长按,ios为滑动/或者进入编辑模式 2. android:应用内返回键,保证用户停留在应用程序中:硬件返回键可以让用户退出应用程序 3. 剪切/粘贴/选择等文本操作 ...
- bzoj 3529 [Sdoi2014]数表(莫比乌斯反演+BIT)
Description 有一张N×m的数表,其第i行第j列(1 < =i < =礼,1 < =j < =m)的数值为能同时整除i和j的所有自然数之和.给定a,计算数表中不大于a ...
- minicom 没有tx 信号
在minicom -s 的配置中:——> Serial port setup --> 选择F - Hardware Flow Control : No默认是yes, 但是没有tx信号输出 ...
- Linux 中/etc/profile、~/.bash_profile 等几个环境配置文件的执行过程
环境变量是和Shell紧密相关的,用户登录系统后就启动了一个Shell.对于Linux来说一般是bash,但也可以重新设定或切换到其它的 Shell.对于UNIX,可能是CShelll.环境变量是通过 ...
- hbase运行模式
Hbase有两种运行模式:standalone和distributed.standalone模式参见Quick Start Guide.以distributed模式设置Hbase,需要编辑Hbase ...
- [OC Foundation框架 - 6] NSMutableString
NSString是不可变的 NSMutableString是可变字符串 1.初始化 2.串联字符串 3.替换字符串 4.插入字符串 5.删除字符串 #pragma mark buffer st ...