Naming Font Files
The file name for a font must match the PostScript name of the font for your flows to properly load the custom font on both Android and iOS. This is because in native Android apps, fonts are referenced by their resource name which is the filename1, while in native iOS apps, fonts are referenced by their PostScript name2. On macOS, you can find the PostScript name of a font by opening it with the Font Book app and selecting the Font Info tab.iOS
- Open your Ionic application’s iOS project workspace in Xcode - for example ./ios/App/App.xcworkspace
- Under the root of the
Appproject, create aFontsgroup, and add all of the font files into this group.

- Ensure that the font files are included in the target membership of the app project.

- Open the
Info.plistin the project and add a section for “Fonts provided by application”. Add a row for each font and specify the matching font file name.
In source code view (xml) this section will look like:
Android
- Open your Ionic application’s Android project in Android Studio - for example ./android
- Under the
appmodule, navigate to theres(resources) folder, an add afontsubdirectory, if not already there. - Add the font files into the
fontresource directory. Note, Android resource naming is all lower case, and any-should be replaced with_.

Build and Test
After the above steps are completed, rebuild your application. Create an Experience in the Userpilot Mobile Builder that specifies a custom font, and try it out by using either the builder preview or publishing.Footnotes
- “The resource name, which is either the filename excluding the extension…” https://developer.android.com/guide/topics/resources/providing-resources ↩
-
“When retrieving the font with
custom(_:size:), match the name of the font with the font’s PostScript name.” https://developer.apple.com/documentation/swiftui/applying-custom-fonts-to-text/#Apply-a-font-supporting-dynamic-sizing ↩