pub struct TextEngine { /* private fields */ }Expand description
Text measurement + shaping facade over cosmic-text.
Implementations§
Source§impl TextEngine
impl TextEngine
pub fn new() -> Self
pub fn measure(&self, text: &str, size_px: f32) -> Result<(f64, f64)>
pub fn measure_styled( &self, text: &str, size_px: f32, italic: bool, ) -> Result<(f64, f64)>
Sourcepub fn glyphs_at(
&mut self,
text: &str,
origin: Point,
size_px: f32,
) -> Result<Vec<GlyphImage>>
pub fn glyphs_at( &mut self, text: &str, origin: Point, size_px: f32, ) -> Result<Vec<GlyphImage>>
Shape text and return positioned glyph images relative to baseline-left origin.
pub fn glyphs_at_styled( &mut self, text: &str, origin: Point, size_px: f32, italic: bool, ) -> Result<Vec<GlyphImage>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextEngine
impl RefUnwindSafe for TextEngine
impl Send for TextEngine
impl Sync for TextEngine
impl Unpin for TextEngine
impl UnsafeUnpin for TextEngine
impl UnwindSafe for TextEngine
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