EpubPage

One reflowed EPUB page: paints backgrounds/borders, then text lines and images.

A page object is permanent (#221) and holds no layout of its own: what it paints comes from EpubDocument.render, which lays the chapter out again when the memory budget had dropped it (#218). What a viewer asks without painting (size, location) is answered from the constructor, so composing a page never lays anything out.

Properties

Link copied to clipboard

The spine item this page belongs to.

Link copied to clipboard

How many times the book's scripts changed this page's chapter (#41). A viewer that drew the page at another value draws it again; EpubDocument.chapterChanges says when to look.

Link copied to clipboard
open override val displayHeight: Double
Link copied to clipboard
open override val displayWidth: Double
Link copied to clipboard

The book this page belongs to, for the bytes of its resources: a player that plays an element of media reads its sources with EpubDocument.resource (#31).

Link copied to clipboard
open override val drawsHostFontText: Boolean?

True when a run of this page's text has no embedded outlines, which is the case for every run of a book without fonts of its own. Null when an SVG on the page may draw text of its own, and false otherwise (#131).

Link copied to clipboard

The inline frames and the HTML objects on this page, in document order, each with its box and the document it embeds (#40). The page paints a frame's document of the book in its box (#528) and an object's fallback children in its own, so an app can place a web view over EpubEmbed.rect for the rest.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val isContentLoaded: Boolean

False while the layout budget has dropped this page's chapter (#377).

Link copied to clipboard

The tappable link regions on this page, in display space (same rect convention as KiteStructuredText: y-min in bottom, y-max in top, y measured downward). One rect per line a link touches; consecutive same-target runs on a line merge into one rect. Internal targets are zipPath#fragment strings resolvable via EpubDocument.pageIndexOfHref; external URLs are verbatim.

Link copied to clipboard

Where this page sits: its chapter, and its index inside that chapter.

Link copied to clipboard

The <video> and <audio> elements on this page, in painting order, each with its box, its sources and its flags (#29). A player that an app places over EpubMedia.rect plays what the page shows the poster or the placeholder of.

Link copied to clipboard

How many remote resources that this page's chapter painted before their bytes landed have landed since (#38). A viewer that keeps the pixels of a page draws it again when this moves, so a remote image with a declared size appears in its box. It counts for the whole chapter, and reads no layout.

Link copied to clipboard

Functions

Link copied to clipboard
open override fun displayToDeviceBase(): KiteMatrix

EPUB is y-down from top-left, so the base is a straight vertical flip.

Link copied to clipboard
open override fun loadContent()

Lays this page's chapter out again when the layout budget dropped it (#377).

Link copied to clipboard
open override fun readingOrder(): List<KiteReadingItem>

What this page says, in the order a reader that speaks would say it: one item per block of text or per image, each carrying the role its source element declared (<h2> is a heading, <li> a list item).

Link copied to clipboard
open override fun renderTo(canvas: KiteCanvas, deviceCtm: KiteMatrix)

open override fun renderTo(canvas: KiteCanvas, deviceCtm: KiteMatrix, cancellation: KiteCancellation)

renderTo that stops between two paint steps, such as two lines, once cancellation reads true (#370).

Link copied to clipboard
open override fun textContent(): KiteStructuredText

Built once per live chapter and dropped with its pages, so search over a book stays bounded.