read_fonts/tables/
vmtx.rs

1//! The [vmtx (Vertical Metrics)](https://docs.microsoft.com/en-us/typography/opentype/spec/vmtx) table
2
3use super::hmtx;
4pub use super::hmtx::LongMetric;
5
6include!("../../generated/generated_vmtx.rs");
7
8impl Vmtx<'_> {
9    /// Returns the advance height for the given glyph identifier.
10    pub fn advance(&self, glyph_id: GlyphId) -> Option<u16> {
11        hmtx::advance(self.v_metrics(), glyph_id)
12    }
13
14    /// Returns the top side bearing for the given glyph identifier.
15    pub fn side_bearing(&self, glyph_id: GlyphId) -> Option<i16> {
16        hmtx::side_bearing(self.v_metrics(), self.top_side_bearings(), glyph_id)
17    }
18}