From: Rod Sheeter Date: Thu, 15 Feb 2018 19:29:01 +0000 (-0800) Subject: [subset] correct bug introduced to get_advance X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0758cbc4c2f52c629d05515b8d2816e8d6a2a2c1;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [subset] correct bug introduced to get_advance --- diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh index ed57d4a..5a29149 100644 --- a/src/hb-ot-hmtx-table.hh +++ b/src/hb-ot-hmtx-table.hh @@ -257,8 +257,12 @@ struct hmtxvmtx inline unsigned int get_advance (hb_codepoint_t glyph, hb_font_t *font) const { - return get_advance (glyph) - + (font->num_coords ? var_table->get_advance_var (glyph, font->coords, font->num_coords) : 0); // TODO Optimize?! + unsigned int advance = get_advance (glyph); + if (likely(glyph < num_metrics)) + { + advance += (font->num_coords ? var_table->get_advance_var (glyph, font->coords, font->num_coords) : 0); // TODO Optimize?! + } + return advance; } public: