| 488 | |
| 489 | bool TextLayoutBuilder::shouldProcessEllipsisAfterLineHeightUpdate() const { |
| 490 | return _position.y + _currentLineMetrics.height() > _maxSize.height; |
| 491 | } |
| 492 | |
| 493 | void TextLayoutBuilder::processUnidirectionalRun(const TextLayoutSpecs& specs, |
| 494 | const Ref<Font>& originalFont, |
| 495 | const Character* characters, |
| 496 | size_t charactersLength, |
| 497 | TextScript script, |
| 498 | bool isRTL) { |
| 499 | if (_reachedMaxLines) { |
| 500 | return; |
| 501 | } |
| 502 | |
| 503 | auto shapeResult = shape(specs, characters, charactersLength, script, isRTL); |
| 504 | if (specs.replacementSize) { |
| 505 | auto glyphStartIndex = shapeResult.glyphsStart - _glyphs.data(); |
| 506 | auto glyphEndIndex = shapeResult.glyphsEnd - _glyphs.data(); |
| 507 | for (auto glyphIndex = glyphStartIndex; glyphIndex < glyphEndIndex; glyphIndex++) { |
| 508 | _glyphs[glyphIndex].advanceX = glyphIndex == glyphStartIndex ? specs.replacementSize->width : 0.0f; |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | const auto* shapedGlyphIt = shapeResult.glyphsStart; |
| 513 | const auto& fontMetrics = specs.font->metrics(); |
| 514 | const auto* backgroundStyle = getBackgroundStyle(specs.backgroundStyleIndex); |
| 515 | const auto backgroundHorizontalPadding = |
| 516 | backgroundStyle != nullptr ? backgroundStyle->horizontalPadding() : static_cast<Scalar>(0); |
| 517 | LineMetrics lineMetrics; |
| 518 | |
| 519 | // Resolve all the segments of our blob. |
| 520 | // We emit one segment per line. |
| 521 | |
| 522 | while (shapedGlyphIt < shapeResult.glyphsEnd && !_reachedMaxLines) { |
nothing calls this directly
no test coverage detected