Changeset 561 for trunk/src/gui/text/qtextengine_mac.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/text/qtextengine_mac.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 51 51 // ### zeroWidth and justification are missing here!!!!! 52 52 53 Q_ASSERT(num_glyphs <= length);54 53 Q_UNUSED(num_glyphs); 55 54 … … 559 558 si.glyph_data_offset = layoutData->used; 560 559 561 QFontEngine *font = fontEngine(si, &si.ascent, &si.descent );560 QFontEngine *font = fontEngine(si, &si.ascent, &si.descent, &si.leading); 562 561 if (font->type() != QFontEngine::Multi) { 563 562 shapeTextWithHarfbuzz(item); … … 596 595 } 597 596 598 while (true) { 599 ensureSpace(num_glyphs); 600 num_glyphs = layoutData->glyphLayout.numGlyphs - layoutData->used; 601 602 QGlyphLayout g = availableGlyphs(&si); 603 g.numGlyphs = num_glyphs; 604 unsigned short *log_clusters = logClusters(&si); 605 606 if (fe->stringToCMap(str, 607 len, 608 &g, 609 &num_glyphs, 610 flags, 611 log_clusters, 612 attributes())) { 613 614 heuristicSetGlyphAttributes(str, len, &g, log_clusters, num_glyphs); 615 break; 616 } 597 ensureSpace(num_glyphs); 598 num_glyphs = layoutData->glyphLayout.numGlyphs - layoutData->used; 599 600 QGlyphLayout g = availableGlyphs(&si); 601 g.numGlyphs = num_glyphs; 602 unsigned short *log_clusters = logClusters(&si); 603 604 bool stringToCMapFailed = false; 605 if (!fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, attributes())) { 606 ensureSpace(num_glyphs); 607 stringToCMapFailed = fe->stringToCMap(str, len, &g, &num_glyphs, flags, log_clusters, 608 attributes()); 617 609 } 618 610 619 si.num_glyphs = num_glyphs; 620 621 layoutData->used += si.num_glyphs; 622 623 QGlyphLayout g = shapedGlyphs(&si); 624 625 if (si.analysis.script == QUnicodeTables::Arabic) { 626 QVarLengthArray<QArabicProperties> props(len + 2); 627 QArabicProperties *properties = props.data(); 628 int f = si.position; 629 int l = len; 630 if (f > 0) { 631 --f; 632 ++l; 633 ++properties; 634 } 635 if (f + l < layoutData->string.length()) { 636 ++l; 637 } 638 qt_getArabicProperties((const unsigned short *)(layoutData->string.unicode()+f), l, props.data()); 639 640 unsigned short *log_clusters = logClusters(&si); 641 642 for (int i = 0; i < len; ++i) { 643 int gpos = log_clusters[i]; 644 g.attributes[gpos].justification = properties[i].justification; 611 if (!stringToCMapFailed) { 612 heuristicSetGlyphAttributes(str, len, &g, log_clusters, num_glyphs); 613 614 si.num_glyphs = num_glyphs; 615 616 layoutData->used += si.num_glyphs; 617 618 QGlyphLayout g = shapedGlyphs(&si); 619 620 if (si.analysis.script == QUnicodeTables::Arabic) { 621 QVarLengthArray<QArabicProperties> props(len + 2); 622 QArabicProperties *properties = props.data(); 623 int f = si.position; 624 int l = len; 625 if (f > 0) { 626 --f; 627 ++l; 628 ++properties; 629 } 630 if (f + l < layoutData->string.length()) { 631 ++l; 632 } 633 qt_getArabicProperties((const unsigned short *)(layoutData->string.unicode()+f), l, props.data()); 634 635 unsigned short *log_clusters = logClusters(&si); 636 637 for (int i = 0; i < len; ++i) { 638 int gpos = log_clusters[i]; 639 g.attributes[gpos].justification = properties[i].justification; 640 } 645 641 } 646 642 }
Note:
See TracChangeset
for help on using the changeset viewer.