Skip to main content

render_with_glyph_cache

Function render_with_glyph_cache 

Source
pub fn render_with_glyph_cache(
    page: &Page<'_>,
    interpreter_settings: &InterpreterSettings,
    render_settings: &RenderSettings,
    glyph_cache: &mut GlyphOutlineCache,
) -> Pixmap
Expand description

Render the page with the given settings to a pixmap, reusing (and warming) a caller-owned GlyphOutlineCache.

Pass the same cache for every page of a document to build each distinct glyph outline once per document instead of once per page. The cache only avoids rebuilds — the same path in the same order under the same transform — so output is byte-identical to render, and rendering stays pure per page. GlyphOutlineCache::hits and GlyphOutlineCache::misses report how the cache served the render.

Pattern tiles and soft masks render into private bounded caches; only the page’s own glyphs go through glyph_cache.