[hmtx] Use more optimal way to access glyf table
diff --git a/src/hb-ot-hmtx-table.cc b/src/hb-ot-hmtx-table.cc
index 012a9f2..93afd56 100644
--- a/src/hb-ot-hmtx-table.cc
+++ b/src/hb-ot-hmtx-table.cc
@@ -29,26 +29,14 @@
namespace OT {
-int hmtxvmtx_accelerator_base_t::get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool vertical)
+int hmtxvmtx_accelerator_base_t::get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool is_vertical)
{
- glyf::accelerator_t glyf_accel;
- glyf_accel.init (font->face);
-
- int side_bearing = glyf_accel.get_side_bearing_var (glyph, font->coords, font->num_coords, vertical);
- glyf_accel.fini ();
-
- return side_bearing;
+ return font->face->table.glyf->get_side_bearing_var (glyph, font->coords, font->num_coords, is_vertical);
}
-unsigned int hmtxvmtx_accelerator_base_t::get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool vertical)
+unsigned int hmtxvmtx_accelerator_base_t::get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool is_vertical)
{
- glyf::accelerator_t glyf_accel;
- glyf_accel.init (font->face);
-
- unsigned int advance = glyf_accel.get_advance_var (glyph, font->coords, font->num_coords, vertical);
- glyf_accel.fini ();
-
- return advance;
+ return font->face->table.glyf->get_advance_var (glyph, font->coords, font->num_coords, is_vertical);
}
}
diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh
index 90c9c48..f5c0944 100644
--- a/src/hb-ot-hmtx-table.hh
+++ b/src/hb-ot-hmtx-table.hh
@@ -55,8 +55,8 @@
struct hmtxvmtx_accelerator_base_t
{
- HB_INTERNAL static int get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool vertical);
- HB_INTERNAL static unsigned int get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool vertical);
+ HB_INTERNAL static int get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool is_vertical);
+ HB_INTERNAL static unsigned int get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool is_vertical);
};
template <typename T, typename H>