iOS Development Apple supports Chinese fonts, and uses fonts

Source: Internet
Author: User
Tags italic font zapfino font

1. Chinese fonts

turn from: https://zhidao.baidu.com/question/1239016138772367339.html

iOS7 English fonts: Helvetica under the various systems, such as Helvetica Neue, very annoying, different places with different systems, but Helvetica family under the iOS7
Chinese fonts: stheitisc-light Bold-Jane

2. Apple uses fonts
Turn from: http://blog.csdn.net/onlyou930/article/details/7422097
Label.font = [Uifont fontwithname: @ "ARIAL-BOLDITALICMT" size:24];

The font names are as follows:

Font family:american typewriter font:americantypewriter font:americantypewriter-bold font family:applegothic Font:ap Plegothic font family:arial font:arialmt font:arial-boldmt font:arial-bolditalicmt font:arial-italicmt Font family:a Rial rounded MT Bold font:arialroundedmtbold font family:arial Unicode MS font:arialunicodems font family:courier font : Courier font:courier-boldoblique font:courier-oblique font:courier-bold Font family:courier New font:couriernewps-b OLDMT font:couriernewps-italicmt font:couriernewps-bolditalicmt font:couriernewpsmt Font family:db LCD Temp FONT:DBLC Dtempblack font family:georgia font:georgia-bold font:georgia font:georgia-bolditalic font:georgia-italic Font Family : Helvetica font:helvetica-oblique font:helvetica-boldoblique font:helvetica font:helvetica-bold Font family:helvetic A neue font:helveticaneue font:helveticaneue-bold font family:hiragino Kaku Gothic * * W3 font:hirakakupron-w3 font F Amily:hiragino Kaku GotHIC * * * W6 font:hirakakupron-w6 font family:marker felt Font:markerfelt-thin font Family:stheiti J font:stheitij-med Ium font:stheitij-light font family:stheiti K font:stheitik-medium font:stheitik-light font family:stheiti SC font:s Theitisc-medium font:stheitisc-light font family:stheiti TC font:stheititc-light font:stheititc-medium Font family:ti Mes New Roman font:timesnewromanpsmt font:timesnewromanps-boldmt font:timesnewromanps-bolditalicmt Font: TIMESNEWROMANPS-ITALICMT Font family:trebuchet MS font:trebuchetms-italic Font:trebuchetms font:trebuchet-bolditalic Font:trebuchetms-bold Font family:verdana font:verdana-bold font:verdana-bolditalic Font:verdana font:verdana-italic Font Family:zapfino Font:zapfino

Uifont Fontwithname after not know the name of the font, see the following full solution.

3. Print font family, and font name
Turn from: http://www.2cto.com/kf/201505/397306.html

iOS offers a lot of font styles. Sometimes we may use different fonts when developing applications, and we can get all the font styles to choose from this demo. First get the font font family name, and then through the name of the clan to obtain the name of the font.

Nsarray *arr = [Uifont familynames];

For (NSString *str in arr) {

Nsarray *at = [Uifont fontnamesforfamilyname:str];

For (NSString *fffff in) {

NSLog (@ "Font name%@", FFFFF);

}

}

? You can then modify the font of the string using the following code.

NSString * Teststr = @ I have a dozen is a beautiful 15 words;

nsmutableattributedstring *str = [[Nsmutableattributedstring alloc] initwithstring:teststr];

[Str addattribute:nsforegroundcolorattributename value:[uicolor Bluecolor] Range:nsmakerange (0,3)];

[Str addattribute:nsforegroundcolorattributename value:[uicolor Redcolor] Range:nsmakerange (3,4)];

[Str addattribute:nsforegroundcolorattributename value:[uicolor Greencolor] Range:nsmakerange (7,4)];

[Str addattribute:nsfontattributename value:[uifont Fontwithname:_fontarray[indexpath.row] size:30] Range: Nsmakerange (0, 15)];


? show Chinese and English effect is not very consistent, the English effect is obvious, the following is a part of the effect of screenshots. Specifically in the demo inside there.




Related Article

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.