Skip to main content

Module style

Module style 

Source

Functionsยง

apply_page_set ๐Ÿ”’
apply_text_set ๐Ÿ”’
iso_size ๐Ÿ”’
paper_size_pt
Resolve a paper-size name ("A4", "B5", "Letter", "Legal") to (width_pt, height_pt). ISO 216 A and B sizes are computed algorithmically; non-ISO sizes are explicit constants.
pt_to_f32 ๐Ÿ”’
Narrow an f64 measurement (always a small positive page-pt or dimensionless leading multiplier) to f32. Values arriving here are bounded above by the largest ISO-216 size (~4000pt), so the cast cannot overflow and any lost precision sits well below a typographic point.
reject ๐Ÿ”’
Build an MOS0023 diagnostic for a #set argument whose value, while well-typed, would produce broken page geometry. The value is not applied; the previous (or default) value is retained.
resolve_styles ๐Ÿ”’
Walk root children in source order and fold each #set page(...) and #set text(...) into a PageStyle / TextStyle. Later directives win (last-write-wins). #set document(...) is consumed by the lowerer for PDF metadata and ignored here.