From 3fb6014ce71febe1cb18ceaff16840bb4aea7deb Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Sat, 7 Mar 2015 08:01:42 +0400 Subject: [QFontEngineFT] Guarantee correct metrics for alphamap and its bounding box ...for both cached and non-cached modes, by disabling hinting for transformed glyphs in loadGlyphFor(). Change-Id: I13766a653ebd72cbed0f5c38ca3536d042aed762 Reviewed-by: Lars Knoll --- src/gui/painting/qtextureglyphcache.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/gui/painting/qtextureglyphcache.cpp') diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 881fae9afc..4c879cf05d 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -123,17 +123,6 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const if (listItemCoordinates.contains(GlyphAndSubPixelPosition(glyph, subPixelPosition))) continue; - // This is a rather crude hack, but it works. - // The FreeType font engine is not capable of getting precise metrics for the alphamap - // without first rasterizing the glyph. If we force the glyph to be rasterized before - // we ask for the alphaMapBoundingBox(), the glyph will be loaded, rasterized and its - // proper metrics will be cached and used later. - if (fontEngine->hasInternalCaching()) { - QImage *locked = fontEngine->lockedAlphaMapForGlyph(glyph, subPixelPosition, m_format); - if (locked && !locked->isNull()) - fontEngine->unlockAlphaMapForGlyph(); - } - glyph_metrics_t metrics = fontEngine->alphaMapBoundingBox(glyph, subPixelPosition, m_transform, m_format); #ifdef CACHE_DEBUG -- cgit v1.2.3