Skip to main content

Module glyph

Module glyph 

Source
Expand description

Processing and drawing glyphs.

StructsΒ§

CachedOutline πŸ”’
A cached outline glyph path with its precise bounding box.
ColrMetrics πŸ”’
Helper struct containing computed COLR glyph metrics.
DrawProps πŸ”’
Properties for easily calculating the transform of a positioned glyph.
FontEmbolden
Synthetic embolden settings for a glyph run.
FontInfo πŸ”’
Basic metadata about a font.
Glyph
Positioned glyph.
GlyphBitmap πŸ”’
A glyph defined by a bitmap.
GlyphCaches
Caches used for glyph rendering.
GlyphColr
A glyph defined by a COLR glyph description.
GlyphOutline πŸ”’
A glyph defined by a path (its outline) and a local transform.
GlyphPrepCache
Caches used for preparing glyph drawing.
GlyphPrepCacheMut
Mutably borrowed caches used for preparing glyph drawing.
GlyphRun
A sequence of glyphs with shared rendering properties.
GlyphRunBuilder
A builder for configuring and drawing glyphs.
GlyphRunRenderer
Helper struct for rendering a prepared glyph run.
GlyphScaleProperties πŸ”’
HintCache
LRU cache for hinting instances.
HintEntry πŸ”’
HintKey
Hint key for hinting instances.
OutlineCache
Caches glyph outlines for reuse. Heavily inspired by vello_encoding::glyph_cache.
OutlineCacheSession πŸ”’
OutlineEntry πŸ”’
OutlineKey πŸ”’
OutlinePath πŸ”’
PreparedGlyph πŸ”’
A simplified representation of a glyph, prepared for easy rendering.
PreparedGlyphRun πŸ”’
VarLookupKey πŸ”’
Lookup key for variable font caches.

EnumsΒ§

AtlasCacher
Determines whether atlas-backed glyph caching is available for a draw.
CachedGlyphType πŸ”’
Type hint for cached glyph rendering.
GlyphType πŸ”’
A type of glyph.
Style πŸ”’
Rendering style for glyphs.

ConstantsΒ§

BLACK_PACKED πŸ”’
Pre-packed BLACK color as a u32 for use in GlyphCacheKey.
HINTING_OPTIONS πŸ”’
MAX_CACHED_HINT_INSTANCES πŸ”’
We keep this small to enable a simple LRU cache with a linear search. Regenerating hinting data is low to medium cost so it’s fine to redo it occasionally.

TraitsΒ§

FontDataExt πŸ”’
GlyphRunBackend
A backend for glyph run builders.

FunctionsΒ§

calculate_bitmap_transform πŸ”’
Calculate transform for bitmap glyphs.
calculate_colr_metrics πŸ”’
Calculate COLR glyph metrics (scale factors, bounding box, etc.).
calculate_colr_transform πŸ”’
Calculate transform for COLR glyphs.
calculate_outline_transform πŸ”’
Calculate transform for outline glyphs.
create_bitmap_glyph πŸ”’
Create bitmap glyph data.
create_colr_glyph πŸ”’
Create COLR glyph data with intermediate texture parameters.
create_outline_glyph πŸ”’
Create outline glyph data from cache.
expand_rect_with_segment πŸ”’
f32_bits πŸ”’
find_hint_entry πŸ”’
insert_and_merge_range πŸ”’
Insert a range into a sorted list, merging with any overlapping ranges.
join_bits πŸ”’
prepare_glyph_run πŸ”’
Prepare a glyph run for rendering.
x_y_advances πŸ”’

Type AliasesΒ§

NormalizedCoord
A normalized variation coordinate (for variable fonts) in 2.14 fixed point format.
VarKey πŸ”’
Key for variable font caches.