OptionaldefaultThe default font-family to use for documents that has does not define a font-family. Defaults to 'serif'
OptionaldisableDetermines whether CSS animations and transitions should be disabled in the rendered publication.
This option won't affect animations performed by scripts in content-documents.
OptionalfontNOTE: 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'
}
]
}
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'
}
}
OptionalfontApplies font-size scaling to the rendered publication. This is typically only supported on reflowable content documents and ignored otherwise.
OptionalletterControls the spacing between letters.
Positive values adds spacing, while negative values reduce spacing.
When the LengthUnit is PERCENT, the value is relative the font-size.
This option does not affect fixed layout documents.
OptionallineApplies line-height scaling to the rendered publication. This is typically only supported on reflowable content documents and ignored otherwise.
OptionalpageSets the individual page margins. This is typically only supported on reflowable content documents and ignored otherwise.
Defaults to 6% for each side.
OptionalpaletteAllows you to override the palette used for rendering the publication.
This is done by mapping background colors and foreground colors to new values.
The colors must be specified as HEX color strings: #RGB (#090) #RGBA (#090a) #RRGGBB (#009900) #RRGGBBAA (#009900aa)
The following example palette displays publications in night mode. As we are "inverting" colors we map the lightest original color to the darkest color:
{
backgroundLight: '#303030',
backgroundDark: '#424242',
foregroundLight: '#ffffffb3',
foregroundDark: '#ffffff',
accent: '#d48872'
}
OptionalremoveWhen this option is enabled, horizontal page margin and padding defined in the publication CSS are removed.
Note that this option only applies to reflowable publication content.
OptionaltextAllows overriding the text alignment used in the publication
OptionaltypographyVarious options for removing publication defined style rules related to fonts and typography.
OptionalwordControls the spacing between words.
Positive values adds spacing, while negative values reduce spacing.
When the LengthUnit is PERCENT, the value is relative the font-size.
This option does not affect fixed layout documents.
Allows you to set styling options of the rendered publication.
Note that support depends on the publication format. Fixed-layout formats such as PDF and fixed-layout EPUB will by default NOT be affected by these options, with the exception of
defaultFontFamily(seedefaultFontFamilydocumentation). Some of these options can be enabled for fixed-layout EPUBs by settingIEpubReaderPublicationOptions.fixedLayoutStyleOptions.