Struct alacritty::renderer::GlyphCache[][src]

pub struct GlyphCache {
    cache: HashMap<GlyphKey, Glyph, BuildHasherDefault<FnvHasher>>,
    rasterizer: Rasterizer,
    font_key: FontKey,
    bold_key: FontKey,
    italic_key: FontKey,
    bold_italic_key: FontKey,
    font_size: Size,
    glyph_offset: Delta<i8>,
    metrics: Metrics,
}
Expand description

Naïve glyph cache.

Currently only keyed by char, and thus not possible to hold different representations of the same code point.

Fields

cache: HashMap<GlyphKey, Glyph, BuildHasherDefault<FnvHasher>>

Cache of buffered glyphs.

rasterizer: Rasterizer

Rasterizer for loading new glyphs.

font_key: FontKey

Regular font.

bold_key: FontKey

Bold font.

italic_key: FontKey

Italic font.

bold_italic_key: FontKey

Bold italic font.

font_size: Size

Font size.

glyph_offset: Delta<i8>

Glyph offset.

metrics: Metrics

Font metrics.

Implementations

Computes font keys for (Regular, Bold, Italic, Bold Italic).

Get a glyph from the font.

If the glyph has never been loaded before, it will be rasterized and inserted into the cache.

Errors

This will fail when the glyph could not be rasterized. Usually this is due to the glyph not being present in any font.

Load glyph into the atlas.

This will apply all transforms defined for the glyph cache to the rasterized glyph before insertion.

Clear currently cached data in both GL and the registry.

Prefetch glyphs that are almost guaranteed to be loaded anyways.

Calculate font metrics without access to a glyph cache.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.