OptionaldefaultThe default font-family to use for documents that do 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 these options are 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.
OptionalhyphensAllows overriding the hyphenation behavior of the text in the publication.
This option determines how words should be hyphenated when text wraps across multiple lines.
It maps to the CSS hyphens property. Set to null to preserve the publication's default behavior.
OptionalletterControls the spacing between letters.
Positive values add spacing, while negative values reduce spacing.
When the LengthUnit is PERCENT, the value is relative to 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, the 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 add spacing, while negative values reduce spacing.
When the LengthUnit is PERCENT, the value is relative to the font-size.
This option does not affect fixed layout documents.
Defines styling options for customizing the appearance of the rendered publication.
Note that support for these options depends on the publication format. By default, they do not apply to fixed-layout formats (such as PDF and fixed-layout EPUB), with the exception of
defaultFontFamily(see property documentation for details).Some of these options can be enabled for fixed-layout EPUBs by configuring
IEpubReaderPublicationOptions.fixedLayoutStyleOptions.