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

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

Issue 676343002: Use following font data and script for heading zero-width spaces while collecting candidate runs. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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/platform/linux/fast/text/international/bidi-neutral-run-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/shaping/HarfBuzzShaper.cpp
diff --git a/Source/platform/fonts/shaping/HarfBuzzShaper.cpp b/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
index 535e173526421151cab4f1cda52923fdc6747fea..760edf85b04ea5c5c8be51ae77a02d0bc7544011 100644
--- a/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
+++ b/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
@@ -623,6 +623,10 @@ static inline bool collectCandidateRuns(const UChar* normalizedBuffer,
if (!iterator.consume(character, clusterLength))
return false;
+ bool collectionForHeadingZWS = false;
+ if (Character::treatAsZeroWidthSpace(character))
+ collectionForHeadingZWS = true;
+
const SimpleFontData* nextFontData = font->glyphDataForCharacter(character, false, isSpaceNormalize).fontData;
UErrorCode errorCode = U_ZERO_ERROR;
UScriptCode nextScript = uscript_getScript(character, &errorCode);
@@ -651,8 +655,13 @@ static inline bool collectCandidateRuns(const UChar* normalizedBuffer,
return false;
if (lastCharacter == zeroWidthJoiner)
currentFontData = nextFontData;
- if ((nextFontData != currentFontData) || ((currentScript != nextScript) && (nextScript != USCRIPT_INHERITED) && (!uscript_hasScript(character, currentScript))))
- break;
+ if ((nextFontData != currentFontData) || ((currentScript != nextScript) && (nextScript != USCRIPT_INHERITED) && (!uscript_hasScript(character, currentScript)))) {
+ if (!collectionForHeadingZWS)
+ break;
+ currentFontData = nextFontData;
+ currentScript = nextScript;
+ collectionForHeadingZWS = false;
+ }
currentCharacterPosition = iterator.characters();
lastCharacter = character;
}
« no previous file with comments | « LayoutTests/platform/linux/fast/text/international/bidi-neutral-run-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698