Skip to main content

BuiltinFontFuncs

Struct BuiltinFontFuncs 

Source
pub struct BuiltinFontFuncs<'a> {
    face: &'a hb_font_t<'a>,
    glyph_metrics: OnceCell<GlyphMetrics<'a>>,
    charmap: OnceCell<Charmap<'a>>,
}
Expand description

Default implementations backed by font tables.

Fields§

§face: &'a hb_font_t<'a>§glyph_metrics: OnceCell<GlyphMetrics<'a>>§charmap: OnceCell<Charmap<'a>>

Implementations§

Source§

impl<'a> BuiltinFontFuncs<'a>

Source

pub(crate) fn new(face: &'a hb_font_t<'a>) -> Self

Source

fn coords(&self) -> &[F2Dot14]

Source

fn charmap(&self) -> &Charmap<'a>

Source

fn glyph_metrics(&self) -> &GlyphMetrics<'a>

Source

pub fn nominal_glyph(&self, c: u32) -> Option<GlyphId>

Maps a Unicode scalar value to a nominal glyph.

Source

pub fn variant_glyph(&self, c: u32, vs: u32) -> Option<GlyphId>

Maps a Unicode scalar value and variation selector to a glyph.

Source

pub fn advance_width(&self, glyph: GlyphId) -> i32

Returns the horizontal advance for a glyph.

Source

pub fn advance_height(&self, glyph: GlyphId) -> i32

Returns the vertical advance for a glyph.

Source

pub fn vertical_origin(&self, glyph: GlyphId) -> (i32, i32)

Returns the vertical origin for a glyph.

Source

pub fn extents(&self, glyph: GlyphId) -> Option<GlyphExtents>

Returns extents for a glyph if available.

Source

pub fn populate_advance_widths(&self, batch: AdvanceWidthBatch<'_>)

Populates horizontal advances for all entries in the batch.

Auto Trait Implementations§

§

impl<'a> !Freeze for BuiltinFontFuncs<'a>

§

impl<'a> !RefUnwindSafe for BuiltinFontFuncs<'a>

§

impl<'a> Send for BuiltinFontFuncs<'a>

§

impl<'a> !Sync for BuiltinFontFuncs<'a>

§

impl<'a> Unpin for BuiltinFontFuncs<'a>

§

impl<'a> UnsafeUnpin for BuiltinFontFuncs<'a>

§

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