Skip to main content

Module key

Module key 

Source
Expand description

Cache key for glyph bitmaps stored in the atlas.

GlyphCacheKey captures every parameter that affects the visual appearance of a rasterized glyph โ€” font identity, size, hinting, subpixel position, COLR context color, and variable-font coordinates. Two keys that compare equal produce identical bitmaps and can safely share a single atlas entry.

Structsยง

GlyphCacheKey
Unique identifier for a cached glyph bitmap.

Constantsยง

SUBPIXEL_BITMAP ๐Ÿ”’
Sentinel subpixel_x for bitmap glyph cache entries. See SUBPIXEL_COLR.
SUBPIXEL_BUCKETS ๐Ÿ”’
Number of horizontal subpixel quantization buckets (valid range: 1โ€“253).
SUBPIXEL_COLR ๐Ÿ”’
Sentinel subpixel_x for COLR glyph cache entries.

Functionsยง

f32_bits ๐Ÿ”’
join_bits ๐Ÿ”’
pack_color ๐Ÿ”’
Premultiply and pack an RGBA color into a u32 for bitwise hashing/comparison.
quantize_subpixel ๐Ÿ”’
Quantize a fractional pixel offset into one of SUBPIXEL_BUCKETS buckets.
subpixel_offset
Convert a quantized bucket index back to the fractional pixel offset it represents.