Skip to main content

Module types

Module types 

Source

Structs§

ImageHandle
Decoded raster image data shared between every page that places the same source image. Held by Arc so a single PNG referenced from multiple #image(...) directives shares one buffer end-to-end.
ImagePlacement
One image placement on a page. The PDF backend emits this as a q ... cm /Im<id> Do Q block in the content stream.
LayoutResult
Result of laying out a [mos_core::Document]: a PageGraph plus any warnings the engine emitted. Mirrors mos_eval::LowerResult so the CLI can render diagnostics uniformly.
Page
One laid-out page.
PageGraph
The paginated output graph (manifest §6 stage 7).
PageStyle
Page geometry resolved from #set page(...). width_pt/height_pt describe the full media box; margin_pt is symmetric on all four sides for MVP 1.5 (per-side margins are deferred).
TextRun
A single horizontal run of text on a page. The MVP 0 emitter produces one run per word; coalescing same-font neighbours is an MVP 2 optimisation.
TextStyle
Body text style resolved from #set text(...). leading applies to body paragraphs only; headings keep their own multiplier so a #set text(leading: 2.0) doesn’t balloon section titles.

Constants§

A4_HEIGHT_PT
A4 page height in PDF points.
A4_WIDTH_PT
A4 page width in PDF points (1pt = 1/72 inch). Kept as a public constant so external callers can still read the default; the layout engine now consults PageStyle instead of these directly.
BODY_LEADING 🔒
Default body leading multiplier (line height = size × leading).
BODY_SIZE_PT 🔒
Default body font size (manifest §22.1).
MARGIN_PT
Default page margin in points (24mm × 72/25.4).