Struct cosmic_text::SwashCache
source · pub struct SwashCache {
pub image_cache: Map<CacheKey, Option<SwashImage>>,
pub outline_command_cache: Map<CacheKey, Option<Vec<Command>>>,
/* private fields */
}
Expand description
Cache for rasterizing with the swash scaler
Fields§
§image_cache: Map<CacheKey, Option<SwashImage>>
§outline_command_cache: Map<CacheKey, Option<Vec<Command>>>
Implementations§
source§impl SwashCache
impl SwashCache
sourcepub fn get_image_uncached(
&mut self,
font_system: &mut FontSystem,
cache_key: CacheKey
) -> Option<SwashImage>
pub fn get_image_uncached( &mut self, font_system: &mut FontSystem, cache_key: CacheKey ) -> Option<SwashImage>
Create a swash Image from a cache key, without caching results
sourcepub fn get_image(
&mut self,
font_system: &mut FontSystem,
cache_key: CacheKey
) -> &Option<SwashImage>
pub fn get_image( &mut self, font_system: &mut FontSystem, cache_key: CacheKey ) -> &Option<SwashImage>
Create a swash Image from a cache key, caching results
pub fn get_outline_commands( &mut self, font_system: &mut FontSystem, cache_key: CacheKey ) -> Option<&[Command]>
sourcepub fn with_pixels<F: FnMut(i32, i32, Color)>(
&mut self,
font_system: &mut FontSystem,
cache_key: CacheKey,
base: Color,
f: F
)
pub fn with_pixels<F: FnMut(i32, i32, Color)>( &mut self, font_system: &mut FontSystem, cache_key: CacheKey, base: Color, f: F )
Enumerate pixels in an Image, use with_image
for better performance
Auto Trait Implementations§
impl RefUnwindSafe for SwashCache
impl Send for SwashCache
impl Sync for SwashCache
impl Unpin for SwashCache
impl UnwindSafe for SwashCache
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more