Only enable design metrics for scalable fonts
authorJiang Jiang <jiang.jiang@nokia.com>
Thu, 5 May 2011 11:17:26 +0000 (13:17 +0200)
committerJiang Jiang <jiang.jiang@nokia.com>
Thu, 5 May 2011 11:39:11 +0000 (13:39 +0200)
Bitmap fonts don't have linear advance at all.

Reviewed-by: Eskil
(cherry picked from commit 111accbf9aaf95b052448ecb70937c61e9b59d66)

src/gui/text/qfontengine_ft.cpp

index 237cde4..4dae2a3 100644 (file)
@@ -1597,7 +1597,7 @@ void QFontEngineFT::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlag
     FT_Face face = 0;
     bool design = (default_hint_style == HintNone ||
                    default_hint_style == HintLight ||
-                   (flags & HB_ShaperFlag_UseDesignMetrics));
+                   (flags & HB_ShaperFlag_UseDesignMetrics)) && FT_IS_SCALABLE(freetype->face);
     for (int i = 0; i < glyphs->numGlyphs; i++) {
         Glyph *g = defaultGlyphSet.getGlyph(glyphs->glyphs[i]);
         if (g) {