pub struct TextShaper { /* private fields */ }Expand description
Shaper to shape the text using provided font faces, and will do BIDI
reordering before to shape text.
This shaper will cache shaper result for per frame.
Implementations§
Source§impl TextShaper
impl TextShaper
pub fn new(font_db: Rc<RefCell<FontDB>>) -> Self
pub fn end_frame(&mut self)
Sourcepub fn shape_text(
&self,
text: &Substr,
face_ids: &[ID],
direction: TextDirection,
) -> Rc<ShapeResult>
pub fn shape_text( &self, text: &Substr, face_ids: &[ID], direction: TextDirection, ) -> Rc<ShapeResult>
Shape text and return the glyphs, caller should do text reorder before call this method.
Sourcepub fn shape_text_with_fallback(
&self,
text: &str,
dir: TextDirection,
face_ids: &[ID],
) -> Option<Vec<Glyph<Em>>>
pub fn shape_text_with_fallback( &self, text: &str, dir: TextDirection, face_ids: &[ID], ) -> Option<Vec<Glyph<Em>>>
Directly shape text without bidi reordering.
pub fn get_from_cache( &self, text: &str, face_ids: &[ID], direction: TextDirection, ) -> Option<Rc<ShapeResult>>
pub fn font_db(&self) -> &Rc<RefCell<FontDB>>
Trait Implementations§
Source§impl Clone for TextShaper
impl Clone for TextShaper
Source§fn clone(&self) -> TextShaper
fn clone(&self) -> TextShaper
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TextShaper
impl !RefUnwindSafe for TextShaper
impl !Send for TextShaper
impl !Sync for TextShaper
impl Unpin for TextShaper
impl !UnwindSafe for TextShaper
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