Custom Fonts
Using custom fonts in the iOS SDK
The OpenWeb iOS SDK supports custom fonts so you can match the look and feel of your app. There are two supported ways to load custom fonts, depending on how your font files are structured and how much you want iOS to handle style resolution.
Font loading options
You can configure custom fonts using one of the following approaches:
- Filename-based loading - You explicitly provide each font style as a separate
.ttffile. - Font family–based loading - You provide a font family and let iOS resolve styles automatically using built-in font lookup.
Supported styles
For any configured font family, the SDK attempts to load the following styles. Your font files, filenames, and internal metadata must align with these values:
- Regular
- Light
- Medium
- Bold
- SemiBold
- Italic
If a requested style can't be resolved, the SDK falls back to the default font or a generated variant, depending on the configuration method.
Option 1: Filename-based fonts
Use this option when you want full control over exactly which font file is used for each style.
Requirements
-
Filename pattern
Each file must follow this exact format:<FamilyName>-<Style>.ttf -
PostScript name - The font’s internal PostScript Name must exactly match the filename (without the
.ttfextension). -
Missing styles - Any style that's not provided will render using the default font.
Example: Aurora Sans
| Required style | Filename (exact) | Internal PostScript Name |
|---|---|---|
| Regular | Aurora Sans-Regular.ttf | Aurora Sans-Regular |
| Bold | Aurora Sans-Bold.ttf | Aurora Sans-Bold |
| Italic | Aurora Sans-Italic.ttf | Aurora Sans-Italic |
| Light | Aurora Sans-Light.ttf | Aurora Sans-Light |
Option 2: Font family–based fonts
Use this option when your font files are correctly configured as a family and you want iOS to handle style selection.
Requirements
-
Internal family name - The font’s internal Family Name must exactly match the
fontFamilyNameconfigured in the SDK. -
Font traits - Each font file must include correct metadata for weight and slant (for example, Bold or Italic) so iOS can resolve styles correctly.
-
Missing styles - If a style isn't available, iOS will generate the closest matching style automatically.
Example
If you configure the SDK with the family name Aurora Sans:
- The system looks for fonts with the Family Name
Aurora Sans. - When the SDK requests a bold font, iOS resolves the
.boldweight for that family and selects the appropriate file.
Updated about 21 hours ago
