Struct HintingInstance
pub struct HintingInstance { /* private fields */ }Expand description
Hinting instance that uses information embedded in the font to perform grid-fitting.
Implementations§
§impl HintingInstance
impl HintingInstance
pub fn new<'a>(
outline_glyphs: &OutlineGlyphCollection<'_>,
size: Size,
location: impl Into<LocationRef<'a>>,
options: impl Into<HintingOptions>,
) -> Result<HintingInstance, DrawError>
pub fn new<'a>( outline_glyphs: &OutlineGlyphCollection<'_>, size: Size, location: impl Into<LocationRef<'a>>, options: impl Into<HintingOptions>, ) -> Result<HintingInstance, DrawError>
Creates a new embedded hinting instance for the given outline collection, size, location in variation space and hinting mode.
pub fn location(&self) -> LocationRef<'_>
pub fn location(&self) -> LocationRef<'_>
Returns the currently configured normalized location in variation space.
pub fn reconfigure<'a>(
&mut self,
outlines: &OutlineGlyphCollection<'_>,
size: Size,
location: impl Into<LocationRef<'a>>,
options: impl Into<HintingOptions>,
) -> Result<(), DrawError>
pub fn reconfigure<'a>( &mut self, outlines: &OutlineGlyphCollection<'_>, size: Size, location: impl Into<LocationRef<'a>>, options: impl Into<HintingOptions>, ) -> Result<(), DrawError>
Resets the hinter state for a new font instance with the given outline collection and settings.
pub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns true if hinting should actually be applied for this instance.
Some TrueType fonts disable hinting dynamically based on the instance configuration.
Trait Implementations§
§impl Clone for HintingInstance
impl Clone for HintingInstance
§fn clone(&self) -> HintingInstance
fn clone(&self) -> HintingInstance
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl<'a> From<&'a HintingInstance> for DrawSettings<'a>
impl<'a> From<&'a HintingInstance> for DrawSettings<'a>
§fn from(value: &'a HintingInstance) -> DrawSettings<'a>
fn from(value: &'a HintingInstance) -> DrawSettings<'a>
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for HintingInstance
impl RefUnwindSafe for HintingInstance
impl Send for HintingInstance
impl Sync for HintingInstance
impl Unpin for HintingInstance
impl UnsafeUnpin for HintingInstance
impl UnwindSafe for HintingInstance
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,
§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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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>
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