Struct Shaper
pub struct Shaper<'a> { /* private fields */ }Expand description
A configured shaper.
Implementations§
§impl<'a> hb_font_t<'a>
impl<'a> hb_font_t<'a>
pub fn units_per_em(&self) -> i32
pub fn units_per_em(&self) -> i32
Returns font’s units per EM.
pub fn shape(&self, buffer: UnicodeBuffer, features: &[Feature]) -> GlyphBuffer
pub fn shape(&self, buffer: UnicodeBuffer, features: &[Feature]) -> GlyphBuffer
Shapes the buffer content using provided font and features.
Consumes the buffer. You can then run GlyphBuffer::clear to get the UnicodeBuffer back
without allocating a new one.
If you plan to shape multiple strings, prefer shape_with_plan.
This is because ShapePlan initialization is pretty slow and should preferably
be called once for each shaping configuration.
pub fn shape_with_plan(
&self,
plan: &hb_ot_shape_plan_t,
buffer: UnicodeBuffer,
features: &[Feature],
) -> GlyphBuffer
pub fn shape_with_plan( &self, plan: &hb_ot_shape_plan_t, buffer: UnicodeBuffer, features: &[Feature], ) -> GlyphBuffer
Shapes the buffer content using the provided font and plan.
Consumes the buffer. You can then run GlyphBuffer::clear to get the UnicodeBuffer back
without allocating a new one.
It is up to the caller to ensure that the shape plan matches the properties of the provided buffer, otherwise the shaping result will likely be incorrect.
§Panics
Will panic when debugging assertions are enabled if the buffer and plan have mismatched properties.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for hb_font_t<'a>
impl<'a> RefUnwindSafe for hb_font_t<'a>
impl<'a> Send for hb_font_t<'a>
impl<'a> Sync for hb_font_t<'a>
impl<'a> Unpin for hb_font_t<'a>
impl<'a> UnsafeUnpin for hb_font_t<'a>
impl<'a> UnwindSafe for hb_font_t<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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