summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/text/qfontengine_ft.cpp7
-rw-r--r--src/gui/text/qfontengine_ft_p.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 0a8be67e43..8b6c9a192c 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -891,6 +891,13 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph,
// 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);
+ } else if (err == FT_Err_Execution_Too_Long) {
+ // This is an error in the bytecode, probably a web font made by someone who
+ // didn't test bytecode hinting at all so disable for it for all glyphs.
+ qWarning("load glyph failed due to broken hinting bytecode in font, switching to auto hinting");
+ default_load_flags |= FT_LOAD_FORCE_AUTOHINT;
+ load_flags |= FT_LOAD_FORCE_AUTOHINT;
+ err = FT_Load_Glyph(face, glyph, load_flags);
}
if (err != FT_Err_Ok) {
qWarning("load glyph failed err=%x face=%p, glyph=%d", err, face, glyph);
diff --git a/src/gui/text/qfontengine_ft_p.h b/src/gui/text/qfontengine_ft_p.h
index 1894d25d70..5b397e0034 100644
--- a/src/gui/text/qfontengine_ft_p.h
+++ b/src/gui/text/qfontengine_ft_p.h
@@ -293,7 +293,7 @@ private:
protected:
QFreetypeFace *freetype;
- int default_load_flags;
+ mutable int default_load_flags;
HintStyle default_hint_style;
bool antialias;
bool transform;