Skip to main content

Crate glifo

Crate glifo 

Source
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 from libm.
  • 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§

AtlasConfig
Configuration for multiple atlas support.
FontEmbolden
Synthetic embolden settings for a glyph run.
Glyph
Positioned glyph.
GlyphCaches
Caches used for glyph rendering.
GlyphColr
A glyph defined by a COLR glyph description.
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.
HintCache
LRU cache for hinting instances.
HintKey
Hint key for hinting instances.
ImageCache
Manages image resources for the renderer.
OutlineCache
Caches glyph outlines for reuse. Heavily inspired by vello_encoding::glyph_cache.

Enums§

AtlasCacher
Determines whether atlas-backed glyph caching is available for a draw.

Traits§

DrawSink
A sink for low-level glyph drawing commands.
GlyphRenderer
A stateful renderer that can draw sequences of cached and uncached glyphs.
GlyphRunBackend
A backend for glyph run builders.

Type Aliases§

NormalizedCoord
A normalized variation coordinate (for variable fonts) in 2.14 fixed point format.