Use QT_MAX_CACHED_GLYPH_SIZE in QFontEngineFT

Task-number: QTBUG-21162 - Letters get truncated when font size=72 and set to Italic
Reviewed-by: Eskil
(cherry picked from commit cd43d6386de6e66379fa23c1ea4ec06141167c86)

Change-Id: Ic05f775975d5f21e0274e7b2c3a4903d6a4ae41f
Reviewed-on: http://codereview.qt-project.org/5203
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
This commit is contained in:
Aleksandar Stojiljkovic 2011-09-08 12:00:41 +03:00 committed by Qt by Nokia
parent ca320dfc30
commit 3fa945ae7c

View File

@ -78,6 +78,10 @@
#include FT_ERRORS_H
#endif
#if !defined(QT_MAX_CACHED_GLYPH_SIZE)
# define QT_MAX_CACHED_GLYPH_SIZE 64
#endif
QT_BEGIN_NAMESPACE
/*
@ -381,7 +385,7 @@ void QFreetypeFace::computeSize(const QFontDef &fontDef, int *xsize, int *ysize,
*xsize = *ysize = 0;
}
} else {
*outline_drawing = (*xsize > (64<<6) || *ysize > (64<<6));
*outline_drawing = (*xsize > (QT_MAX_CACHED_GLYPH_SIZE<<6) || *ysize > (QT_MAX_CACHED_GLYPH_SIZE<<6));
}
}
@ -1345,7 +1349,7 @@ QFontEngineFT::QGlyphSet *QFontEngineFT::loadTransformedGlyphSet(const QTransfor
if (!gs) {
// don't try to load huge fonts
bool draw_as_outline = fontDef.pixelSize * qSqrt(qAbs(matrix.det())) >= 64;
bool draw_as_outline = fontDef.pixelSize * qSqrt(qAbs(matrix.det())) >= QT_MAX_CACHED_GLYPH_SIZE;
if (draw_as_outline)
return 0;