From 07107959ecb5f7956b6970132d955d0cafb66bff Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 26 Sep 2011 14:34:15 +0200 Subject: Fix possible assert in QFontEngineFT This is a regression caused by 070d9c00. If the defaultFormat is set to Format_None, we should default to Format_A8 like before the change. Change-Id: I8ad07abff96fc1dfa03c0c5b49d13beb36b9de70 Reviewed-on: http://codereview.qt-project.org/5540 Reviewed-by: Qt Sanity Bot Reviewed-by: Jiang Jiang --- src/gui/text/qfontengine_ft.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 6c351c0614..1ce73023b1 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1810,8 +1810,10 @@ QImage *QFontEngineFT::lockedAlphaMapForGlyph(glyph_t glyphIndex, QFixed subPixe if (isBitmapFont()) neededFormat = Format_Mono; - else if (neededFormat == Format_None) + else if (neededFormat == Format_None && defaultFormat != Format_None) neededFormat = defaultFormat; + else if (neededFormat == Format_None) + neededFormat = Format_A8; QFontEngineFT::QGlyphSet *gset = defaultGlyphs(); if (t.type() >= QTransform::TxScale) { -- cgit v1.2.3