0
votes

I included Marion.otf format in XCode.

Its copied and included to target also as showing in this image:

img 1

Rest other fonts otf format is properly visible & all fonts are included in Build Phases, info.plist too. I also tried to add ttf formats but those are too not visible.

enter image description here

enter image description here

Image Depicting Fonts are installed on machine :

enter image description here

Btw, While trying to print the font family in debugger, I am unable to saw these included fonts there. Used this code to print fonts:

for family: String in UIFont.familyNames
{
    print("\(family)")
    for names: String in UIFont.fontNames(forFamilyName: family)
    {
        print("== \(names)")
    }
}

Also whenever i tried to open Size Inspector Marion Font is not displayed there. What could be the possible reasons?

enter image description here

3
Have you added it to .plist?Dipak Kacha
Yes its added to plist file.Shivam Tripathi
Up to the point they are assigning to label in Interface Builder I did, But In my app added font is not visible in Attribute Inspector of Interface builder.Shivam Tripathi

3 Answers

0
votes

Add your newly added font in your project .plist also like following key:

Fonts provided by application

enter image description here

0
votes
  • Install fonts on your machine.

  • Add the fonts in Info.plist file.

  • Make sure that they’re included in the target

enter image description here

  • Double check that your fonts are included as Resources in your bundle

enter image description here

The font will be available in File Inspector.

If you are still facing an issue then close xcode and delete derived data and restart xcode again. This trick worked for me.

0
votes

Marion font is not supported properly by MacOS High Sierra. As Indicated in this doc