Skip to main content

Module glyph_cache

Module glyph_cache 

Source
Expand description

Glyph path and cell cache for CPU text rendering. Glyph path and cell cache for CPU rendering.

Two-level cache:

  1. Path cache: PathStorage objects keyed by (font, glyph, ppem). Avoids redundant path construction from font outlines.
  2. Cell cache: Rasterizer cells keyed by (font, glyph, ppem, scale, sub-pixel). Avoids the expensive path→cells conversion on every frame. Cells are computed at position (0,0) and offset at render time.

Structs§

CachedGlyph
Result of a cache lookup: the path plus whether it’s hinted (pixel coords) or not.
GlyphCache
Cache of built glyph paths and pre-rasterized cells.

Functions§

build_path_from_contours
Build an agg PathStorage from TrueType contour data (points in F26Dot6).