EpubSettings

data class EpubSettings(val pageWidth: Double = 400.0, val pageHeight: Double = 640.0, val fontSize: Double = 12.0, val margin: Double = 36.0, val fontFamily: ReaderFontFamily? = null, val lineHeightScale: Double = 1.0, val textColor: RgbColor? = null, val backgroundColor: RgbColor? = null, val justify: Boolean? = null, val usePublisherCss: Boolean = true, val layoutCacheBytes: Long = 48L * 1024 * 1024, val hyphenate: Boolean? = null)

Reader layout settings. All values in points. Change them at runtime with EpubDocument.withSettings (or the withFontSize/withPageSize/withMargin shorthands) to re-flow without re-parsing the book.

The typography overrides (font family, colors, justification, hyphenation) are applied as a reader-origin cascade layer that outranks author-important CSS: the user's explicit preference beats the publisher's stylesheet. All-default settings change nothing.

Constructors

Link copied to clipboard
constructor(pageWidth: Double = 400.0, pageHeight: Double = 640.0, fontSize: Double = 12.0, margin: Double = 36.0, fontFamily: ReaderFontFamily? = null, lineHeightScale: Double = 1.0, textColor: RgbColor? = null, backgroundColor: RgbColor? = null, justify: Boolean? = null, usePublisherCss: Boolean = true, layoutCacheBytes: Long = 48L * 1024 * 1024, hyphenate: Boolean? = null)

Properties

Link copied to clipboard

Painted under everything on every page; null = no page background.

Link copied to clipboard

Force every run onto a generic family (null = publisher fonts).

Link copied to clipboard

Body font size in points; author CSS scales relative to it.

Link copied to clipboard

Hyphenation for the whole book, whatever its CSS says: true breaks long words at line ends, false never does, null follows the book's hyphens. Each chapter uses the patterns of its own language. The book is not changed.

Link copied to clipboard

true forces justify, false forces start alignment; null = as authored.

Link copied to clipboard

How much laid-out text the book keeps in memory, as an estimate in bytes.

Link copied to clipboard

Multiplies every line's height (1.0 = as authored).

Link copied to clipboard

Uniform page margin in points (reflowable books only).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Force all text to this color (night mode); null = as authored.

Link copied to clipboard

False drops the publisher's CSS (author rules + inline styles): UA + reader layers only.