Custom font is not working in my App?

后端 未结 8 833
小蘑菇
小蘑菇 2020-12-06 22:23

In my iPhone app,

I have included two custom fonts and by referring this steps by stackoverflow questions....

How to include and use new fonts in iPhone SDK?

相关标签:
8条回答
  • 2020-12-06 22:54

    Most probably the actual font name to be put in the app might be something else than glyphish.ttf .. i suggest opening font book and there checking the name of the font .and using that.

    0 讨论(0)
  • 2020-12-06 22:58

    Double click on the font file to open it in font book. Now see the name of the font on the top bar. Use this name in your code.

    0 讨论(0)
  • 2020-12-06 23:00

    You should correct name. It should not contain ttf in glyphish.ttf. For exact reference refer following image for that. Dakota is font name in my case.

    enter image description here

    0 讨论(0)
  • 2020-12-06 23:02

    you have to use the font name, not the filename. you can check the name by opening the font file on yout mac.

    0 讨论(0)
  • 2020-12-06 23:03

    You have passed a filename (glyphish.ttf) instead of the actual font name. Most likely, the font name is Glyphish, but you need to query it somehow: either using the Mac's "Font Book.app" or via code: first, you need to query the family names via [UIFont familyNames]. Then, use [UIFont fontNamesForFamilyName:] to get the actual font names to load. For example, if your font contains a bold variant its family name would be Glyphish but font name would likely be Glyphish-Bold.

    0 讨论(0)
  • 2020-12-06 23:08

    The font name is not the name of the file. Thus glyphish.ttf is not a valid font name.

    0 讨论(0)
提交回复
热议问题