Add Custom Fonts In Xcode 4.1

前端 未结 4 1573
礼貌的吻别
礼貌的吻别 2021-02-04 05:44

i want to use custom fonts in y application.

i have declared the \"Fonts provided by the application\" in the info.Plist file

and set the label.font to the font

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-04 05:55

    I just spent a big chunk of my day trying to figure my problem out... what I missed was, when I dragged the .ttf file into xcode, I did not select my app's name under "Add to target:" section.

    Even though it seemed as if the file was in the correct directory and what not, it wasn't recognising it under the family names, using this code:

    NSLog(@"FONT FAMILIES\n%@",[UIFont familyNames]);
    

    So hopefully this can help someone if they're stuck.

提交回复
热议问题