equal
deleted
inserted
replaced
1040 void QTextEngine::shapeTextWithCE(int item) const |
1040 void QTextEngine::shapeTextWithCE(int item) const |
1041 { |
1041 { |
1042 QScriptItem &si = layoutData->items[item]; |
1042 QScriptItem &si = layoutData->items[item]; |
1043 si.glyph_data_offset = layoutData->used; |
1043 si.glyph_data_offset = layoutData->used; |
1044 |
1044 |
1045 QFontEngine *fe = fontEngine(si, &si.ascent, &si.descent); |
1045 QFontEngine *fe = fontEngine(si, &si.ascent, &si.descent, &si.leading); |
1046 |
1046 |
1047 QTextEngine::ShaperFlags flags; |
1047 QTextEngine::ShaperFlags flags; |
1048 if (si.analysis.bidiLevel % 2) |
1048 if (si.analysis.bidiLevel % 2) |
1049 flags |= RightToLeft; |
1049 flags |= RightToLeft; |
1050 if (option.useDesignMetrics()) |
1050 if (option.useDesignMetrics()) |
1117 |
1117 |
1118 QScriptItem &si = layoutData->items[item]; |
1118 QScriptItem &si = layoutData->items[item]; |
1119 |
1119 |
1120 si.glyph_data_offset = layoutData->used; |
1120 si.glyph_data_offset = layoutData->used; |
1121 |
1121 |
1122 QFontEngine *font = fontEngine(si, &si.ascent, &si.descent); |
1122 QFontEngine *font = fontEngine(si, &si.ascent, &si.descent, &si.leading); |
1123 |
1123 |
1124 bool kerningEnabled = this->font(si).d->kerning; |
1124 bool kerningEnabled = this->font(si).d->kerning; |
1125 |
1125 |
1126 HB_ShaperItem entire_shaper_item; |
1126 HB_ShaperItem entire_shaper_item; |
1127 entire_shaper_item.kerning_applied = false; |
1127 entire_shaper_item.kerning_applied = false; |
1348 QTextFormat format = formats()->format(formatIndex(&layoutData->items[item])); |
1348 QTextFormat format = formats()->format(formatIndex(&layoutData->items[item])); |
1349 docLayout()->resizeInlineObject(QTextInlineObject(item, const_cast<QTextEngine *>(this)), |
1349 docLayout()->resizeInlineObject(QTextInlineObject(item, const_cast<QTextEngine *>(this)), |
1350 layoutData->items[item].position + block.position(), format); |
1350 layoutData->items[item].position + block.position(), format); |
1351 } |
1351 } |
1352 } else if (layoutData->items[item].analysis.flags == QScriptAnalysis::Tab) { |
1352 } else if (layoutData->items[item].analysis.flags == QScriptAnalysis::Tab) { |
1353 // set up at least the ascent/descent of the script item for the tab |
1353 // set up at least the ascent/descent/leading of the script item for the tab |
1354 fontEngine(layoutData->items[item], &layoutData->items[item].ascent, &layoutData->items[item].descent); |
1354 fontEngine(layoutData->items[item], |
|
1355 &layoutData->items[item].ascent, |
|
1356 &layoutData->items[item].descent, |
|
1357 &layoutData->items[item].leading); |
1355 } else { |
1358 } else { |
1356 shapeText(item); |
1359 shapeText(item); |
1357 } |
1360 } |
1358 } |
1361 } |
1359 |
1362 |
1735 font = font.d->smallCapsFont(); |
1738 font = font.d->smallCapsFont(); |
1736 |
1739 |
1737 return font; |
1740 return font; |
1738 } |
1741 } |
1739 |
1742 |
1740 QFontEngine *QTextEngine::fontEngine(const QScriptItem &si, QFixed *ascent, QFixed *descent) const |
1743 QFontEngine *QTextEngine::fontEngine(const QScriptItem &si, QFixed *ascent, QFixed *descent, QFixed *leading) const |
1741 { |
1744 { |
1742 QFontEngine *engine = 0; |
1745 QFontEngine *engine = 0; |
1743 QFontEngine *scaledEngine = 0; |
1746 QFontEngine *scaledEngine = 0; |
1744 int script = si.analysis.script; |
1747 int script = si.analysis.script; |
1745 |
1748 |
1775 } |
1778 } |
1776 |
1779 |
1777 if (ascent) { |
1780 if (ascent) { |
1778 *ascent = engine->ascent(); |
1781 *ascent = engine->ascent(); |
1779 *descent = engine->descent(); |
1782 *descent = engine->descent(); |
|
1783 *leading = engine->leading(); |
1780 } |
1784 } |
1781 |
1785 |
1782 if (scaledEngine) |
1786 if (scaledEngine) |
1783 return scaledEngine; |
1787 return scaledEngine; |
1784 return engine; |
1788 return engine; |
2007 e = f.d->engineForScript(QUnicodeTables::Common); |
2011 e = f.d->engineForScript(QUnicodeTables::Common); |
2008 } else { |
2012 } else { |
2009 e = eng->fnt.d->engineForScript(QUnicodeTables::Common); |
2013 e = eng->fnt.d->engineForScript(QUnicodeTables::Common); |
2010 } |
2014 } |
2011 |
2015 |
2012 ascent = qMax(ascent, e->ascent()); |
2016 QFixed other_ascent = e->ascent(); |
2013 descent = qMax(descent, e->descent()); |
2017 QFixed other_descent = e->descent(); |
|
2018 QFixed other_leading = e->leading(); |
|
2019 leading = qMax(leading + ascent, other_leading + other_ascent) - qMax(ascent, other_ascent); |
|
2020 ascent = qMax(ascent, other_ascent); |
|
2021 descent = qMax(descent, other_descent); |
2014 } |
2022 } |
2015 |
2023 |
2016 QTextEngine::LayoutData::LayoutData() |
2024 QTextEngine::LayoutData::LayoutData() |
2017 { |
2025 { |
2018 memory = 0; |
2026 memory = 0; |