Expand description
Glifo provides APIs for efficiently rendering glyphs and paint styles like underline.
§Goals
Glifo is under rapid development. Consider it experimental for now. Its goals are to:
- Provide an API surface that accepts glyphs and their positions and renders them to a surface.
- Cache those glyphs so that repeated renders of a glyph are fast.
- Support rendering paint styles like underline, strikethrough, and brush color.
- Share expensive structs and data between the shaper and renderer like the hinting instance and hinted advance.
§Features
std(enabled by default): Get floating point functions from the standard library (likely using your target’s libc).libm: Use floating point implementations fromlibm.png: Enables PNG support for drawing bitmap glyphs.
At least one of std and libm is required.
Re-exports§
pub use atlas::AtlasCommand;pub use atlas::AtlasCommandRecorder;pub use atlas::AtlasPaint;pub use atlas::AtlasSlot;pub use atlas::GLYPH_PADDING;pub use atlas::GlyphAtlas;pub use atlas::GlyphCacheConfig;pub use atlas::GlyphCacheKey;pub use atlas::PendingClearRect;pub use atlas::RasterMetrics;
Modules§
- atlas
- Glyph bitmap atlas cache for efficient text rendering.
- renderer
- Shared glyph rendering logic for rendering backends.
Structs§
- Atlas
Config - Configuration for multiple atlas support.
- Font
Embolden - Synthetic embolden settings for a glyph run.
- Glyph
- Positioned glyph.
- Glyph
Caches - Caches used for glyph rendering.
- Glyph
Colr - A glyph defined by a COLR glyph description.
- Glyph
Prep Cache - Caches used for preparing glyph drawing.
- Glyph
Prep Cache Mut - Mutably borrowed caches used for preparing glyph drawing.
- Glyph
Run - A sequence of glyphs with shared rendering properties.
- Glyph
RunBuilder - A builder for configuring and drawing glyphs.
- Glyph
RunRenderer - Helper struct for rendering a prepared glyph run.
- Hint
Cache - LRU cache for hinting instances.
- HintKey
- Hint key for hinting instances.
- Image
Cache - Manages image resources for the renderer.
- Outline
Cache - Caches glyph outlines for reuse.
Heavily inspired by
vello_encoding::glyph_cache.
Enums§
- Atlas
Cacher - Determines whether atlas-backed glyph caching is available for a draw.
Traits§
- Draw
Sink - A sink for low-level glyph drawing commands.
- Glyph
Renderer - A stateful renderer that can draw sequences of cached and uncached glyphs.
- Glyph
RunBackend - A backend for glyph run builders.
Type Aliases§
- Normalized
Coord - A normalized variation coordinate (for variable fonts) in 2.14 fixed point format.