Lines Matching defs:cluster
146 auto& start = owner->cluster(fGhostClusterRange.start);
147 auto& end = owner->cluster(fGhostClusterRange.end - 1);
415 auto& start = fOwner->cluster(fClusterRange.start);
416 auto& end = fOwner->cluster(fClusterRange.end - 1);
509 auto prevCluster = fOwner->cluster(fClusterRange.start);
512 auto& cluster = fOwner->cluster(clusterIndex);
513 spacing += calculateSpacing(prevCluster, cluster);
514 spacingCluster(&cluster, spacing, prevSpacing);
515 prevCluster = cluster;
772 [&](const Cluster* cluster, ClusterIndex index, bool ghost) {
773 if (cluster->isWhitespaceBreak()) {
781 } else if (cluster->isIdeographic()) {
794 textLen += cluster->width();
820 this->iterateThroughClustersInGlyphsOrder(false, true, [&](const Cluster* cluster, ClusterIndex index, bool ghost) {
823 if (cluster->run().leftToRight()) {
824 this->shiftCluster(cluster, ghostShift, ghostShift);
829 if (cluster->isWhitespaceBreak()) {
837 } else if (cluster->isIdeographic()) {
848 this->shiftCluster(cluster, shift, prevShift);
851 if (!cluster->isWhitespaceBreak() && cluster->isIdeographic()) {
871 void TextLine::shiftCluster(const Cluster* cluster, SkScalar shift, SkScalar prevShift) {
873 auto& run = cluster->run();
874 auto start = cluster->startPos();
875 auto end = cluster->endPos();
892 void TextLine::spacingCluster(const Cluster* cluster, SkScalar spacing, SkScalar prevSpacing) {
893 auto& run = cluster->run();
894 auto start = cluster->startPos();
895 auto end = cluster->endPos();
913 auto& cluster = fOwner->cluster(clusterIndex);
914 if (cluster.isWordBreak()) {
954 // taking off cluster by cluster until the ellipsis fits
966 auto& cluster = fOwner->cluster(clusterIndex - 1);
968 if (lastRun != cluster.runIndex()) {
969 ellipsisRun = this->shapeEllipsis(ellipsis, &cluster);
971 lastRun = cluster.runIndex();
974 if (!cluster.isWordBreak()) {
982 if (!cluster.isHardBreak()) {
983 width -= cluster.width();
986 iterForWord = (wordCount != 1 && wordBreakType != WordBreakType::BREAK_ALL && !cluster.isWordBreak());
992 if (iterForWord && !cluster.isWordBreak()) {
993 width -= cluster.width();
1000 fEllipsisIndex = cluster.runIndex();
1007 fTextRangeReplacedByEllipsis = TextRange(cluster.textRange().end, fOwner->text().size());
1014 TextRange(cluster.textRange().end, cluster.textRange().end + ellipsis.size());
1015 fEllipsis->fClusterStart = cluster.textRange().end;
1017 fEllipsis->fClusterStart = cluster.textRange().start;
1019 fText.end = cluster.textRange().end;
1020 fTextIncludingNewlines.end = cluster.textRange().end;
1021 fTextExcludingSpaces.end = cluster.textRange().end;
1044 auto& cluster = fOwner->cluster(clusterIndex);
1046 if (lastRun != cluster.runIndex()) {
1047 ellipsisRun = this->shapeEllipsis(ellipsis, &cluster);
1049 lastRun = cluster.runIndex();
1053 width -= cluster.width();
1061 fEllipsisIndex = cluster.runIndex();
1068 fTextRangeReplacedByEllipsis = TextRange(0, cluster.textRange().start);
1072 fText.start = cluster.textRange().start;
1073 fTextIncludingNewlines.start = cluster.textRange().start;
1074 fTextExcludingSpaces.start = cluster.textRange().start;
1089 std::unique_ptr<Run> TextLine::shapeEllipsis(const SkString& ellipsis, const Cluster* cluster) {
1126 const Run& run = cluster->run();
1130 if (run.leftToRight() && cluster->textRange().end <= block.fRange.end) {
1133 } else if (!run.leftToRight() && cluster->textRange().start <= block.fRange.end) {
1270 // Update textRange by cluster edges (shift start up to the edge of the cluster)
1298 Cluster* start = &fOwner->cluster(fOwner->clusterIndex(textRange.start));
1299 Cluster* end = &fOwner->cluster(fOwner->clusterIndex(textRange.end - (textRange.width() == 0 ? 0 : 1)));
1320 // Calculate the clipping rectangle for the text with cluster edges
1322 // EOL (when we expect the last cluster clipped without any spaces)
1323 // Anything else (when we want the cluster width contain all the spaces -
1332 // TODO: This is where we get smart about selecting a part of a cluster
1401 directional_for_each(trailed, reversed != run.leftToRight(), [&](Cluster& cluster) {
1403 bool ghost = &cluster >= trimmed.end();
1407 if (!visitor(&cluster, index++, ghost)) {
1814 return (fGhostClusterRange.width() > 0 && fOwner->cluster(fGhostClusterRange.end - 1).isHardBreak()) ||
2279 if (!owner->cluster(clusterIndex).isWhitespaceBreak()) {
2336 prevRunIndex = owner->cluster(clusterIndex).runIndex();
2337 if (prevRunIndex != owner->cluster(range.start).runIndex()) {
2343 RunIndex runIndex = owner->cluster(clusterIndex).runIndex();
2381 RunIndex runIndex = owner->cluster(clusterIndex).runIndex();
2386 auto run = owner->cluster(clusterIndex).runOrNull();
2417 SkScalar endAdvance = fOwner->cluster(fGhostClusterRange.end - endWhitespaceCount - 1).width();
2423 if (fOwner->cluster(clusterIndex).isWhitespaceBreak()) {
2424 startWhitespaceAdvance += fOwner->cluster(clusterIndex).width();
2471 double characterWidth = fOwner->cluster(clusterIndex).width();
2495 offset += fOwner->cluster(clusterIndex).width();
2510 auto& cluster = fOwner->cluster(clusterIndex);
2511 offset += cluster.width();
2512 isHardBreak = cluster.isHardBreak();