diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-17 13:30:56 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-11-17 13:30:56 (GMT) |
commit | ed32a5262fcff59771628ed22425669f00784cb2 (patch) | |
tree | ccd58fc514bf032d137b355aa5878fb59a7a49de /src | |
parent | 2829f215ffa2aff64bd5aa60f223653b7c38c2e9 (diff) | |
parent | e45c4387ae16627d61e30a58ae901d888d375aa7 (diff) | |
download | Qt-ed32a5262fcff59771628ed22425669f00784cb2.zip Qt-ed32a5262fcff59771628ed22425669f00784cb2.tar.gz Qt-ed32a5262fcff59771628ed22425669f00784cb2.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Fix bidi PDF mark support in Core Text shaper
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qfontengine_mac.mm | 18 |
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; |