diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 40311e1b9..0cfbb22e3 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -382,6 +382,7 @@ hb_ft_get_glyph_v_advance (hb_font_t *font, /* Note: FreeType's vertical metrics grows downward while other FreeType coordinates * have a Y growing upward. Hence the extra negation. */ + return (-v + (1<<9)) >> 10; } #endif diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 77d3f639d..e00480442 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -161,7 +161,8 @@ hb_ot_get_glyph_v_origin (hb_font_t *font, } hb_glyph_extents_t extents = {0}; - if (ot_face->glyf->get_extents (font, glyph, &extents)) + if (ot_face->vmtx->has_data () && + ot_face->glyf->get_extents (font, glyph, &extents)) { const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx; hb_position_t tsb = vmtx.get_side_bearing (font, glyph); diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh index 7487e40e6..4c7dabedc 100644 --- a/src/hb-ot-hmtx-table.hh +++ b/src/hb-ot-hmtx-table.hh @@ -220,6 +220,8 @@ struct hmtxvmtx var_table.destroy (); } + bool has_data () const { return (bool) num_bearings; } + int get_side_bearing (hb_codepoint_t glyph) const { if (glyph < num_long_metrics)