IOS Development uses a custom TTF font

Source: Internet
Author: User
Tags vars

1. Add the Xx.ttf font library to the project.

2. Add a new line fonts provided by application in the project's Xx-info.plist file, plus the name of the font library

3. Reference the Font library name, set the font: [uifontfontwithname:@ "FontName" size:];

If you do not know the font name, you can traverse the font to query:

  1. For (nsstring *fontfamilyname in [Uifont familynames])
  2. {
  3. NSLog (@ "family: '%@ '", fontfamilyname);
  4. For (nsstring *fontname in [Uifont fontnamesforfamilyname:fontfamilyname])
  5. {
  6. NSLog (@ "\tfont: '%@ '", fontname);
  7. }
  8. NSLog (@ "-------------");
  9. }

Reference: http://blog.csdn.net/duxinfeng2010/article/details/37834635

IOS Development uses a custom TTF font

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.