3
votes
  1. Copy the .ttf files to the project.
  2. Confirm the .ttf files have set the project as target.
  3. Added the .ttf files in 'Fonts provided by application' in plist.
  4. In Build Phases, the .ttf files are in 'Copy Bundle Resources'.
  5. Install the font on my Mac.
  6. Try to print out all fonts available but I can't see my custom font.
  7. I tried to install a font in the code, ios 10 and below works, but ios 11 does not.

Fonts provided by application' in plist

2
do you see your font on Mac? have you tried to run it on ios 10 simulator?swift2geek
В interface builder да. i.stack.imgur.com/qgzMA.png. And on the simulator and on the device checked.G.Rizvan
possible duplicate & works in iOS11 stackoverflow.com/questions/40168344/…Joe
I looked at this question. There is a completely different problem. But I tried the solutions suggested there.G.Rizvan
even though you added the font to the target while copying, check whether the target is selected in the file inspector section on selecting the font file.Praveen Kumar

2 Answers

0
votes

After doing some workaround found this:

Imported your custom font -> StoryBoard -> Attributes Inspector Label -> Select Text type = Attribute -> Select your custom fonts.

Please refer below sample image.

enter image description here

0
votes

The following solution worked for me: https://stackoverflow.com/a/41898069/826435

Once I renamed the "full name" metadata of the font (it's not the same as the file name), it worked. In my case, I just renamed it to "BebasFixNeue." Crazy, but works wonders.

I used a program called FontForge to change the font name. It is free to download.