Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b294435b authored by Raph Levien's avatar Raph Levien
Browse files

Make Arabic script runs longer (for performance) - bug 6426451.

This change avoids selecting the incorrect font for drawing characters
when the first character in a run is a space.

Change-Id: Ibc672560d364b8de8c3e21de1c738c6dc5639395
parent 8ccfbddd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -849,7 +849,11 @@ size_t TextLayoutShaper::shapeFontRun(const SkPaint* paint, bool isRTL) {
    case HB_Script_Tamil:
    case HB_Script_Thai:{
        const uint16_t* text16 = (const uint16_t*)(mShaperItem.string + mShaperItem.item.pos);
        const uint16_t* text16End = text16 + mShaperItem.item.length;
        SkUnichar firstUnichar = SkUTF16_NextUnichar(&text16);
        while (firstUnichar == ' ' && text16 < text16End) {
            firstUnichar = SkUTF16_NextUnichar(&text16);
        }
        baseGlyphCount = paint->getBaseGlyphCount(firstUnichar);
        break;
    }