Options
All
  • Public
  • Public/Protected
  • All
Menu

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'
}
]
}

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'
}
]
}

Hierarchy

  • IPublicationStyleFontSet

Index

Properties

defaults

NOTE: This interface is being simplified to be easier to use and will be released in an upcoming release.

Which font-faces to use for the default font-families. The value for each property must match a 'family' defined in fontFaces, or a system default font:

  • 'serif'
  • 'sans-serif'
  • 'cursive'
  • 'fantasy'
  • 'monospace'

fontFaces

List of all font-faces to use.

Optional selectors

Lets you override font-faces based on CSS selectors. Note that this feature might not work for non-CSS based publication formats. Please refer to the relevant publication format adapter documentation.

default

[]

Generated using TypeDoc