diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2012-07-09 17:08:54 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-10 03:23:46 +0200 |
commit | 5cf93c435228af9527f42aea32585cb156d78826 (patch) | |
tree | 22a056b784adfb5b1cbb88583aca6498b3385115 /src | |
parent | 98c1eb1750498cdff9d3b26658e5e5be9c026c92 (diff) |
Fix the UCS-2 surrogates handling in Q*FontEndine*::stringToCmap()
by making sure QGlyphLayout's numGlyphs member is properly initialized
if the string-to-glyphs lookup was successful
(tip: a surrogate pair produces a single glyph index).
Change-Id: I01953f3b6281d79e1a214bfab0424e796d94769a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src')
3 files changed, 4 insertions, 0 deletions
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm index b07d59d3fe..92eaebb7b9 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm @@ -211,6 +211,8 @@ bool QCoreTextFontEngine::stringToCMap(const QChar *str, int len, QGlyphLayout * } *nglyphs = glyph_pos; + glyphs->numGlyphs = glyph_pos; + if (flags & GlyphIndicesOnly) return true; diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index b3bba55e97..d7f48e59c5 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -363,6 +363,7 @@ bool QWindowsFontEngine::stringToCMap(const QChar *str, int len, QGlyphLayout *g return false; } + glyphs->numGlyphs = *nglyphs; *nglyphs = getGlyphIndexes(str, len, glyphs, flags & RightToLeft); if (!(flags & GlyphIndicesOnly)) diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp index 1f7c4f485b..3490ebfc80 100644 --- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp +++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp @@ -330,6 +330,7 @@ bool QWindowsFontEngineDirectWrite::stringToCMap(const QChar *str, int len, QGly glyphs->glyphs[i] = glyphIndices[i]; *nglyphs = len; + glyphs->numGlyphs = len; if (!(flags & GlyphIndicesOnly)) recalcAdvances(glyphs, 0); |