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

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: w/Test changes Created 4 years, 6 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 4617630335f200083cecccf9d0031b9d11278834..358392ea9cc56bce9d0828332094450cfa026dd9 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"
@@ -99,12 +100,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);
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/FontFallbackIterator.cpp ('k') | third_party/WebKit/Source/platform/text/Character.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698