fix build

This commit is contained in:
Michiharu Ariza 2019-03-18 10:48:53 -07:00
parent b6cc838888
commit 9d9d5c706b
3 changed files with 14 additions and 17 deletions

View File

@ -29,33 +29,26 @@
namespace OT { namespace OT {
template <typename T, typename H> int hmtxvmtx_accelerator_base_t::get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool vertical)
int hmtxvmtx<T, H>::accelerator_t::get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph) const
{ {
glyf::accelerator_t glyf_accel; glyf::accelerator_t glyf_accel;
glyf_accel.init (font->face); 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 (); glyf_accel.fini ();
return (int)side_bearing; return (int)side_bearing;
} }
template <typename T, typename H> unsigned int hmtxvmtx_accelerator_base_t::get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool vertical)
unsigned int hmtxvmtx<T, H>::accelerator_t::get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph) const
{ {
glyf::accelerator_t glyf_accel; glyf::accelerator_t glyf_accel;
glyf_accel.init (font->face); 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 (); glyf_accel.fini ();
return (unsigned int)advance; return (unsigned int)advance;
} }
template int hmtxvmtx<hmtx, hhea>::accelerator_t::get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph) const;
template int hmtxvmtx<vmtx, vhea>::accelerator_t::get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph) const;
template unsigned int hmtxvmtx<hmtx, hhea>::accelerator_t::get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph) const;
template unsigned int hmtxvmtx<vmtx, vhea>::accelerator_t::get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph) const;
} }

View File

@ -53,6 +53,12 @@ struct LongMetric
DEFINE_SIZE_STATIC (4); 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 <typename T, typename H> template <typename T, typename H>
struct hmtxvmtx struct hmtxvmtx
{ {
@ -156,7 +162,7 @@ struct hmtxvmtx
return success; return success;
} }
struct accelerator_t struct accelerator_t : hmtxvmtx_accelerator_base_t
{ {
friend struct hmtxvmtx; friend struct hmtxvmtx;
@ -238,7 +244,7 @@ struct hmtxvmtx
if (var_table.get_blob () != hb_blob_get_empty ()) 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?! side_bearing += var_table->get_side_bearing_var (glyph, font->coords, font->num_coords); // TODO Optimize?!
else 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; return side_bearing;
@ -271,7 +277,7 @@ struct hmtxvmtx
if (var_table.get_blob () != hb_blob_get_empty ()) if (var_table.get_blob () != hb_blob_get_empty ())
advance += var_table->get_advance_var (glyph, font->coords, font->num_coords); // TODO Optimize?! advance += var_table->get_advance_var (glyph, font->coords, font->num_coords); // TODO Optimize?!
else else
advance = get_advance_var_tt (font, glyph); advance = get_advance_var_tt (font, glyph, T::tableTag==HB_OT_TAG_vmtx);
} }
} }
return advance; return advance;
@ -293,9 +299,6 @@ struct hmtxvmtx
} }
private: 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, unsigned int _advance_for_new_gid (const hb_subset_plan_t *plan,
hb_codepoint_t new_gid) const hb_codepoint_t new_gid) const
{ {

View File

@ -515,6 +515,7 @@ struct gvar
void fini () void fini ()
{ {
gvar_table.destroy (); gvar_table.destroy ();
shared_tuples.fini ();
} }
private: private: