Struct cosmic_text::SwashCache
source · pub struct SwashCache<'a> {
pub image_cache: Map<CacheKey, Option<SwashImage>>,
/* private fields */
}
Expand description
Cache for rasterizing with the swash scaler
Fields§
§image_cache: Map<CacheKey, Option<SwashImage>>
Implementations§
source§impl<'a> SwashCache<'a>
impl<'a> SwashCache<'a>
sourcepub fn new(font_system: &'a FontSystem) -> Self
pub fn new(font_system: &'a FontSystem) -> Self
Create a new swash cache
sourcepub fn get_image_uncached(&mut self, cache_key: CacheKey) -> Option<SwashImage>
pub fn get_image_uncached(&mut self, cache_key: CacheKey) -> Option<SwashImage>
Create a swash Image from a cache key, without caching results
sourcepub fn get_image(&mut self, cache_key: CacheKey) -> &Option<SwashImage>
pub fn get_image(&mut self, cache_key: CacheKey) -> &Option<SwashImage>
Create a swash Image from a cache key, caching results