Type Alias read_fonts::tables::hmtx::Hmtx

source ·
pub type Hmtx<'a> = TableRef<'a, HmtxMarker>;
Expand description

Aliased Type§

struct Hmtx<'a> { /* private fields */ }

Implementations§

source§

impl<'a> Hmtx<'a>

source

pub fn read( data: FontData<'a>, number_of_h_metrics: u16, num_glyphs: u16 ) -> Result<Self, ReadError>

A constructor that requires additional arguments.

This type requires some external state in order to be parsed.

source§

impl<'a> Hmtx<'a>

source

pub fn h_metrics(&self) -> &'a [LongMetric]

Paired advance width/height and left/top side bearing values for each glyph. Records are indexed by glyph ID.

source

pub fn left_side_bearings(&self) -> &'a [BigEndian<i16>]

Leading (left/top) side bearings for glyph IDs greater than or equal to numberOfLongMetrics.

source§

impl<'a> Hmtx<'a>

source

pub fn advance(&self, glyph_id: GlyphId) -> Option<u16>

Returns the advance width for the given glyph identifier.

source

pub fn side_bearing(&self, glyph_id: GlyphId) -> Option<i16>

Returns the left side bearing for the given glyph identifer.

Trait Implementations§

source§

impl<'a> Debug for Hmtx<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> FontReadWithArgs<'a> for Hmtx<'a>

source§

fn read_with_args( data: FontData<'a>, args: &(u16, u16) ) -> Result<Self, ReadError>

read an item, using the provided args. Read more
source§

impl ReadArgs for Hmtx<'_>

§

type Args = (u16, u16)

source§

impl<'a> SomeTable<'a> for Hmtx<'a>

source§

fn type_name(&self) -> &str

The name of this table
source§

fn get_field(&self, idx: usize) -> Option<Field<'a>>

Access this table’s fields, in declaration order.
source§

impl TopLevelTable for Hmtx<'_>

source§

const TAG: Tag = _

hmtx