summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-11-19 00:00:10 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-11-19 00:00:10 (GMT)
commit2b417c9b7c878bbf49e685509b0e4b411f7b00ba (patch)
treec6ee5716f1ca5529ddbadbca6e0b92e25babd881 /src
parent5ed8a8f0a6ff2dbb4d0836d58d3916a04cca8d4b (diff)
parentfdd3fca40a3fc31762b637952884903816b50786 (diff)
downloadQt-2b417c9b7c878bbf49e685509b0e4b411f7b00ba.zip
Qt-2b417c9b7c878bbf49e685509b0e4b411f7b00ba.tar.gz
Qt-2b417c9b7c878bbf49e685509b0e4b411f7b00ba.tar.bz2
Merge branch 'master-upstream' into master-water
Diffstat (limited to 'src')
-rw-r--r--src/gui/text/qfontengine_mac.mm18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index 51e18ec..3c6f3b2 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -252,6 +252,11 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay
continue;
Q_ASSERT((CTRunGetStatus(run) & kCTRunStatusRightToLeft) == rtl);
+ CFRange stringRange = CTRunGetStringRange(run);
+ UniChar endGlyph = CFStringGetCharacterAtIndex(cfstring, stringRange.location + stringRange.length - 1);
+ bool endWithPDF = QChar::direction(endGlyph) == QChar::DirPDF;
+ if (endWithPDF)
+ glyphCount++;
if (!outOBounds && outGlyphs + glyphCount - initialGlyph > *nglyphs) {
outOBounds = true;
@@ -264,6 +269,9 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay
CTFontRef runFont = static_cast<CTFontRef>(CFDictionaryGetValue(runAttribs, NSFontAttributeName));
const uint fontIndex = (fontIndexForFont(runFont) << 24);
//NSLog(@"Run Font Name = %@", CTFontCopyFamilyName(runFont));
+ if (endWithPDF)
+ glyphCount--;
+
QVarLengthArray<CGGlyph, 512> cgglyphs(0);
const CGGlyph *tmpGlyphs = CTRunGetGlyphsPtr(run);
if (!tmpGlyphs) {
@@ -331,6 +339,16 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay
(fontDef.styleStrategy & QFont::ForceIntegerMetrics)
? QFixed::fromReal(lastGlyphAdvance.width).round()
: QFixed::fromReal(lastGlyphAdvance.width);
+
+ if (endWithPDF) {
+ logClusters[stringRange.location + stringRange.length - 1] = glyphCount;
+ outGlyphs[glyphCount] = 0xFFFF;
+ outAdvances_x[glyphCount] = 0;
+ outAdvances_y[glyphCount] = 0;
+ outAttributes[glyphCount].clusterStart = true;
+ outAttributes[glyphCount].dontPrint = true;
+ glyphCount++;
+ }
}
outGlyphs += glyphCount;
outAttributes += glyphCount;