From bee8d86671c45b093d4f238ceba9eebe4120e0bb Mon Sep 17 00:00:00 2001 From: Michiharu Ariza Date: Mon, 18 Mar 2019 10:48:53 -0700 Subject: [PATCH] fix build --- src/hb-ot-hmtx-table.cc | 15 ++++----------- src/hb-ot-hmtx-table.hh | 15 +++++++++------ src/hb-ot-var-gvar-table.hh | 1 + 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/hb-ot-hmtx-table.cc b/src/hb-ot-hmtx-table.cc index 89c5fbc61..d686fe3b8 100644 --- a/src/hb-ot-hmtx-table.cc +++ b/src/hb-ot-hmtx-table.cc @@ -29,33 +29,26 @@ namespace OT { -template -int hmtxvmtx::accelerator_t::get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph) const +int hmtxvmtx_accelerator_base_t::get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool vertical) { glyf::accelerator_t glyf_accel; glyf_accel.init (font->face); - float side_bearing = glyf_accel.get_side_bearing_var (glyph, font->coords, font->num_coords, T::tableTag==HB_OT_TAG_vmtx); + float side_bearing = glyf_accel.get_side_bearing_var (glyph, font->coords, font->num_coords, vertical); glyf_accel.fini (); return (int)side_bearing; } -template -unsigned int hmtxvmtx::accelerator_t::get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph) const +unsigned int hmtxvmtx_accelerator_base_t::get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool vertical) { glyf::accelerator_t glyf_accel; glyf_accel.init (font->face); - float advance = glyf_accel.get_advance_var (glyph, font->coords, font->num_coords, T::tableTag==HB_OT_TAG_vmtx); + float advance = glyf_accel.get_advance_var (glyph, font->coords, font->num_coords, vertical); glyf_accel.fini (); return (unsigned int)advance; } -template int hmtxvmtx::accelerator_t::get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph) const; -template int hmtxvmtx::accelerator_t::get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph) const; -template unsigned int hmtxvmtx::accelerator_t::get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph) const; -template unsigned int hmtxvmtx::accelerator_t::get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph) const; - } diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh index ff79199b0..08fa2c9cd 100644 --- a/src/hb-ot-hmtx-table.hh +++ b/src/hb-ot-hmtx-table.hh @@ -53,6 +53,12 @@ struct LongMetric DEFINE_SIZE_STATIC (4); }; +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); +}; + template struct hmtxvmtx { @@ -156,7 +162,7 @@ struct hmtxvmtx return success; } - struct accelerator_t + struct accelerator_t : hmtxvmtx_accelerator_base_t { friend struct hmtxvmtx; @@ -238,7 +244,7 @@ struct hmtxvmtx if (var_table.get_blob () != hb_blob_get_empty ()) side_bearing += var_table->get_side_bearing_var (glyph, font->coords, font->num_coords); // TODO Optimize?! else - side_bearing = get_side_bearing_var_tt (font, glyph); + side_bearing = get_side_bearing_var_tt (font, glyph, T::tableTag==HB_OT_TAG_vmtx); } } return side_bearing; @@ -271,7 +277,7 @@ struct hmtxvmtx if (var_table.get_blob () != hb_blob_get_empty ()) advance += var_table->get_advance_var (glyph, font->coords, font->num_coords); // TODO Optimize?! else - advance = get_advance_var_tt (font, glyph); + advance = get_advance_var_tt (font, glyph, T::tableTag==HB_OT_TAG_vmtx); } } return advance; @@ -293,9 +299,6 @@ struct hmtxvmtx } private: - int get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph) const; - unsigned int get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph) const; - unsigned int _advance_for_new_gid (const hb_subset_plan_t *plan, hb_codepoint_t new_gid) const { diff --git a/src/hb-ot-var-gvar-table.hh b/src/hb-ot-var-gvar-table.hh index 256523301..cc1150ad9 100644 --- a/src/hb-ot-var-gvar-table.hh +++ b/src/hb-ot-var-gvar-table.hh @@ -502,6 +502,7 @@ struct gvar void fini () { gvar_table.destroy (); + shared_tuples.fini (); } protected: