提交 0decbb36 编写于 作者: S Seigo Nonaka

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
上级 dfab450f
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册