Expand description
Glyph path and cell cache for CPU text rendering. Glyph path and cell cache for CPU rendering.
Two-level cache:
- Path cache:
PathStorageobjects keyed by (font, glyph, ppem). Avoids redundant path construction from font outlines. - 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§
- Cached
Cells - Pre-rasterized glyph cells at a canonical position. Contains the rasterizer’s cell output for a glyph at sub-pixel position (subpx_x, subpx_y). To render at actual position (x, y), add integer pixel offset to each cell.
- Cached
Glyph - Result of a cache lookup: the path plus whether it’s hinted (pixel coords) or not.
- Glyph
Cache - Cache of built glyph paths and pre-rasterized cells.
- Glyph
Cell Key - Cache key for pre-rasterized glyph cells. Includes sub-pixel x/y fractional position quantized to 1/4 pixel.
- Glyph
Path Key - Cache key for a glyph path. ppem = 0 means unhinted (font-unit path), ppem > 0 means hinted at that size.
Functions§
- build_
path_ from_ contours - Build an agg PathStorage from TrueType contour data (points in F26Dot6).