Struct accessibility_tree::text::ShapedSegment
source · pub struct ShapedSegment {
pub font: Arc<Font>,
pub glyphs: Vec<GlyphId>,
pub advance_width: Length<Em>,
}
Fields§
§font: Arc<Font>
§glyphs: Vec<GlyphId>
§advance_width: Length<Em>
Implementations§
source§impl ShapedSegment
impl ShapedSegment
sourcepub fn naive_shape(text: &str, font: Arc<Font>) -> Result<Self, FontError>
pub fn naive_shape(text: &str, font: Arc<Font>) -> Result<Self, FontError>
Simplistic text shaping:
- No font fallback
- No support for complex scripts
- No ligatures
- No kerning
pub fn new_with_naive_shaping(font: Arc<Font>) -> Self
pub fn append( &mut self, text: impl Iterator<Item = char> ) -> Result<(), FontError>
pub fn append_char(&mut self, ch: char) -> Result<(), FontError>
pub fn save(&self) -> ShapedSegmentState
pub fn restore(&mut self, state: &ShapedSegmentState)
Trait Implementations§
source§impl Clone for ShapedSegment
impl Clone for ShapedSegment
source§fn clone(&self) -> ShapedSegment
fn clone(&self) -> ShapedSegment
Returns a copy 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 RefUnwindSafe for ShapedSegment
impl Send for ShapedSegment
impl Sync for ShapedSegment
impl Unpin for ShapedSegment
impl UnwindSafe for ShapedSegment
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