Skip to main content

Module paging

Module paging 

Expand description

Page breaking shared by every paged layout: the word processor’s sheets, its PDF export and the e-book reader’s pages.

A PageFlow stacks blocks down a run of equal pages and decides where each one goes; shaping and painting stay with the caller, which hands in heights and line boxes and gets back pages and offsets. The rules:

  • A block that fits goes whole. A manual break before a block starts a fresh page, and the space before a block is dropped at the top of one.
  • A block that does not fit splits between its lines (or table rows), keeping at least Fragmentation::orphans lines before the break and Fragmentation::widows after it, or moves whole to the next page when it cannot.
  • The first thing on a page never moves: a block that cannot split and is taller than a page overflows it, and lines that cannot honour the orphan/widow counts on an empty page fill it anyway.
  • A block that keeps with the next (a heading) moves to the next page with it rather than end a page, unless it began that page.

Structs§

Block
One block to place: its height and how it may break.
Carry
Blocks that kept with the block being placed and moved with it from the bottom of a page to the top of the next one.
Fragment
The piece of a split block on one page.
Fragmentation
Lines a split text block keeps on either side of a page break.
PageFlow
A cursor stacking blocks down equal pages; see the module docs for the rules it applies.
Placed
Where a block went.