From 94d0f7c3d3b98b5b89bceffbf02a2114ca0f1339 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Wed, 5 Mar 2014 09:34:57 +0200 Subject: [PATCH] Make QFontEngineQPA report the TT 'cmap' table support The QPF2 CMap is identical to the TrueType CMap table format. Change-Id: I8c34d7c6a5942375538f3b8cb71d5a808b4fb400 Reviewed-by: Lars Knoll --- src/gui/text/qfontengine_qpa.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gui/text/qfontengine_qpa.cpp b/src/gui/text/qfontengine_qpa.cpp index 90c9cbb1bb..b17a8eb2db 100644 --- a/src/gui/text/qfontengine_qpa.cpp +++ b/src/gui/text/qfontengine_qpa.cpp @@ -335,10 +335,14 @@ QFontEngineQPA::~QFontEngineQPA() bool QFontEngineQPA::getSfntTableData(uint tag, uchar *buffer, uint *length) const { - Q_UNUSED(tag); - Q_UNUSED(buffer); - *length = 0; - return false; + if (tag != MAKE_TAG('c', 'm', 'a', 'p') || !cmap) + return false; + + if (buffer && int(*length) >= cmapSize) + memcpy(buffer, cmap, cmapSize); + *length = cmapSize; + Q_ASSERT(int(*length) > 0); + return true; } glyph_t QFontEngineQPA::glyphIndex(uint ucs4) const