Struct HarfBuzzScaler

Source
pub(crate) struct HarfBuzzScaler<'a> {
    outlines: &'a Outlines<'a>,
    memory: HarfBuzzOutlineMemory<'a>,
    coords: &'a [F2Dot14],
    point_count: usize,
    contour_count: usize,
    component_delta_count: usize,
    ppem: f32,
    scale: F26Dot6,
    is_scaled: bool,
    phantom: [Point<f32>; 4],
}
Expand description

f32 all the things. Hold your rounding. No hinting.

Fields§

§outlines: &'a Outlines<'a>§memory: HarfBuzzOutlineMemory<'a>§coords: &'a [F2Dot14]§point_count: usize§contour_count: usize§component_delta_count: usize§ppem: f32§scale: F26Dot6§is_scaled: bool§phantom: [Point<f32>; 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

Implementations§

Source§

impl<'a> HarfBuzzScaler<'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 scale( self, glyph: &Option<Glyph<'_>>, glyph_id: GlyphId, ) -> Result<ScaledOutline<'a, f32>, DrawError>

Trait Implementations§

Source§

impl Scaler for HarfBuzzScaler<'_>

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 HarfBuzzScaler<'a>

§

impl<'a> RefUnwindSafe for HarfBuzzScaler<'a>

§

impl<'a> Send for HarfBuzzScaler<'a>

§

impl<'a> Sync for HarfBuzzScaler<'a>

§

impl<'a> Unpin for HarfBuzzScaler<'a>

§

impl<'a> !UnwindSafe for HarfBuzzScaler<'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.