Skip to main content

GlyphCaches

Struct GlyphCaches 

Source
pub struct GlyphCaches {
    pub(crate) outline_cache: OutlineCache,
    pub(crate) hinting_cache: HintCache,
    pub(crate) underline_exclusions: Vec<(f64, f64)>,
    pub(crate) glyph_atlas: GlyphAtlas,
}
Expand description

Caches used for glyph rendering.

Contains renderer-agnostic caches (outline paths, hinting instances) alongside the glyph atlas bitmap cache.

Fields§

§outline_cache: OutlineCache

Caches glyph outlines (paths) for reuse.

§hinting_cache: HintCache

Caches hinting instances for reuse.

§underline_exclusions: Vec<(f64, f64)>

Horizontal spans excluded from “ink-skipping” underlines. Cached to reuse one allocation.

§glyph_atlas: GlyphAtlas

Caches rasterized glyph bitmaps in atlas pages.

Implementations§

Source§

impl GlyphCaches

Source

pub fn clear(&mut self)

Clears the glyph caches.

Source

pub fn maintain(&mut self, image_cache: &mut ImageCache)

Maintains the glyph caches by evicting unused cache entries.

The image_cache must be the same allocator passed to GlyphRunBuilder::build so that evicted entries are deallocated from the correct allocator.

Should be called once per scene rendering.

Trait Implementations§

Source§

impl Debug for GlyphCaches

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GlyphCaches

Source§

fn default() -> GlyphCaches

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.