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

Unified Diff: third_party/WebKit/Source/platform/fonts/Character.cpp

Issue 1525993005: Change CachingWordShapeIterator to delimit CJK characters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TestExpectations Created 5 years 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/Character.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/Character.cpp b/third_party/WebKit/Source/platform/fonts/Character.cpp
index a361f6645fbe31d488b08e087a27c4efa51cbf11..f795cd90f14a18203a591766ee12d1e25a8e6026 100644
--- a/third_party/WebKit/Source/platform/fonts/Character.cpp
+++ b/third_party/WebKit/Source/platform/fonts/Character.cpp
@@ -33,6 +33,7 @@
#include "wtf/StdLibExtras.h"
#include "wtf/text/StringBuilder.h"
#include <algorithm>
+#include <unicode/uscript.h>
using namespace WTF;
using namespace Unicode;
@@ -511,4 +512,11 @@ String Character::normalizeSpaces(const UChar* characters, unsigned length)
return normalizeSpacesInternal(characters, length);
}
+bool Character::isCommonOrInheritedScript(UChar32 character)
+{
+ UErrorCode status = U_ZERO_ERROR;
+ UScriptCode script = uscript_getScript(character, &status);
+ return U_SUCCESS(status) && (script == USCRIPT_COMMON || script == USCRIPT_INHERITED);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698