43 if (fCurrentGlyphIndex >= fGlyphCount) {
44 return Cluster{
nullptr, 0, 0, 0};
46 if (!fClusters || !fUtf8Text) {
47 return Cluster{
nullptr, 0, fCurrentGlyphIndex++, 1};
49 uint32_t clusterGlyphIndex = fCurrentGlyphIndex;
50 uint32_t cluster = fClusters[clusterGlyphIndex];
53 }
while (fCurrentGlyphIndex < fGlyphCount && cluster == fClusters[fCurrentGlyphIndex]);
54 uint32_t clusterGlyphCount = fCurrentGlyphIndex - clusterGlyphIndex;
55 uint32_t clusterEnd = fTextByteLength;
56 for (
unsigned i = 0; i < fGlyphCount; ++i) {
57 uint32_t c = fClusters[i];
58 if (c > cluster && c < clusterEnd) {
62 uint32_t clusterLen = clusterEnd - cluster;
63 return Cluster{fUtf8Text + cluster, clusterLen, clusterGlyphIndex, clusterGlyphCount};