Search code examples
iosswiftxcodefontsfastlane

iOS Custom font without adding to system


I followed the Apple guide to add a custom font to my application. It does work only if I also add the font to my system. If I don't I get the following error when opening a storyboard which contains the custom font:

Font “AlmaMono-Bold” does not exist on this system, substituting the system font instead. Saving the document will lose the original font reference.

Is it required to add the custom font to the system or is there other way to do it? There are two main problems with requiring to add the font to the system:

  • If some other dev wants to work on the project, he gotta remember to add this custom font to his system.
  • How to handle it in the Continuous Integration server? I use fastlane to build the application and send to the store, but the font was not working.

Solution

  • A storyboard does not magically look in your project for fonts. So opening a storyboard will not display a font unless that font is available on your machine as a whole.

    The usual approach is to set the font in code, not in the storyboard.