| Index: Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
|
| diff --git a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
|
| index 10abf5082fc7759397880cb6558c57d7499d309f..2ab156bca6d0e2bce142b9b51d23395077e9d6e9 100644
|
| --- a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
|
| +++ b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
|
| @@ -636,7 +636,6 @@ static inline bool collectCandidateRuns(const UChar* normalizedBuffer,
|
| const SimpleFontData* currentFontData = nextFontData;
|
| UScriptCode currentScript = nextScript;
|
|
|
| - UChar32 lastCharacter = character;
|
| for (iterator.advance(clusterLength); iterator.consume(character, clusterLength); iterator.advance(clusterLength)) {
|
| if (Character::treatAsZeroWidthSpace(character))
|
| continue;
|
| @@ -651,12 +650,9 @@ static inline bool collectCandidateRuns(const UChar* normalizedBuffer,
|
| nextScript = uscript_getScript(character, &errorCode);
|
| if (U_FAILURE(errorCode))
|
| return false;
|
| - if (lastCharacter == zeroWidthJoiner)
|
| - currentFontData = nextFontData;
|
| if ((nextFontData != currentFontData) || ((currentScript != nextScript) && (nextScript != USCRIPT_INHERITED) && (!uscript_hasScript(character, currentScript))))
|
| break;
|
| currentCharacterPosition = iterator.characters();
|
| - lastCharacter = character;
|
| }
|
|
|
| CandidateRun run = { character, startIndexOfCurrentRun, iterator.currentCharacter(), currentFontData, currentScript };
|
| @@ -861,11 +857,13 @@ bool HarfBuzzShaper::shapeHarfBuzzRuns()
|
| hb_buffer_add_utf16(harfBuzzBuffer.get(), &preContext, 1, 1, 0);
|
|
|
| if (fontDescription.variant() == FontVariantSmallCaps && u_islower(m_normalizedBuffer[currentRun->startIndex()])) {
|
| - String upperText = String(m_normalizedBuffer.get() + currentRun->startIndex(), currentRun->numCharacters()).upper();
|
| + String upperText = String(m_normalizedBuffer.get(), m_normalizedBufferLength).upper();
|
| ASSERT(!upperText.is8Bit()); // m_normalizedBuffer is 16 bit, therefore upperText is 16 bit, even after we call makeUpper().
|
| - hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(upperText.characters16()), currentRun->numCharacters(), 0, currentRun->numCharacters());
|
| + hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(upperText.characters16()), currentRun->startIndex(), currentRun->startIndex(), 0);
|
| + hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(upperText.characters16() + currentRun->startIndex()), m_normalizedBufferLength - currentRun->startIndex(), 0, currentRun->numCharacters());
|
| } else {
|
| - hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(m_normalizedBuffer.get() + currentRun->startIndex()), currentRun->numCharacters(), 0, currentRun->numCharacters());
|
| + hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(m_normalizedBuffer.get()), currentRun->startIndex(), currentRun->startIndex(), 0);
|
| + hb_buffer_add_utf16(harfBuzzBuffer.get(), toUint16(m_normalizedBuffer.get() + currentRun->startIndex()), m_normalizedBufferLength - currentRun->startIndex(), 0, currentRun->numCharacters());
|
| }
|
|
|
| if (fontDescription.orientation() == Vertical)
|
|
|