Skip to main content

paper_size_pt

Function paper_size_pt 

Source
pub fn paper_size_pt(name: &str) -> Option<(f32, f32)>
Expand description

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.

Formula: A0 = 841 × 1189 mm. Each subsequent size halves the long edge: A(n+1) has width = floor(A_n.height / 2), height = A_n.width. B0 = 1000 × 1414 mm follows the same recurrence.