path: root/src/gui/text
diff options
authorTor Arne Vestbø <>2013-02-11 18:16:49 +0100
committerThe Qt Project <>2013-02-13 02:04:16 +0100
commitd1ee7189553e13337b198fe4ba66d79fb7a7f41d (patch)
tree2260be276c82026558086596f396f7fc0922106f /src/gui/text
parenta65157e5b7a2a1c2f018507f9d45f5b311cd387c (diff)
Add support for color glyphs (Emoji) on Mac OS X and iOS
A new glyph type is added to the glyph caches for ARGB bitmap glyphs, and the raster and OpenGL paint engines have been modified to support this glyph type for drawCachedGlyphs(). The CoreText font engine implements support for these glyphs through the CTFontDrawGlyphs API, since CGContextShowGlyphsWithAdvances does not handle color glyphs. Change-Id: Idad9ce75a911cae130d65aebe59142772a16fc12 Reviewed-by: Eskil Abrahamsen Blomfeldt <>
Diffstat (limited to 'src/gui/text')
2 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index b320dc0e66..1a7f2b7b4d 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -649,6 +649,13 @@ QImage QFontEngine::alphaRGBMapForGlyph(glyph_t glyph, QFixed /*subPixelPosition
return rgbMask;
+QImage QFontEngine::bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform&)
+ Q_UNUSED(subPixelPosition);
+ return QImage();
QFixed QFontEngine::subPixelPositionForX(QFixed x) const
if (m_subPixelPositionCount <= 1 || !supportsSubPixelPositions())
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 854f6fbbb6..a373c3d5f1 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -112,7 +112,8 @@ public:
Format_Render = Format_None,
- Format_A32
+ Format_A32,
+ Format_ARGB
enum ShaperFlag {
@@ -191,6 +192,7 @@ public:
virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t);
virtual QImage alphaMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t);
virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t);
+ virtual QImage bitmapForGlyph(glyph_t, QFixed subPixelPosition, const QTransform &t);
virtual QImage *lockedAlphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition,
GlyphFormat neededFormat,
const QTransform &t = QTransform(),