From 0decbb3686f9fe929bed1664b11366a00520e86a Mon Sep 17 00:00:00 2001 From: Seigo Nonaka Date: Thu, 12 Jan 2017 18:33:44 +0900 Subject: [PATCH] Fix inverse condition of forColorEmoji. We should override the advance function only when the glyph is came from color bitmap. This was introduced by Ia88cb670ca9e0bb352bccef22c5ea3a789bcc1da. Bug: 21705974 Test: ran minikin_tests Change-Id: I3489d75ace8bffdd9035a5986a2641313feef04d --- libs/minikin/Layout.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/minikin/Layout.cpp b/libs/minikin/Layout.cpp index 2e7ef77e235..98e9fdb07ba 100644 --- a/libs/minikin/Layout.cpp +++ b/libs/minikin/Layout.cpp @@ -304,15 +304,15 @@ hb_font_funcs_t* getHbFontFuncs(bool forColorBitmapFont) { if (*funcs == nullptr) { *funcs = hb_font_funcs_create(); if (forColorBitmapFont) { - // Override the h_advance function since we can't use HarfBuzz's implemenation. It may - // return the wrong value if the font uses hinting aggressively. - hb_font_funcs_set_glyph_h_advance_func(*funcs, harfbuzzGetGlyphHorizontalAdvance, 0, 0); - } else { // Don't override the h_advance function since we use HarfBuzz's implementation for // emoji for performance reasons. // Note that it is technically possible for a TrueType font to have outline and embedded // bitmap at the same time. We ignore modified advances of hinted outline glyphs in that // case. + } else { + // Override the h_advance function since we can't use HarfBuzz's implemenation. It may + // return the wrong value if the font uses hinting aggressively. + hb_font_funcs_set_glyph_h_advance_func(*funcs, harfbuzzGetGlyphHorizontalAdvance, 0, 0); } hb_font_funcs_set_glyph_h_origin_func(*funcs, harfbuzzGetGlyphHorizontalOrigin, 0, 0); hb_font_funcs_make_immutable(*funcs);