| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/fonts/shaping/RunSegmenter.h" | 5 #include "platform/fonts/shaping/RunSegmenter.h" |
| 6 | 6 |
| 7 #include "platform/Logging.h" | 7 #include "platform/Logging.h" |
| 8 #include "platform/fonts/OrientationIterator.h" | 8 #include "platform/fonts/OrientationIterator.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "wtf/Assertions.h" | 10 #include "wtf/Assertions.h" |
| 11 #include "wtf/Vector.h" | 11 #include "wtf/Vector.h" |
| 12 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 | 17 |
| 18 struct SegmenterTestRun { | 18 struct SegmenterTestRun { |
| 19 std::string text; | 19 std::string text; |
| 20 UScriptCode script; | 20 UScriptCode script; |
| 21 OrientationIterator::RenderOrientation renderOrientation; | 21 OrientationIterator::RenderOrientation renderOrientation; |
| 22 SmallCapsIterator::SmallCapsBehavior smallCapsBehavior; | 22 SmallCapsIterator::SmallCapsBehavior smallCapsBehavior; |
| 23 FontFallbackPriority fontFallbackPriority; |
| 23 }; | 24 }; |
| 24 | 25 |
| 25 struct SegmenterExpectedRun { | 26 struct SegmenterExpectedRun { |
| 26 unsigned start; | 27 unsigned start; |
| 27 unsigned limit; | 28 unsigned limit; |
| 28 UScriptCode script; | 29 UScriptCode script; |
| 29 OrientationIterator::RenderOrientation renderOrientation; | 30 OrientationIterator::RenderOrientation renderOrientation; |
| 30 SmallCapsIterator::SmallCapsBehavior smallCapsBehavior; | 31 SmallCapsIterator::SmallCapsBehavior smallCapsBehavior; |
| 32 FontFallbackPriority fontFallbackPriority; |
| 31 | 33 |
| 32 SegmenterExpectedRun(unsigned theStart, | 34 SegmenterExpectedRun(unsigned theStart, |
| 33 unsigned theLimit, | 35 unsigned theLimit, |
| 34 UScriptCode theScript, | 36 UScriptCode theScript, |
| 35 OrientationIterator::RenderOrientation theRenderOrientation, | 37 OrientationIterator::RenderOrientation theRenderOrientation, |
| 36 SmallCapsIterator::SmallCapsBehavior theSmallCapsBehavior) | 38 SmallCapsIterator::SmallCapsBehavior theSmallCapsBehavior, |
| 39 FontFallbackPriority theFontFallbackPriority) |
| 37 : start(theStart) | 40 : start(theStart) |
| 38 , limit(theLimit) | 41 , limit(theLimit) |
| 39 , script(theScript) | 42 , script(theScript) |
| 40 , renderOrientation(theRenderOrientation) | 43 , renderOrientation(theRenderOrientation) |
| 41 , smallCapsBehavior(theSmallCapsBehavior) | 44 , smallCapsBehavior(theSmallCapsBehavior) |
| 45 , fontFallbackPriority(theFontFallbackPriority) |
| 42 { | 46 { |
| 43 } | 47 } |
| 44 }; | 48 }; |
| 45 | 49 |
| 46 class RunSegmenterTest : public testing::Test { | 50 class RunSegmenterTest : public testing::Test { |
| 47 protected: | 51 protected: |
| 48 #if !LOG_DISABLED | 52 #if !LOG_DISABLED |
| 49 static void SetUpTestCase() | 53 static void SetUpTestCase() |
| 50 { | 54 { |
| 51 LogFonts = { WTFLogChannelOn }; | 55 LogFonts = { WTFLogChannelOn }; |
| 52 } | 56 } |
| 53 #endif | 57 #endif |
| 54 | 58 |
| 55 void CheckRuns(const Vector<SegmenterTestRun>& runs, FontOrientation orienta
tion, FontVariant variant) | 59 void CheckRuns(const Vector<SegmenterTestRun>& runs, FontOrientation orienta
tion, FontVariant variant) |
| 56 { | 60 { |
| 57 String text(String::make16BitFrom8BitSource(0, 0)); | 61 String text(String::make16BitFrom8BitSource(0, 0)); |
| 58 Vector<SegmenterExpectedRun> expect; | 62 Vector<SegmenterExpectedRun> expect; |
| 59 for (auto& run : runs) { | 63 for (auto& run : runs) { |
| 60 unsigned lengthBefore = text.length(); | 64 unsigned lengthBefore = text.length(); |
| 61 text.append(String::fromUTF8(run.text.c_str())); | 65 text.append(String::fromUTF8(run.text.c_str())); |
| 62 expect.append(SegmenterExpectedRun(lengthBefore, text.length(), run.
script, run.renderOrientation, run.smallCapsBehavior)); | 66 expect.append(SegmenterExpectedRun(lengthBefore, text.length(), run.
script, run.renderOrientation, run.smallCapsBehavior, run.fontFallbackPriority))
; |
| 63 } | 67 } |
| 64 RunSegmenter runSegmenter(text.characters16(), text.length(), orientatio
n, variant); | 68 RunSegmenter runSegmenter(text.characters16(), text.length(), orientatio
n, variant); |
| 65 VerifyRuns(&runSegmenter, expect); | 69 VerifyRuns(&runSegmenter, expect); |
| 66 } | 70 } |
| 67 | 71 |
| 68 void VerifyRuns(RunSegmenter* runSegmenter, | 72 void VerifyRuns(RunSegmenter* runSegmenter, |
| 69 const Vector<SegmenterExpectedRun>& expect) | 73 const Vector<SegmenterExpectedRun>& expect) |
| 70 { | 74 { |
| 71 RunSegmenter::RunSegmenterRange segmenterRange; | 75 RunSegmenter::RunSegmenterRange segmenterRange; |
| 72 unsigned long runCount = 0; | 76 unsigned long runCount = 0; |
| 73 while (runSegmenter->consume(&segmenterRange)) { | 77 while (runSegmenter->consume(&segmenterRange)) { |
| 74 ASSERT_LT(runCount, expect.size()); | 78 ASSERT_LT(runCount, expect.size()); |
| 75 ASSERT_EQ(expect[runCount].start, segmenterRange.start); | 79 ASSERT_EQ(expect[runCount].start, segmenterRange.start); |
| 76 ASSERT_EQ(expect[runCount].limit, segmenterRange.end); | 80 ASSERT_EQ(expect[runCount].limit, segmenterRange.end); |
| 77 ASSERT_EQ(expect[runCount].script, segmenterRange.script); | 81 ASSERT_EQ(expect[runCount].script, segmenterRange.script); |
| 78 ASSERT_EQ(expect[runCount].renderOrientation, segmenterRange.renderO
rientation); | 82 ASSERT_EQ(expect[runCount].renderOrientation, segmenterRange.renderO
rientation); |
| 79 ASSERT_EQ(expect[runCount].smallCapsBehavior, segmenterRange.smallCa
psBehavior); | 83 ASSERT_EQ(expect[runCount].smallCapsBehavior, segmenterRange.smallCa
psBehavior); |
| 84 ASSERT_EQ(expect[runCount].fontFallbackPriority, segmenterRange.font
FallbackPriority); |
| 80 ++runCount; | 85 ++runCount; |
| 81 } | 86 } |
| 82 ASSERT_EQ(expect.size(), runCount); | 87 ASSERT_EQ(expect.size(), runCount); |
| 83 } | 88 } |
| 84 }; | 89 }; |
| 85 | 90 |
| 86 // Some of our compilers cannot initialize a vector from an array yet. | 91 // Some of our compilers cannot initialize a vector from an array yet. |
| 87 #define DECLARE_RUNSVECTOR(...) \ | 92 #define DECLARE_RUNSVECTOR(...) \ |
| 88 static const SegmenterTestRun runsArray[] = __VA_ARGS__; \ | 93 static const SegmenterTestRun runsArray[] = __VA_ARGS__; \ |
| 89 Vector<SegmenterTestRun> runs; \ | 94 Vector<SegmenterTestRun> runs; \ |
| (...skipping 20 matching lines...) Expand all Loading... |
| 110 { | 115 { |
| 111 String empty(String::make16BitFrom8BitSource(0, 0)); | 116 String empty(String::make16BitFrom8BitSource(0, 0)); |
| 112 RunSegmenter::RunSegmenterRange segmenterRange = { 0, 0, USCRIPT_INVALID_COD
E, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase }; | 117 RunSegmenter::RunSegmenterRange segmenterRange = { 0, 0, USCRIPT_INVALID_COD
E, OrientationIterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase }; |
| 113 RunSegmenter runSegmenter(empty.characters16(), empty.length(), FontOrientat
ion::VerticalMixed, FontVariantNormal); | 118 RunSegmenter runSegmenter(empty.characters16(), empty.length(), FontOrientat
ion::VerticalMixed, FontVariantNormal); |
| 114 ASSERT(!runSegmenter.consume(&segmenterRange)); | 119 ASSERT(!runSegmenter.consume(&segmenterRange)); |
| 115 ASSERT_EQ(segmenterRange.start, 0u); | 120 ASSERT_EQ(segmenterRange.start, 0u); |
| 116 ASSERT_EQ(segmenterRange.end, 0u); | 121 ASSERT_EQ(segmenterRange.end, 0u); |
| 117 ASSERT_EQ(segmenterRange.script, USCRIPT_INVALID_CODE); | 122 ASSERT_EQ(segmenterRange.script, USCRIPT_INVALID_CODE); |
| 118 ASSERT_EQ(segmenterRange.renderOrientation, OrientationIterator::Orientation
Keep); | 123 ASSERT_EQ(segmenterRange.renderOrientation, OrientationIterator::Orientation
Keep); |
| 119 ASSERT_EQ(segmenterRange.smallCapsBehavior, SmallCapsIterator::SmallCapsSame
Case); | 124 ASSERT_EQ(segmenterRange.smallCapsBehavior, SmallCapsIterator::SmallCapsSame
Case); |
| 125 ASSERT_EQ(segmenterRange.fontFallbackPriority, FontFallbackPriority::Text); |
| 120 } | 126 } |
| 121 | 127 |
| 122 TEST_F(RunSegmenterTest, LatinPunctuationSideways) | 128 TEST_F(RunSegmenterTest, LatinPunctuationSideways) |
| 123 { | 129 { |
| 124 CHECK_RUNS_MIXED_NORMAL({ { "Abc.;?Xyz", USCRIPT_LATIN, OrientationIterator:
:OrientationRotateSideways, SmallCapsIterator::SmallCapsSameCase } }); | 130 CHECK_RUNS_MIXED_NORMAL({ { "Abc.;?Xyz", USCRIPT_LATIN, OrientationIterator:
:OrientationRotateSideways, SmallCapsIterator::SmallCapsSameCase, FontFallbackPr
iority::Text } }); |
| 125 } | 131 } |
| 126 | 132 |
| 127 TEST_F(RunSegmenterTest, OneSpace) | 133 TEST_F(RunSegmenterTest, OneSpace) |
| 128 { | 134 { |
| 129 CHECK_RUNS_MIXED_NORMAL({ { " ", USCRIPT_COMMON, OrientationIterator::Orient
ationRotateSideways, SmallCapsIterator::SmallCapsSameCase } }); | 135 CHECK_RUNS_MIXED_NORMAL({ { " ", USCRIPT_COMMON, OrientationIterator::Orient
ationRotateSideways, SmallCapsIterator::SmallCapsSameCase, FontFallbackPriority:
:Text } }); |
| 130 } | 136 } |
| 131 | 137 |
| 132 TEST_F(RunSegmenterTest, ArabicHangul) | 138 TEST_F(RunSegmenterTest, ArabicHangul) |
| 133 { | 139 { |
| 134 CHECK_RUNS_MIXED_NORMAL({ { "نص", USCRIPT_ARABIC, OrientationIterator::Orien
tationRotateSideways, SmallCapsIterator::SmallCapsSameCase }, | 140 CHECK_RUNS_MIXED_NORMAL({ { "نص", USCRIPT_ARABIC, OrientationIterator::Orien
tationRotateSideways, SmallCapsIterator::SmallCapsSameCase, FontFallbackPriority
::Text }, |
| 135 { "키스의", USCRIPT_HANGUL, OrientationIterator::OrientationKeep, SmallCaps
Iterator::SmallCapsSameCase } }); | 141 { "키스의", USCRIPT_HANGUL, OrientationIterator::OrientationKeep, SmallCaps
Iterator::SmallCapsSameCase, FontFallbackPriority::Text } }); |
| 136 } | 142 } |
| 137 | 143 |
| 138 TEST_F(RunSegmenterTest, JapaneseHindiEmojiMix) | 144 TEST_F(RunSegmenterTest, JapaneseHindiEmojiMix) |
| 139 { | 145 { |
| 140 CHECK_RUNS_MIXED_NORMAL({ { "百家姓", USCRIPT_HAN, OrientationIterator::Orienta
tionKeep, SmallCapsIterator::SmallCapsSameCase }, | 146 CHECK_RUNS_MIXED_NORMAL({ { "百家姓", USCRIPT_HAN, OrientationIterator::Orienta
tionKeep, SmallCapsIterator::SmallCapsSameCase, FontFallbackPriority::Text }, |
| 141 { "ऋषियों", USCRIPT_DEVANAGARI, OrientationIterator::OrientationRotateSi
deways, SmallCapsIterator::SmallCapsSameCase }, | 147 { "ऋषियों", USCRIPT_DEVANAGARI, OrientationIterator::OrientationRotateSi
deways, SmallCapsIterator::SmallCapsSameCase, FontFallbackPriority::Text }, |
| 142 { "🌱🌲🌳🌴", USCRIPT_DEVANAGARI, OrientationIterator::OrientationKeep, Smal
lCapsIterator::SmallCapsSameCase }, | 148 { "🌱🌲🌳🌴", USCRIPT_DEVANAGARI, OrientationIterator::OrientationKeep, Smal
lCapsIterator::SmallCapsSameCase, FontFallbackPriority::EmojiEmoji }, |
| 143 { "百家姓🌱🌲", USCRIPT_HAN, OrientationIterator::OrientationKeep, SmallCapsI
terator::SmallCapsSameCase } }); | 149 { "百家姓", USCRIPT_HAN, OrientationIterator::OrientationKeep, SmallCapsIte
rator::SmallCapsSameCase, FontFallbackPriority::Text }, |
| 150 { "🌱🌲", USCRIPT_HAN, OrientationIterator::OrientationKeep, SmallCapsIter
ator::SmallCapsSameCase, FontFallbackPriority::EmojiEmoji } }); |
| 144 } | 151 } |
| 145 | 152 |
| 146 TEST_F(RunSegmenterTest, HangulSpace) | 153 TEST_F(RunSegmenterTest, HangulSpace) |
| 147 { | 154 { |
| 148 CHECK_RUNS_MIXED_NORMAL({ { "키스의", USCRIPT_HANGUL, OrientationIterator::Orie
ntationKeep, SmallCapsIterator::SmallCapsSameCase }, | 155 CHECK_RUNS_MIXED_NORMAL({ { "키스의", USCRIPT_HANGUL, OrientationIterator::Orie
ntationKeep, SmallCapsIterator::SmallCapsSameCase, FontFallbackPriority::Text }, |
| 149 { " ", USCRIPT_HANGUL, OrientationIterator::OrientationRotateSideways, S
mallCapsIterator::SmallCapsSameCase }, | 156 { " ", USCRIPT_HANGUL, OrientationIterator::OrientationRotateSideways, S
mallCapsIterator::SmallCapsSameCase, FontFallbackPriority::Text }, |
| 150 { "고유조건은", USCRIPT_HANGUL, OrientationIterator::OrientationKeep, SmallCa
psIterator::SmallCapsSameCase } }); | 157 { "고유조건은", USCRIPT_HANGUL, OrientationIterator::OrientationKeep, SmallCa
psIterator::SmallCapsSameCase, FontFallbackPriority::Text } }); |
| 151 } | 158 } |
| 152 | 159 |
| 153 TEST_F(RunSegmenterTest, TechnicalCommonUpright) | 160 TEST_F(RunSegmenterTest, TechnicalCommonUpright) |
| 154 { | 161 { |
| 155 CHECK_RUNS_MIXED_NORMAL({ { "⌀⌁⌂", USCRIPT_COMMON, OrientationIterator::Orie
ntationKeep, SmallCapsIterator::SmallCapsSameCase } }); | 162 CHECK_RUNS_MIXED_NORMAL({ { "⌀⌁⌂", USCRIPT_COMMON, OrientationIterator::Orie
ntationKeep, SmallCapsIterator::SmallCapsSameCase, FontFallbackPriority::Math }
}); |
| 156 } | 163 } |
| 157 | 164 |
| 158 TEST_F(RunSegmenterTest, PunctuationCommonSideways) | 165 TEST_F(RunSegmenterTest, PunctuationCommonSideways) |
| 159 { | 166 { |
| 160 CHECK_RUNS_MIXED_NORMAL({ { ".…¡", USCRIPT_COMMON, OrientationIterator::Orie
ntationRotateSideways, SmallCapsIterator::SmallCapsSameCase } }); | 167 CHECK_RUNS_MIXED_NORMAL({ { ".…¡", USCRIPT_COMMON, OrientationIterator::Orie
ntationRotateSideways, SmallCapsIterator::SmallCapsSameCase, FontFallbackPriorit
y::Text } }); |
| 161 } | 168 } |
| 162 | 169 |
| 163 TEST_F(RunSegmenterTest, JapanesePunctuationMixedInside) | 170 TEST_F(RunSegmenterTest, JapanesePunctuationMixedInside) |
| 164 { | 171 { |
| 165 CHECK_RUNS_MIXED_NORMAL({ { "いろはに", USCRIPT_HIRAGANA, OrientationIterator::O
rientationKeep, SmallCapsIterator::SmallCapsSameCase }, | 172 CHECK_RUNS_MIXED_NORMAL({ { "いろはに", USCRIPT_HIRAGANA, OrientationIterator::O
rientationKeep, SmallCapsIterator::SmallCapsSameCase, FontFallbackPriority::Text
}, |
| 166 { ".…¡", USCRIPT_HIRAGANA, OrientationIterator::OrientationRotateSideway
s, SmallCapsIterator::SmallCapsSameCase }, | 173 { ".…¡", USCRIPT_HIRAGANA, OrientationIterator::OrientationRotateSideway
s, SmallCapsIterator::SmallCapsSameCase, FontFallbackPriority::Text }, |
| 167 { "ほへと", USCRIPT_HIRAGANA, OrientationIterator::OrientationKeep, SmallCa
psIterator::SmallCapsSameCase } }); | 174 { "ほへと", USCRIPT_HIRAGANA, OrientationIterator::OrientationKeep, SmallCa
psIterator::SmallCapsSameCase, FontFallbackPriority::Text } }); |
| 168 } | 175 } |
| 169 | 176 |
| 170 TEST_F(RunSegmenterTest, JapanesePunctuationMixedInsideHorizontal) | 177 TEST_F(RunSegmenterTest, JapanesePunctuationMixedInsideHorizontal) |
| 171 { | 178 { |
| 172 CHECK_RUNS_HORIZONTAL_NORMAL({ { "いろはに.…¡ほへと", USCRIPT_HIRAGANA, Orientation
Iterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase }}); | 179 CHECK_RUNS_HORIZONTAL_NORMAL({ { "いろはに.…¡ほへと", USCRIPT_HIRAGANA, Orientation
Iterator::OrientationKeep, SmallCapsIterator::SmallCapsSameCase, FontFallbackPri
ority::Text }}); |
| 173 } | 180 } |
| 174 | 181 |
| 175 TEST_F(RunSegmenterTest, PunctuationDevanagariCombining) | 182 TEST_F(RunSegmenterTest, PunctuationDevanagariCombining) |
| 176 { | 183 { |
| 177 CHECK_RUNS_HORIZONTAL_NORMAL({ { "क+े", USCRIPT_DEVANAGARI, OrientationItera
tor::OrientationKeep, SmallCapsIterator::SmallCapsSameCase }}); | 184 CHECK_RUNS_HORIZONTAL_NORMAL({ { "क+े", USCRIPT_DEVANAGARI, OrientationItera
tor::OrientationKeep, SmallCapsIterator::SmallCapsSameCase, FontFallbackPriority
::Text }}); |
| 185 } |
| 186 |
| 187 TEST_F(RunSegmenterTest, EmojiZWJSequences) |
| 188 { |
| 189 CHECK_RUNS_HORIZONTAL_NORMAL({ |
| 190 { "👩👩👧👦👩❤️💋👨", USCRIPT_LATIN, OrientationIterator::OrientationKeep
, SmallCapsIterator::SmallCapsSameCase, FontFallbackPriority::EmojiEmoji }, |
| 191 { "abcd", USCRIPT_LATIN, OrientationIterator::OrientationKeep, SmallCaps
Iterator::SmallCapsSameCase, FontFallbackPriority::Text }, |
| 192 { "👩👩", USCRIPT_LATIN, OrientationIterator::OrientationKeep, SmallCaps
Iterator::SmallCapsSameCase, FontFallbackPriority::EmojiEmoji }, |
| 193 { "efg", USCRIPT_LATIN, OrientationIterator::OrientationKeep, SmallCapsI
terator::SmallCapsSameCase, FontFallbackPriority::Text } |
| 194 }); |
| 178 } | 195 } |
| 179 | 196 |
| 180 TEST_F(RunSegmenterTest, JapaneseLetterlikeEnd) | 197 TEST_F(RunSegmenterTest, JapaneseLetterlikeEnd) |
| 181 { | 198 { |
| 182 CHECK_RUNS_MIXED_NORMAL({ { "いろは", USCRIPT_HIRAGANA, OrientationIterator::Or
ientationKeep, SmallCapsIterator::SmallCapsSameCase }, | 199 CHECK_RUNS_MIXED_NORMAL({ { "いろは", USCRIPT_HIRAGANA, OrientationIterator::Or
ientationKeep, SmallCapsIterator::SmallCapsSameCase, FontFallbackPriority::Text
}, |
| 183 { "ℐℒℐℒℐℒℐℒℐℒℐℒℐℒ", USCRIPT_HIRAGANA, OrientationIterator::OrientationRo
tateSideways, SmallCapsIterator::SmallCapsSameCase } }); | 200 { "ℐℒℐℒℐℒℐℒℐℒℐℒℐℒ", USCRIPT_HIRAGANA, OrientationIterator::OrientationRo
tateSideways, SmallCapsIterator::SmallCapsSameCase, FontFallbackPriority::Text }
}); |
| 184 } | 201 } |
| 185 | 202 |
| 186 TEST_F(RunSegmenterTest, JapaneseSmallCaps) | 203 TEST_F(RunSegmenterTest, JapaneseSmallCaps) |
| 187 { | 204 { |
| 188 CHECK_RUNS_MIXED_SMALLCAPS({ | 205 CHECK_RUNS_MIXED_SMALLCAPS({ |
| 189 { "いろは", USCRIPT_HIRAGANA, OrientationIterator::OrientationKeep, SmallCa
psIterator::SmallCapsSameCase }, | 206 { "いろは", USCRIPT_HIRAGANA, OrientationIterator::OrientationKeep, SmallCa
psIterator::SmallCapsSameCase, FontFallbackPriority::Text }, |
| 190 { "aa", USCRIPT_LATIN, OrientationIterator::OrientationRotateSideways, S
mallCapsIterator::SmallCapsUppercaseNeeded }, | 207 { "aa", USCRIPT_LATIN, OrientationIterator::OrientationRotateSideways, S
mallCapsIterator::SmallCapsUppercaseNeeded, FontFallbackPriority::Text }, |
| 191 { "AA", USCRIPT_LATIN, OrientationIterator::OrientationRotateSideways, S
mallCapsIterator::SmallCapsSameCase }, | 208 { "AA", USCRIPT_LATIN, OrientationIterator::OrientationRotateSideways, S
mallCapsIterator::SmallCapsSameCase, FontFallbackPriority::Text }, |
| 192 { "いろは", USCRIPT_HIRAGANA, OrientationIterator::OrientationKeep, SmallCa
psIterator::SmallCapsSameCase }, | 209 { "いろは", USCRIPT_HIRAGANA, OrientationIterator::OrientationKeep, SmallCa
psIterator::SmallCapsSameCase, FontFallbackPriority::Text }, |
| 193 }); | 210 }); |
| 194 } | 211 } |
| 195 | 212 |
| 196 TEST_F(RunSegmenterTest, ArmenianCyrillicSmallCaps) | 213 TEST_F(RunSegmenterTest, ArmenianCyrillicSmallCaps) |
| 197 { | 214 { |
| 198 CHECK_RUNS_HORIZONTAL_SMALLCAPS({ { "աբգ", USCRIPT_ARMENIAN, OrientationIter
ator::OrientationKeep, SmallCapsIterator::SmallCapsUppercaseNeeded }, | 215 CHECK_RUNS_HORIZONTAL_SMALLCAPS({ { "աբգ", USCRIPT_ARMENIAN, OrientationIter
ator::OrientationKeep, SmallCapsIterator::SmallCapsUppercaseNeeded, FontFallback
Priority::Text }, |
| 199 { "αβγ", USCRIPT_GREEK, OrientationIterator::OrientationKeep, SmallCapsI
terator::SmallCapsUppercaseNeeded }, | 216 { "αβγ", USCRIPT_GREEK, OrientationIterator::OrientationKeep, SmallCapsI
terator::SmallCapsUppercaseNeeded, FontFallbackPriority::Text }, |
| 200 { "ԱԲԳ", USCRIPT_ARMENIAN, OrientationIterator::OrientationKeep, SmallCa
psIterator::SmallCapsSameCase } }); | 217 { "ԱԲԳ", USCRIPT_ARMENIAN, OrientationIterator::OrientationKeep, SmallCa
psIterator::SmallCapsSameCase, FontFallbackPriority::Text } }); |
| 201 } | 218 } |
| 202 | 219 |
| 203 | 220 |
| 221 |
| 204 } // namespace blink | 222 } // namespace blink |
| OLD | NEW |