Skip to main content

natural_display_size_pt

Function natural_display_size_pt 

Source
pub fn natural_display_size_pt(path: &Path) -> Option<(f64, f64)>
Expand description

The figure’s TRUE natural (typeset) size in TeX pt, for the VECTOR formats whose intrinsic size is a real physical dimension: a PDF page box, an EPS/PS %%BoundingBox (both bp), or an SVG’s lengths/viewBox. None for raster formats — a pixel count is not a physical size without a DPI — and when the geometry can’t be recovered.

For a vector format this is the natural size image_graphicx_sizer gives the box (since 78z an EPS/PS one too, OXIDIZED_DESIGN_DIVERGENCES #886), read by the same reader (natural_size, by the file’s content); for a raster it is None, though the sizer’s box is its pixels at their density (#1188): the em path stays gated to vector figures (FIGURE_MODEL.md batch FRACTION widens it). This function is the size a browser should reproduce, used for the font-relative (em) sizing of natural-size figure inclusions (#562). Pure Rust, no external tool.