pub struct SwashShaperBackend { /* private fields */ }Expand description
Swash-based shaper — delegates to crate::SwashShaper.
This adapter wraps the existing crate::SwashShaper (which has its own
internal LRU cache) and exposes it via the ShapeBackend trait.
Uses std::sync::RwLock instead of Mutex so that read-only operations
(e.g. ShapeBackend::supports_script) can proceed concurrently. Shape
calls still acquire the write lock because the underlying crate::SwashShaper
mutates its internal context on every call.
Implementations§
Source§impl SwashShaperBackend
impl SwashShaperBackend
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new SwashShaperBackend.
Trait Implementations§
Source§impl Default for SwashShaperBackend
impl Default for SwashShaperBackend
Source§impl ShapeBackend for SwashShaperBackend
impl ShapeBackend for SwashShaperBackend
Source§fn shape(
&self,
face_data: &Arc<[u8]>,
text: &str,
px_size: f32,
) -> Vec<ShapedGlyph>
fn shape( &self, face_data: &Arc<[u8]>, text: &str, px_size: f32, ) -> Vec<ShapedGlyph>
Shape UTF-8
text using font bytes face_data at px_size
pixels-per-em, returning one ShapedGlyph per output glyph.Source§fn shape_with_direction(
&self,
face_data: &Arc<[u8]>,
text: &str,
px_size: f32,
rtl: bool,
) -> Vec<ShapedGlyph>
fn shape_with_direction( &self, face_data: &Arc<[u8]>, text: &str, px_size: f32, rtl: bool, ) -> Vec<ShapedGlyph>
Shape UTF-8
text with an explicit direction hint. Read moreSource§fn shape_with_features(
&self,
face_data: &Arc<[u8]>,
text: &str,
px_size: f32,
features: &[ShapeFeature],
) -> Vec<ShapedGlyph>
fn shape_with_features( &self, face_data: &Arc<[u8]>, text: &str, px_size: f32, features: &[ShapeFeature], ) -> Vec<ShapedGlyph>
Shape UTF-8
text with an explicit set of OpenType feature overrides. Read moreSource§fn shape_with_options(
&self,
face_data: &Arc<[u8]>,
text: &str,
px_size: f32,
rtl: bool,
features: &[ShapeFeature],
_options: &ShapeRequest<'_>,
) -> Vec<ShapedGlyph>
fn shape_with_options( &self, face_data: &Arc<[u8]>, text: &str, px_size: f32, rtl: bool, features: &[ShapeFeature], _options: &ShapeRequest<'_>, ) -> Vec<ShapedGlyph>
Shape text with extended options. Read more
Auto Trait Implementations§
impl Freeze for SwashShaperBackend
impl RefUnwindSafe for SwashShaperBackend
impl Send for SwashShaperBackend
impl Sync for SwashShaperBackend
impl Unpin for SwashShaperBackend
impl UnsafeUnpin for SwashShaperBackend
impl UnwindSafe for SwashShaperBackend
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