1122 QFontEngine *font = fontEngine(si, &si.ascent, &si.descent, &si.leading); |
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 qMemSet(&entire_shaper_item, 0, sizeof(entire_shaper_item)); |
1128 entire_shaper_item.string = reinterpret_cast<const HB_UChar16 *>(layoutData->string.constData()); |
1128 entire_shaper_item.string = reinterpret_cast<const HB_UChar16 *>(layoutData->string.constData()); |
1129 entire_shaper_item.stringLength = layoutData->string.length(); |
1129 entire_shaper_item.stringLength = layoutData->string.length(); |
1130 entire_shaper_item.item.script = (HB_Script)si.analysis.script; |
1130 entire_shaper_item.item.script = (HB_Script)si.analysis.script; |
1131 entire_shaper_item.item.pos = si.position; |
1131 entire_shaper_item.item.pos = si.position; |
1132 entire_shaper_item.item.length = length(item); |
1132 entire_shaper_item.item.length = length(item); |
1133 entire_shaper_item.item.bidiLevel = si.analysis.bidiLevel; |
1133 entire_shaper_item.item.bidiLevel = si.analysis.bidiLevel; |
1134 entire_shaper_item.glyphIndicesPresent = false; |
|
1135 |
1134 |
1136 HB_UChar16 upperCased[256]; // XXX what about making this 4096, so we don't have to extend it ever. |
1135 HB_UChar16 upperCased[256]; // XXX what about making this 4096, so we don't have to extend it ever. |
1137 if (si.analysis.flags == QScriptAnalysis::SmallCaps || si.analysis.flags == QScriptAnalysis::Uppercase |
1136 if (si.analysis.flags == QScriptAnalysis::SmallCaps || si.analysis.flags == QScriptAnalysis::Uppercase |
1138 || si.analysis.flags == QScriptAnalysis::Lowercase) { |
1137 || si.analysis.flags == QScriptAnalysis::Lowercase) { |
1139 HB_UChar16 *uc = upperCased; |
1138 HB_UChar16 *uc = upperCased; |
2465 void QTextEngine::splitItem(int item, int pos) const |
2464 void QTextEngine::splitItem(int item, int pos) const |
2466 { |
2465 { |
2467 if (pos <= 0) |
2466 if (pos <= 0) |
2468 return; |
2467 return; |
2469 |
2468 |
2470 layoutData->items.insert(item + 1, QScriptItem(layoutData->items[item])); |
2469 layoutData->items.insert(item + 1, layoutData->items[item]); |
2471 QScriptItem &oldItem = layoutData->items[item]; |
2470 QScriptItem &oldItem = layoutData->items[item]; |
2472 QScriptItem &newItem = layoutData->items[item+1]; |
2471 QScriptItem &newItem = layoutData->items[item+1]; |
2473 newItem.position += pos; |
2472 newItem.position += pos; |
2474 |
2473 |
2475 if (oldItem.num_glyphs) { |
2474 if (oldItem.num_glyphs) { |
2608 } |
2607 } |
2609 specialData->resolvedFormatIndices = indices; |
2608 specialData->resolvedFormatIndices = indices; |
2610 } |
2609 } |
2611 |
2610 |
2612 QStackTextEngine::QStackTextEngine(const QString &string, const QFont &f) |
2611 QStackTextEngine::QStackTextEngine(const QString &string, const QFont &f) |
2613 : _layoutData(string, _memory, MemSize) |
2612 : QTextEngine(string, f), |
2614 { |
2613 _layoutData(string, _memory, MemSize) |
2615 fnt = f; |
2614 { |
2616 text = string; |
|
2617 stackEngine = true; |
2615 stackEngine = true; |
2618 layoutData = &_layoutData; |
2616 layoutData = &_layoutData; |
2619 } |
2617 } |
2620 |
2618 |
2621 QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format) |
2619 QTextItemInt::QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format) |