Struct ShapeOptions
pub struct ShapeOptions<'a> { /* private fields */ }Expand description
Options which can be used to configure shaping.
Implementations§
§impl<'a> ShapeOptions<'a>
impl<'a> ShapeOptions<'a>
pub fn new() -> ShapeOptions<'a>
pub fn new() -> ShapeOptions<'a>
Creates a default set of shape options ready for configuration.
pub fn plan(self, plan: Option<&'a hb_ot_shape_plan_t>) -> ShapeOptions<'a>
pub fn plan(self, plan: Option<&'a hb_ot_shape_plan_t>) -> ShapeOptions<'a>
Sets the plan to use for shaping.
The shape plan must be compatible with the properties of the buffer passed to shaping.
pub fn scale(self, scale: Option<i32>) -> ShapeOptions<'a>
pub fn scale(self, scale: Option<i32>) -> ShapeOptions<'a>
Sets the scale factor to use during shaping.
The font scale is a number related to, but not the same as, font size. Typically the client establishes a scale factor to be used between the two. For example, 64, or 256, which would be the fractional-precision part of the font scale. This is necessary because position and metric values are integer types and you need to leave room for fractional values in there.
For example, to set the font size to 20, with 64 levels of fractional
precision you would call provide a scale of 20 * 64.
In the example above, even what font size 20 means is up to you. It might be 20 pixels, or 20 points, or 20 millimeters. HarfRust does not care about that.
The choice of scale is yours but needs to be consistent between what you set here, and what you expect as output as well as the values returned by font functions.
This defaults to None which means that no scale is applied– positions
and metrics will be returned in font units.
pub fn scale_separate(self, scale: Option<(i32, i32)>) -> ShapeOptions<'a>
pub fn scale_separate(self, scale: Option<(i32, i32)>) -> ShapeOptions<'a>
Sets separate x- and y-scale factors to use during shaping.
Each axis uses the same semantics as scale.
pub fn point_size(self, point_size: Option<f32>) -> ShapeOptions<'a>
pub fn point_size(self, point_size: Option<f32>) -> ShapeOptions<'a>
Sets the size used for application of the tracking table.
pub fn features(self, features: &'a [Feature]) -> ShapeOptions<'a>
pub fn features(self, features: &'a [Feature]) -> ShapeOptions<'a>
Sets the features to apply during shaping.
pub fn font_funcs(
self,
funcs: Option<&'a mut dyn FontFuncs>,
) -> ShapeOptions<'a>
pub fn font_funcs( self, funcs: Option<&'a mut dyn FontFuncs>, ) -> ShapeOptions<'a>
Sets optional font functions used for shaping.
Trait Implementations§
§impl<'a> Default for ShapeOptions<'a>
impl<'a> Default for ShapeOptions<'a>
§fn default() -> ShapeOptions<'a>
fn default() -> ShapeOptions<'a>
Auto Trait Implementations§
impl<'a> Freeze for ShapeOptions<'a>
impl<'a> !RefUnwindSafe for ShapeOptions<'a>
impl<'a> !Send for ShapeOptions<'a>
impl<'a> !Sync for ShapeOptions<'a>
impl<'a> Unpin for ShapeOptions<'a>
impl<'a> UnsafeUnpin for ShapeOptions<'a>
impl<'a> !UnwindSafe for ShapeOptions<'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
§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> 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>, which can then be
downcast into Box<dyn 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>, which 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> 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