Skip to main content

render_html_fixed_ttf_with

Function render_html_fixed_ttf_with 

Source
pub fn render_html_fixed_ttf_with(
    geometry: &PageGeometry,
    pages: &[Page],
    store: &TtfFontStore,
    images: &[ImageResource],
    extras: &DocExtras,
) -> Result<String, HtmlError>
Expand description

Same as render_html_fixed, but rendering under a real TtfFontStore — the HTML twin of rustyfi_pdf::render_pdf_ttf_with (cid.rs). Every text and math run’s <span> gets an explicit font-family naming the @font-face embedding this function adds to the <style> block for every physical font file the document actually referenced, so the browser lays text out in the SAME face whose metrics the layout was computed with (the design doc’s §Risks “font-metric fidelity” mitigation, Slice 3’s whole point).