Struct FreeTypeScaler

Source
pub(crate) struct FreeTypeScaler<'a> {
Show 13 fields outlines: &'a Outlines<'a>, memory: FreeTypeOutlineMemory<'a>, coords: &'a [F2Dot14], point_count: usize, contour_count: usize, component_delta_count: usize, ppem: f32, scale: F26Dot6, is_scaled: bool, is_hinted: bool, pedantic_hinting: bool, phantom: [Point<F26Dot6>; 4], hinter: Option<&'a HintInstance>,
}
Expand description

F26Dot6 coords, Fixed deltas, and a penchant for rounding

Fields§

§outlines: &'a Outlines<'a>§memory: FreeTypeOutlineMemory<'a>§coords: &'a [F2Dot14]§point_count: usize§contour_count: usize§component_delta_count: usize§ppem: f32§scale: F26Dot6§is_scaled: bool§is_hinted: bool§pedantic_hinting: bool§phantom: [Point<F26Dot6>; 4]

Phantom points. These are 4 extra points appended to the end of an outline that allow the bytecode interpreter to produce hinted metrics.

See https://learn.microsoft.com/en-us/typography/opentype/spec/tt_instructing_glyphs#phantom-points

§hinter: Option<&'a HintInstance>

Implementations§

Source§

impl<'a> FreeTypeScaler<'a>

Source

pub(crate) fn unhinted( outlines: &'a Outlines<'a>, outline: &'a Outline<'_>, buf: &'a mut [u8], ppem: Option<f32>, coords: &'a [F2Dot14], ) -> Result<Self, DrawError>

Source

pub(crate) fn hinted( outlines: &'a Outlines<'a>, outline: &'a Outline<'_>, buf: &'a mut [u8], ppem: Option<f32>, coords: &'a [F2Dot14], hinter: &'a HintInstance, pedantic_hinting: bool, ) -> Result<Self, DrawError>

Source

pub(crate) fn scale( self, glyph: &Option<Glyph<'_>>, glyph_id: GlyphId, ) -> Result<ScaledOutline<'a, F26Dot6>, DrawError>

Trait Implementations§

Source§

impl Scaler for FreeTypeScaler<'_>

Source§

fn setup_phantom_points( &mut self, bounds: [i16; 4], lsb: i32, advance: i32, tsb: i32, vadvance: i32, )

Source§

fn outlines(&self) -> &Outlines<'_>

Source§

fn load_empty(&mut self, glyph_id: GlyphId) -> Result<(), DrawError>

Source§

fn load_simple( &mut self, glyph: &SimpleGlyph<'_>, glyph_id: GlyphId, ) -> Result<(), DrawError>

Source§

fn load_composite( &mut self, glyph: &CompositeGlyph<'_>, glyph_id: GlyphId, recurse_depth: usize, ) -> Result<(), DrawError>

Source§

fn load( &mut self, glyph: &Option<Glyph<'_>>, glyph_id: GlyphId, recurse_depth: usize, ) -> Result<(), DrawError>

Auto Trait Implementations§

§

impl<'a> Freeze for FreeTypeScaler<'a>

§

impl<'a> RefUnwindSafe for FreeTypeScaler<'a>

§

impl<'a> Send for FreeTypeScaler<'a>

§

impl<'a> Sync for FreeTypeScaler<'a>

§

impl<'a> Unpin for FreeTypeScaler<'a>

§

impl<'a> !UnwindSafe for FreeTypeScaler<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.