font Set
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: customSerifFontBuffer,
mediaType: MediaType.FONT_WOFF
}, {
family: 'CustomSansFont',
src: customSansFontBuffer,
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: {
fallback: 'sans-serif',
serif: 'serif',
sansSerif: 'sans-serif',
cursive: 'cursive',
fantasy: 'fantasy',
monospace: 'monospace'
}
}
Content copied to clipboard