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

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

Issue 1964773002: Render Unicode control characters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.cpp b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
index d13dd370db55c76c8bc431ec55280846e22229c7..56f39ca197c1c7ef0acf7dc1b8d8de724b402b81 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
+++ b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.cpp
@@ -32,6 +32,7 @@
#include "platform/fonts/shaping/HarfBuzzShaper.h"
#include "platform/Logging.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/fonts/Font.h"
#include "platform/fonts/FontFallbackIterator.h"
#include "platform/fonts/GlyphBuffer.h"
@@ -98,12 +99,16 @@ static void normalizeCharacters(const TextRun& run, unsigned length, UChar* dest
UChar32 character;
U16_NEXT(source, position, length, character);
// Don't normalize tabs as they are not treated as spaces for word-end.
- if (run.normalizeSpace() && Character::isNormalizedCanvasSpaceCharacter(character))
+ if (run.normalizeSpace() && Character::isNormalizedCanvasSpaceCharacter(character)) {
character = spaceCharacter;
- else if (Character::treatAsSpace(character) && character != noBreakSpaceCharacter)
+ } else if (Character::treatAsSpace(character) && character != noBreakSpaceCharacter) {
character = spaceCharacter;
- else if (Character::treatAsZeroWidthSpaceInComplexScript(character))
+ } else if (!RuntimeEnabledFeatures::renderUnicodeControlCharactersEnabled()
+ && Character::legacyTreatAsZeroWidthSpaceInComplexScript(character)) {
character = zeroWidthSpaceCharacter;
+ } else if (Character::treatAsZeroWidthSpaceInComplexScript(character)) {
+ character = zeroWidthSpaceCharacter;
+ }
U16_APPEND(destination, *destinationLength, length, character, error);
ASSERT_UNUSED(error, !error);

Powered by Google App Engine
This is Rietveld 408576698