UserProperties

constructor(view: View? = null, colCount: ColCount? = null, pageMargins: Double? = null, appearance: Appearance? = null, darkenImages: Boolean? = null, invertImages: Boolean? = null, textColor: Color? = null, backgroundColor: Color? = null, fontOverride: Boolean? = null, fontFamily: List<String>? = null, fontSize: Length? = null, advancedSettings: Boolean? = null, typeScale: Double? = null, textAlign: TextAlign? = null, lineHeight: Either<Length, Double>? = null, paraSpacing: Length? = null, paraIndent: Length.Rem? = null, wordSpacing: Length.Rem? = null, letterSpacing: Length.Rem? = null, bodyHyphens: Hyphens? = null, ligatures: Ligatures? = null, a11yNormalize: Boolean? = null, overrides: Map<String, String?> = emptyMap())

Parameters

view

User view: paged or scrolled.

colCount

The number of columns (column-count) the user wants displayed (one-page view or two-page spread). To reset, change the value to auto.

pageMargins

A factor applied to horizontal margins (padding-left and padding-right) the user wants to set. Recommended values: a range from 0.5 to 2. Increments are left to implementers’ judgment. To reset, change the value to 1.

appearance

This flag applies a reading mode (sepia or night).

darkenImages

This will only apply in night mode to darken images and impact img. Requires: appearance = Appearance.Night

invertImages

This will only apply in night mode to invert images and impact img. Requires: appearance = Appearance.Night

textColor

The color for textual contents. It impacts all elements but headings and pre in the DOM. To reset, remove the CSS variable.

backgroundColor

The background-color for the whole screen. To reset, remove the CSS variable.

fontOverride

This flag is required to change the font-family user setting.

fontFamily

The typeface (font-family) the user wants to read with. It impacts body, p, li, div, dt, dd and phrasing elements which don’t have a lang or xml:lang attribute. To reset, remove the required flag. Requires: fontOverride

fontSize

Increasing and decreasing the root font-size. It will serve as a reference for the cascade. To reset, remove the required flag.

advancedSettings

This flag is required to apply the font-size and/or advanced user settings.

typeScale

The type scale the user wants to use for the publication. It impacts headings, p, li, div, pre, dd, small, sub, and sup. Recommended values: a range from 75% to 250%. Increments are left to implementers’ judgment. Requires: advancedSettings

textAlign

The alignment (text-align) the user prefers. It impacts body, li, and p which are not children of blockquote and figcaption. Requires: advancedSettings

lineHeight

Increasing and decreasing leading (line-height). It impacts body, p, li and div. Recommended values: a range from 1 to 2. Increments are left to implementers’ judgment. Requires: advancedSettings

paraSpacing

The vertical margins (margin-top and margin-bottom) for paragraphs. Recommended values: a range from 0 to 2rem. Increments are left to implementers’ judgment. Requires: advancedSettings = true

paraIndent

The text-indent for paragraphs. Recommended values: a range from 0 to 3rem. Increments are left to implementers’ judgment. Requires: advancedSettings

wordSpacing

Increasing space between words (word-spacing, related to a11y). Recommended values: a range from 0 to 1rem. Increments are left to implementers’ judgment. Requires: advancedSettings

letterSpacing

Increasing space between letters (letter-spacing, related to a11y). Recommended values: a range from 0 to 0.5rem. Increments are left to implementers’ judgment. Requires: advancedSettings

bodyHyphens

Enabling and disabling hyphenation. It impacts body, p, li, div and dd. Requires: advancedSettings

ligatures

Enabling and disabling ligatures in Arabic (related to a11y). Requires: advancedSettings

a11yNormalize

It impacts font style, weight and variant, text decoration, super and subscripts. Requires: fontOverride