pub struct HarfrustShaper { /* private fields */ }Expand description
Pure Rust text shaping powered by harfrust
Optionally caches shaping results to avoid expensive re-shaping of identical text.
Implementations§
Source§impl HarfrustShaper
impl HarfrustShaper
Sourcepub fn with_cache() -> Self
pub fn with_cache() -> Self
Creates a new harfrust shaper with caching enabled
Uses default cache capacities (L1: 100, L2: 500 entries)
Creates a new harfrust shaper with a custom cache
Useful for sharing a cache across multiple shapers
Sourcepub fn cache_stats(&self) -> Option<CacheStats>
pub fn cache_stats(&self) -> Option<CacheStats>
Returns cache statistics if caching is enabled
Sourcepub fn cache_hit_rate(&self) -> Option<f64>
pub fn cache_hit_rate(&self) -> Option<f64>
Returns the cache hit rate (0.0 to 1.0) if caching is enabled
Trait Implementations§
Source§impl Default for HarfrustShaper
impl Default for HarfrustShaper
Source§impl Shaper for HarfrustShaper
impl Shaper for HarfrustShaper
Source§fn shape(
&self,
text: &str,
font: Arc<dyn FontRef>,
params: &ShapingParams,
) -> Result<ShapingResult>
fn shape( &self, text: &str, font: Arc<dyn FontRef>, params: &ShapingParams, ) -> Result<ShapingResult>
Transform characters into positioned glyphs
Source§fn clear_cache(&self)
fn clear_cache(&self)
Flush any cached shaping data
Source§impl Stage for HarfrustShaper
impl Stage for HarfrustShaper
Auto Trait Implementations§
impl Freeze for HarfrustShaper
impl RefUnwindSafe for HarfrustShaper
impl Send for HarfrustShaper
impl Sync for HarfrustShaper
impl Unpin for HarfrustShaper
impl UnsafeUnpin for HarfrustShaper
impl UnwindSafe for HarfrustShaper
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