Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1105)

Unified Diff: Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp

Issue 156893004: Handle zero width joiner in HarfBuzzShaper (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Exclude test on mac (as it does not yet use harfbuzz) Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/text/international/zerowidthjoiner-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
diff --git a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
index 8f4915a54c0bf6776e9c2654246d666bb0bb5363..1baf56deed3c783c2be46e9332326f501318587c 100644
--- a/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
+++ b/Source/platform/fonts/harfbuzz/HarfBuzzShaper.cpp
@@ -617,6 +617,7 @@ 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;
@@ -631,9 +632,12 @@ 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 };
« no previous file with comments | « LayoutTests/fast/text/international/zerowidthjoiner-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698