diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2010-08-30 12:03:37 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2010-09-01 11:01:19 (GMT) |
commit | 25622198904580c6eb93996f74c2e7b62afa77c7 (patch) | |
tree | dbc754b5a04f21708dcdb4c326a3b18f89a2aba9 /src | |
parent | dcb98430f6add24c9d54253bd35d35010cc75c23 (diff) | |
download | Qt-25622198904580c6eb93996f74c2e7b62afa77c7.zip Qt-25622198904580c6eb93996f74c2e7b62afa77c7.tar.gz Qt-25622198904580c6eb93996f74c2e7b62afa77c7.tar.bz2 |
Fix compiling issue for FreeType version earlier than 2.1.10
FT_GlyphSlot_Embolden was introduced since FreeType 2.1.10 and we
started using it since 4.7. Some systems (including RHEL/CentOS 4) only
provide earlier versions will get a compiling error if they use
-system-freetype to build Qt. This patch fix it by providing a graceful
degradation when the function is not available.
Task-number: QTBUG-13274
Reviewed-by: Eskil
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qfontengine_ft.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 2c4fbab..60db8b6 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -94,6 +94,13 @@ QT_BEGIN_NAMESPACE #define Y_SIZE(face,i) ((face)->available_sizes[i].height << 6) #endif +/* FreeType 2.1.10 starts to provide FT_GlyphSlot_Embolden */ +#if (FREETYPE_MAJOR*10000+FREETYPE_MINOR*100+FREETYPE_PATCH) >= 20110 +#define Q_FT_GLYPHSLOT_EMBOLDEN(slot) FT_GlyphSlot_Embolden(slot) +#else +#define Q_FT_GLYPHSLOT_EMBOLDEN(slot) +#endif + #define FLOOR(x) ((x) & -64) #define CEIL(x) (((x)+63) & -64) #define TRUNC(x) ((x) >> 6) @@ -794,7 +801,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyphMetrics(QGlyphSet *set, uint glyph } FT_GlyphSlot slot = face->glyph; - if (embolden) FT_GlyphSlot_Embolden(slot); + if (embolden) Q_FT_GLYPHSLOT_EMBOLDEN(slot); int left = slot->metrics.horiBearingX; int right = slot->metrics.horiBearingX + slot->metrics.width; int top = slot->metrics.horiBearingY; @@ -940,7 +947,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph, Glyph return 0; FT_GlyphSlot slot = face->glyph; - if (embolden) FT_GlyphSlot_Embolden(slot); + if (embolden) Q_FT_GLYPHSLOT_EMBOLDEN(slot); FT_Library library = qt_getFreetype(); info.xOff = TRUNC(ROUND(slot->advance.x)); |