diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2014-03-05 09:30:58 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-08 14:01:17 +0100 |
commit | cfb4581feef2058a3b1b31b6bd4cfeef2c01339d (patch) | |
tree | 3d2312da80ce12410230142ed98e15502e737513 /src/gui | |
parent | 94d0f7c3d3b98b5b89bceffbf02a2114ca0f1339 (diff) |
QFontEngineQPA: Get rid of unused externalCMap
It seems to be a leftover after dropping the QPF1 font engine.
Change-Id: If8d3e1447fab9d042a85195d7bdb4d9811c37c6e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qfontengine_qpa.cpp | 21 | ||||
-rw-r--r-- | src/gui/text/qfontengine_qpa_p.h | 2 |
2 files changed, 6 insertions, 17 deletions
diff --git a/src/gui/text/qfontengine_qpa.cpp b/src/gui/text/qfontengine_qpa.cpp index b17a8eb2db..5a6021fe53 100644 --- a/src/gui/text/qfontengine_qpa.cpp +++ b/src/gui/text/qfontengine_qpa.cpp @@ -242,7 +242,7 @@ QFontEngineQPA::QFontEngineQPA(const QFontDef &def, const QByteArray &data) { fontDef = def; cache_cost = 100; - externalCMap = 0; + cmap = 0; cmapOffset = 0; cmapSize = 0; glyphMapOffset = 0; @@ -293,15 +293,8 @@ QFontEngineQPA::QFontEngineQPA(const QFontDef &def, const QByteArray &data) // get the real cmap if (cmapOffset) { - int tableSize = cmapSize; - const uchar *cmapPtr = getCMap(fontData + cmapOffset, tableSize, &symbol, &cmapSize); - if (cmapPtr) - cmapOffset = cmapPtr - fontData; - else - cmapOffset = 0; - } else if (externalCMap) { - int tableSize = cmapSize; - externalCMap = getCMap(externalCMap, tableSize, &symbol, &cmapSize); + cmap = QFontEngine::getCMap(fontData + cmapOffset, cmapSize, &symbol, &cmapSize); + cmapOffset = cmap ? cmap - fontData : 0; } // verify all the positions in the glyphMap @@ -323,7 +316,7 @@ QFontEngineQPA::QFontEngineQPA(const QFontDef &def, const QByteArray &data) #if defined(DEBUG_FONTENGINE) if (!isValid()) qDebug() << "fontData" << fontData << "dataSize" << dataSize - << "externalCMap" << externalCMap << "cmapOffset" << cmapOffset + << "cmap" << cmap << "cmapOffset" << cmapOffset << "glyphMapOffset" << glyphMapOffset << "glyphDataOffset" << glyphDataOffset << "fd" << fd << "glyphDataSize" << glyphDataSize; #endif @@ -347,8 +340,6 @@ bool QFontEngineQPA::getSfntTableData(uint tag, uchar *buffer, uint *length) con glyph_t QFontEngineQPA::glyphIndex(uint ucs4) const { - const uchar *cmap = externalCMap ? externalCMap : (fontData + cmapOffset); - glyph_t glyph = getTrueTypeGlyphIndex(cmap, ucs4); if (glyph == 0 && symbol && ucs4 < 0x100) glyph = getTrueTypeGlyphIndex(cmap, ucs4 + 0xf000); @@ -370,8 +361,6 @@ bool QFontEngineQPA::stringToCMap(const QChar *str, int len, QGlyphLayout *glyph QSet<QChar> seenGlyphs; #endif - const uchar *cmap = externalCMap ? externalCMap : (fontData + cmapOffset); - int glyph_pos = 0; if (symbol) { for (int i = 0; i < len; ++i) { @@ -517,7 +506,7 @@ QFixed QFontEngineQPA::lineThickness() const bool QFontEngineQPA::isValid() const { - return fontData && dataSize && (cmapOffset || externalCMap) + return fontData && dataSize && cmapOffset && glyphMapOffset && glyphDataOffset && glyphDataSize > 0; } diff --git a/src/gui/text/qfontengine_qpa_p.h b/src/gui/text/qfontengine_qpa_p.h index 35bf9ad74c..e84b067c68 100644 --- a/src/gui/text/qfontengine_qpa_p.h +++ b/src/gui/text/qfontengine_qpa_p.h @@ -195,7 +195,7 @@ private: const uchar *fontData; int dataSize; - const uchar *externalCMap; + const uchar *cmap; quint32 cmapOffset; int cmapSize; quint32 glyphMapOffset; |