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. nopcommerce商城系统--源代码结构和架构

    这个文档是让开发者了解nopcommerce解决方案结构的指南.这是新的nopcommerce开发者学习nopcommerce代码的相关文档.首先,nopCommerce源代码是很容易得到的.它是一个 ...

  2. java Object类学习

    /* * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETA ...

  3. bzoj 2588 Spoj 10628. Count on a tree(主席树)

    Description 给定一棵N个节点的树,每个点有一个权值,对于M个询问(u,v,k),你需要回答u xor lastans和v这两个节点间第K小的点权.其中lastans是上一个询问的答案,初始 ...

  4. HW7.8

    import java.util.ArrayList; import java.util.Scanner; public class Solution { public static void mai ...

  5. leetcode@ [36/37] Valid Sudoku / Sudoku Solver

    https://leetcode.com/problems/valid-sudoku/ Determine if a Sudoku is valid, according to: Sudoku Puz ...

  6. iso定制封装

    http://xiaoli110.blog.51cto.com/1724/1617541

  7. StackOverflow:7个你从未见过的Java问题最佳答案

    本文由码农网 – 李俊英原创翻译,转载请看清文末的转载要求,欢迎参与我们的付费投稿计划! 对开发人员来说, StackOverflow就像一个金矿.对具体的问题,它能帮我们找到最有用的答案,并且我们也 ...

  8. 集合框架Map之KeySet方法的使用

    package cn.itcast.map; import java.util.HashMap; import java.util.Iterator; import java.util.Map; im ...

  9. A Tour of Go Map literals

    Map literals are like struct literals, but the keys are required. package main import "fmt" ...

  10. win32进阶必备:多线程同步之互斥锁

    应用多线程互斥锁之前首先简单过一下C程序可能用到的3个创建线程函数: CreateThread,windows系统提供的唯一创建线程API,_beginthread和_beginthreadex都在内 ...