Fonts
In SongKit, you can specify fonts using different methods depending on the context.
Explicit fonts
This is the classical way of selecting a font. You only specify the font family, its size, and if it should follow the document’s display scale.
For technical reasons*, explicit font families are split into two categories: System fonts, and Other fonts.
System fonts
System fonts are font used throughout your whole device to display text. They come in four distinct designs: sans-serif, serif, rounded, and monospaced. Each design comes with its set of variants and weights. This list may change from one version of the OS to another.
Other fonts
Theses are the fonts installed on your device. This includes the fonts coming with the OS, a few music-specific fonts provided by SongKit, and any custom font you may have installed.
*In order to access custom font you may have installed from another app, we need to use an OS provided font selector screen. A malicious app can indeed make the list of the fonts you’ve installed, and use this as a way to fingerprint your device and track you when you go elsewhere. The OS provided font selector is a black box that prevents this. This font selector however does not allow to select system fonts. Thus, to access any custom font, we must use the OS font selector, but we also need another method to select system fonts.
Referenceable fonts
Referenceable fonts are labeled fonts defined in a song style that can be reused elsewhere in the style. If you modify the referenced font later, all elements referencing it will be updated accordingly.
The referenceable font labels are:
- Title 1
- Title 2
- Title 3
- Body
- Music
- Music (Accentuated)
- Caption 1
- Caption 2
These labels are only provided for mnemonic reasons, and you can use any label as you want.
When you use a referenceable font, you can specify a smaller or bigger size from the referenced font. You can also indicate if the font size should follow the document size. For example, if the referenced font resolves to Arial 20pt., and if you specified a relative scale of 50%, the font will be Arial 10pt. If the font should furthermore follow the document scale, and this scale happens to be 130%, the resulting font used for display will be Arial 13pt (that’s still 50% of the size of the referenced font which will then be 26pt.).