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.
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.
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.
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.