From de6a4d137c9deed078321af583df2fadae4c4872 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 9 Jan 2022 02:59:20 +0200 Subject: [PATCH] remove broken glyphs workaround in freetype2 font engine Signed-off-by: Ivailo Monev --- src/gui/text/qfontengine_ft.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 81257b73f..b99938637 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -345,19 +345,15 @@ bool QFontEngineFT::loadGlyph(glyph_t glyph, int load_flags) const { FT_Face face = freetype->face; FT_Error err = FT_Load_Glyph(face, glyph, load_flags); - if (err == FT_Err_Too_Few_Arguments) { - // this is an error in the bytecode interpreter, just try to run without it - load_flags |= FT_LOAD_FORCE_AUTOHINT; - err = FT_Load_Glyph(face, glyph, load_flags); + if (Q_UNLIKELY(err != FT_Err_Ok)) { + qWarning("load glyph failed err=%x face=%p, glyph=%d", err, face, glyph); + return false; } FT_GlyphSlot slot = face->glyph; if (Q_UNLIKELY(slot->format != FT_GLYPH_FORMAT_OUTLINE)) { qWarning("non-outline format is not supported format=%d face=%p, glyph=%d", slot->format, face, glyph); return false; - } else if (Q_UNLIKELY(err != FT_Err_Ok)) { - qWarning("load glyph failed err=%x face=%p, glyph=%d", err, face, glyph); - return false; } if (embolden) {