How to add a new font to IOS development

Source: Internet
Author: User

IOS Development Default font is Heiti SC, The "blackbody-Jane" that we commonly use.

After a period of time, you will find that the font is too monotonous, then how to add new fonts in iOS development, here to teach you two ways.

1. Use the system's own fonts

Search fonts, it is not difficult to find that there are many fonts in the system, and these fonts are also available.

These fonts can be set by code only, or they can be set directly, in a simple way:

Set the Text property to attributed, and then select the system font you want to be OK.

2. Use your own fonts downloaded from the Web

First download your favorite fonts from the Internet, drag the downloaded fonts into the current project

Configuring the Info.plist File

AddRow, "Fonts provided by Application", adding font information

You can set the font by code

uifont* Afont = [uifont fontwithname:fontname size:];

FontName is the name of the font you downloaded

Of course, you can also refer to fonts directly in Xib

So the font is set to succeed.

How to add a new font to iOS development

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.