UserProperties

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

User settings properties.

See https://readium.org/readium-css/docs/CSS19-api.html#user-settings

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

Constructors

Link copied to clipboard
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())

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val view: View?
Link copied to clipboard

Functions

Link copied to clipboard
open override fun toCss(): String?
Link copied to clipboard
open override fun toCssProperties(): Map<String, String?>