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

Unified Diff: Source/platform/fonts/UTF16TextIterator.cpp

Issue 1227883003: Handle U+3099/309A Kana Voiced Sound Marks in complex path (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Mac fails with 1px diff Created 5 years, 5 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: Source/platform/fonts/UTF16TextIterator.cpp
diff --git a/Source/platform/fonts/UTF16TextIterator.cpp b/Source/platform/fonts/UTF16TextIterator.cpp
index c86c3cf5e4a5df2e193bd83eb68d13d9303b5fcf..1448a49fac8c9a5a78c1729c04814aec5563583c 100644
--- a/Source/platform/fonts/UTF16TextIterator.cpp
+++ b/Source/platform/fonts/UTF16TextIterator.cpp
@@ -48,19 +48,8 @@ UTF16TextIterator::UTF16TextIterator(const UChar* characters, int currentCharact
{
}
-bool UTF16TextIterator::consumeSlowCase(UChar32& character)
+bool UTF16TextIterator::consumeSurrogatePair(UChar32& character)
{
- if (character <= 0x30FE) {
- // Deal with Hiragana and Katakana voiced and semi-voiced syllables.
- // Normalize into composed form, and then look for glyph with base +
- // combined mark.
- if (UChar32 normalized = normalizeVoicingMarks()) {
- character = normalized;
- m_currentGlyphLength = 2;
- }
- return true;
- }
-
if (!U16_IS_SURROGATE(character))
return true;
@@ -100,25 +89,4 @@ void UTF16TextIterator::consumeMultipleUChar()
m_currentGlyphLength = markLength;
}
-UChar32 UTF16TextIterator::normalizeVoicingMarks()
-{
- // According to http://www.unicode.org/Public/UNIDATA/UCD.html#Canonical_Combining_Class_Values
- static const uint8_t hiraganaKatakanaVoicingMarksCombiningClass = 8;
-
- if (m_offset + 1 >= m_endOffset)
- return 0;
-
- if (combiningClass(m_characters[1]) == hiraganaKatakanaVoicingMarksCombiningClass) {
- // Normalize into composed form using 3.2 rules.
- UChar normalizedCharacters[2] = { 0, 0 };
- UErrorCode uStatus = U_ZERO_ERROR;
- int32_t resultLength = unorm_normalize(m_characters, 2, UNORM_NFC,
- UNORM_UNICODE_3_2, &normalizedCharacters[0], 2, &uStatus);
- if (resultLength == 1 && !uStatus)
- return normalizedCharacters[0];
- }
-
- return 0;
-}
-
}
« Source/platform/fonts/UTF16TextIterator.h ('K') | « Source/platform/fonts/UTF16TextIterator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698