Publication Style Font Set
data class PublicationStyleFontSet(val defaults: PublicationStyleFontDefaults, val fontFaces: List<PublicationStyleFontFace>, val selectors: List<PublicationStyleFontSelector> = emptyList())
NOTE: This interface is being simplified to be easier to use and will be released in an upcoming release.
Overrides the fonts used when rendering the publication.
When you specify this option, all existing fonts defined in the publication will be ignored. Note that this options is not available for all publication formats.
The following example shows how to set override the publication with custom fonts.
fontSet: {
fontFaces: [
{
family: 'CustomSerifFont',
src: customSerifFontBase64, // The whole font file serialized to a base64 string.
mediaType: MediaType.FONT_WOFF
}, {
family: 'CustomSansFont',
src: customSansFontBase64, // The whole font file serialized to a base64 string.
mediaType: MediaType.FONT_WOFF
},
],
defaults: {
fallback: 'CustomSansFont',
serif: 'CustomSerifFont'
},
selectors: [
{
selector: 'h1, h2, h3, h4, h5, h6',
family: 'CustomSerifFont'
}
]
}
Content copied to clipboard
If you wish to ignore the publication fonts and only use system fonts, you can use the following configuration:
fontSet: {
fontFaces: [],
defaults: {
default: 'sans-serif',
serif: 'serif',
sansSerif: 'sans-serif',
cursive: 'cursive',
fantasy: 'fantasy',
monospace: 'monospace'
},
selectors: [
{
selector: 'h1, h2, h3, h4, h5, h6',
family: 'serif'
}
]
}
Content copied to clipboard
Constructors
Link copied to clipboard
fun PublicationStyleFontSet(defaults: PublicationStyleFontDefaults, fontFaces: List<PublicationStyleFontFace>, selectors: List<PublicationStyleFontSelector> = emptyList())