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 Freeze for ShapedSegment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more