| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // Tests for the Font class. | 26 // Tests for the Font class. |
| 27 | 27 |
| 28 #include "config.h" | 28 #include "config.h" |
| 29 | 29 |
| 30 #include "core/platform/graphics/Font.h" | 30 #include "core/platform/graphics/Font.h" |
| 31 | 31 |
| 32 #include <gtest/gtest.h> | 32 #include <gtest/gtest.h> |
| 33 | 33 |
| 34 namespace WebCore { | 34 namespace WebCore { |
| 35 | 35 |
| 36 TEST(FontTest, TestCharacterRangeCodePath1) | 36 static void TestSpecificUCharRange(UChar rangeStart, UChar rangeEnd) |
| 37 { |
| 38 UChar below[1]; |
| 39 UChar start[1]; |
| 40 UChar midway[1]; |
| 41 UChar end[1]; |
| 42 UChar above[1]; |
| 43 |
| 44 below[0] = rangeStart - 1; |
| 45 start[0] = rangeStart; |
| 46 midway[0] = ((int)rangeStart + (int)rangeEnd) / 2; |
| 47 end[0] = rangeEnd; |
| 48 above[0] = rangeEnd + 1; |
| 49 |
| 50 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(below, 1)); |
| 51 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(start, 1)); |
| 52 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(midway, 1)); |
| 53 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(end, 1)); |
| 54 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(above, 1)); |
| 55 } |
| 56 |
| 57 TEST(FontTest, TestCharacterRangeCodePath) |
| 37 { | 58 { |
| 38 static UChar c1[] = { 0x0 }; | 59 static UChar c1[] = { 0x0 }; |
| 39 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | 60 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c1, 1)); |
| 40 EXPECT_EQ(Font::Simple, codePath); | |
| 41 | 61 |
| 42 static UChar c2[] = { 0x2E4 }; | 62 TestSpecificUCharRange(0x2E5, 0x2E9); |
| 43 codePath = Font::characterRangeCodePath(c2, 1); | 63 TestSpecificUCharRange(0x300, 0x36F); |
| 44 EXPECT_EQ(Font::Simple, codePath); | 64 TestSpecificUCharRange(0x0591, 0x05BD); |
| 65 TestSpecificUCharRange(0x05BF, 0x05CF); |
| 66 TestSpecificUCharRange(0x0600, 0x109F); |
| 67 TestSpecificUCharRange(0x1100, 0x11FF); |
| 68 TestSpecificUCharRange(0x135D, 0x135F); |
| 69 TestSpecificUCharRange(0x1700, 0x18AF); |
| 70 TestSpecificUCharRange(0x1900, 0x194F); |
| 71 TestSpecificUCharRange(0x1980, 0x19DF); |
| 72 TestSpecificUCharRange(0x1A00, 0x1CFF); |
| 45 | 73 |
| 46 static UChar c3[] = { 0x2E5 }; | 74 static UChar c2[] = { 0x1DBF }; |
| 47 codePath = Font::characterRangeCodePath(c3, 1); | 75 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c2, 1)); |
| 48 EXPECT_EQ(Font::Complex, codePath); | 76 static UChar c3[] = { 0x1DC0 }; |
| 77 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c3, 1)); |
| 78 static UChar c4[] = { 0x1DD0 }; |
| 79 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c4, 1)); |
| 80 static UChar c5[] = { 0x1DFF }; |
| 81 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c5, 1)); |
| 82 static UChar c6[] = { 0x1E00 }; |
| 83 EXPECT_EQ(Font::SimpleWithGlyphOverflow, Font::characterRangeCodePath(c6, 1)
); |
| 84 static UChar c7[] = { 0x2000 }; |
| 85 EXPECT_EQ(Font::SimpleWithGlyphOverflow, Font::characterRangeCodePath(c7, 1)
); |
| 86 static UChar c8[] = { 0x2001 }; |
| 87 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c8, 1)); |
| 49 | 88 |
| 50 static UChar c4[] = { 0x2E8 }; | 89 TestSpecificUCharRange(0x20D0, 0x20FF); |
| 51 codePath = Font::characterRangeCodePath(c4, 1); | 90 TestSpecificUCharRange(0x2CEF, 0x2CF1); |
| 52 EXPECT_EQ(Font::Complex, codePath); | 91 TestSpecificUCharRange(0x302A, 0x302F); |
| 53 | 92 |
| 54 static UChar c5[] = { 0x2E9 }; | 93 TestSpecificUCharRange(0xA67C, 0xA67D); |
| 55 codePath = Font::characterRangeCodePath(c5, 1); | 94 TestSpecificUCharRange(0xA6F0, 0xA6F1); |
| 56 EXPECT_EQ(Font::Complex, codePath); | 95 TestSpecificUCharRange(0xA800, 0xABFF); |
| 57 | 96 |
| 58 static UChar c6[] = { 0x2EA }; | 97 TestSpecificUCharRange(0xD7B0, 0xD7FF); |
| 59 codePath = Font::characterRangeCodePath(c6, 1); | 98 TestSpecificUCharRange(0xFE00, 0xFE0F); |
| 60 EXPECT_EQ(Font::Simple, codePath); | 99 TestSpecificUCharRange(0xFE20, 0xFE2F); |
| 61 } | |
| 62 | |
| 63 TEST(FontTest, TestCharacterRangeCodePath2) | |
| 64 { | |
| 65 static UChar c1[] = { 0x2FF }; | |
| 66 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 67 EXPECT_EQ(Font::Simple, codePath); | |
| 68 | |
| 69 static UChar c2[] = { 0x300 }; | |
| 70 codePath = Font::characterRangeCodePath(c2, 1); | |
| 71 EXPECT_EQ(Font::Complex, codePath); | |
| 72 | |
| 73 static UChar c3[] = { 0x330 }; | |
| 74 codePath = Font::characterRangeCodePath(c3, 1); | |
| 75 EXPECT_EQ(Font::Complex, codePath); | |
| 76 | |
| 77 static UChar c4[] = { 0x36F }; | |
| 78 codePath = Font::characterRangeCodePath(c4, 1); | |
| 79 EXPECT_EQ(Font::Complex, codePath); | |
| 80 | |
| 81 static UChar c5[] = { 0x370 }; | |
| 82 codePath = Font::characterRangeCodePath(c5, 1); | |
| 83 EXPECT_EQ(Font::Simple, codePath); | |
| 84 } | |
| 85 | |
| 86 TEST(FontTest, TestCharacterRangeCodePath3) | |
| 87 { | |
| 88 static UChar c1[] = { 0x0590 }; | |
| 89 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 90 EXPECT_EQ(Font::Simple, codePath); | |
| 91 | |
| 92 static UChar c2[] = { 0x0591 }; | |
| 93 codePath = Font::characterRangeCodePath(c2, 1); | |
| 94 EXPECT_EQ(Font::Complex, codePath); | |
| 95 | |
| 96 static UChar c3[] = { 0x05A0 }; | |
| 97 codePath = Font::characterRangeCodePath(c3, 1); | |
| 98 EXPECT_EQ(Font::Complex, codePath); | |
| 99 | |
| 100 static UChar c4[] = { 0x05BD }; | |
| 101 codePath = Font::characterRangeCodePath(c4, 1); | |
| 102 EXPECT_EQ(Font::Complex, codePath); | |
| 103 | |
| 104 static UChar c5[] = { 0x05BE }; | |
| 105 codePath = Font::characterRangeCodePath(c5, 1); | |
| 106 EXPECT_EQ(Font::Simple, codePath); | |
| 107 | |
| 108 static UChar c6[] = { 0x05BF }; | |
| 109 codePath = Font::characterRangeCodePath(c6, 1); | |
| 110 EXPECT_EQ(Font::Complex, codePath); | |
| 111 | |
| 112 static UChar c7[] = { 0x05C0 }; | |
| 113 codePath = Font::characterRangeCodePath(c7, 1); | |
| 114 EXPECT_EQ(Font::Complex, codePath); | |
| 115 | |
| 116 static UChar c8[] = { 0x05CF }; | |
| 117 codePath = Font::characterRangeCodePath(c8, 1); | |
| 118 EXPECT_EQ(Font::Complex, codePath); | |
| 119 | |
| 120 static UChar c9[] = { 0x05D0 }; | |
| 121 codePath = Font::characterRangeCodePath(c9, 1); | |
| 122 EXPECT_EQ(Font::Simple, codePath); | |
| 123 } | |
| 124 | |
| 125 TEST(FontTest, TestCharacterRangeCodePath4) | |
| 126 { | |
| 127 static UChar c1[] = { 0x05FF }; | |
| 128 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 129 EXPECT_EQ(Font::Simple, codePath); | |
| 130 | |
| 131 static UChar c2[] = { 0x0600 }; | |
| 132 codePath = Font::characterRangeCodePath(c2, 1); | |
| 133 EXPECT_EQ(Font::Complex, codePath); | |
| 134 | |
| 135 static UChar c3[] = { 0x0700 }; | |
| 136 codePath = Font::characterRangeCodePath(c3, 1); | |
| 137 EXPECT_EQ(Font::Complex, codePath); | |
| 138 | |
| 139 static UChar c4[] = { 0x109F }; | |
| 140 codePath = Font::characterRangeCodePath(c4, 1); | |
| 141 EXPECT_EQ(Font::Complex, codePath); | |
| 142 | |
| 143 static UChar c5[] = { 0x10A0 }; | |
| 144 codePath = Font::characterRangeCodePath(c5, 1); | |
| 145 EXPECT_EQ(Font::Simple, codePath); | |
| 146 } | |
| 147 | |
| 148 TEST(FontTest, TestCharacterRangeCodePath5) | |
| 149 { | |
| 150 static UChar c1[] = { 0x10FF }; | |
| 151 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 152 EXPECT_EQ(Font::Simple, codePath); | |
| 153 | |
| 154 static UChar c2[] = { 0x1100 }; | |
| 155 codePath = Font::characterRangeCodePath(c2, 1); | |
| 156 EXPECT_EQ(Font::Complex, codePath); | |
| 157 | |
| 158 static UChar c3[] = { 0x11A0 }; | |
| 159 codePath = Font::characterRangeCodePath(c3, 1); | |
| 160 EXPECT_EQ(Font::Complex, codePath); | |
| 161 | |
| 162 static UChar c4[] = { 0x11FF }; | |
| 163 codePath = Font::characterRangeCodePath(c4, 1); | |
| 164 EXPECT_EQ(Font::Complex, codePath); | |
| 165 | |
| 166 static UChar c5[] = { 0x1200 }; | |
| 167 codePath = Font::characterRangeCodePath(c5, 1); | |
| 168 EXPECT_EQ(Font::Simple, codePath); | |
| 169 } | |
| 170 | |
| 171 TEST(FontTest, TestCharacterRangeCodePath6) | |
| 172 { | |
| 173 static UChar c1[] = { 0x135C }; | |
| 174 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 175 EXPECT_EQ(Font::Simple, codePath); | |
| 176 | |
| 177 static UChar c2[] = { 0x135D }; | |
| 178 codePath = Font::characterRangeCodePath(c2, 1); | |
| 179 EXPECT_EQ(Font::Complex, codePath); | |
| 180 | |
| 181 static UChar c3[] = { 0x135E }; | |
| 182 codePath = Font::characterRangeCodePath(c3, 1); | |
| 183 EXPECT_EQ(Font::Complex, codePath); | |
| 184 | |
| 185 static UChar c4[] = { 0x135F }; | |
| 186 codePath = Font::characterRangeCodePath(c4, 1); | |
| 187 EXPECT_EQ(Font::Complex, codePath); | |
| 188 | |
| 189 static UChar c5[] = { 0x1360 }; | |
| 190 codePath = Font::characterRangeCodePath(c5, 1); | |
| 191 EXPECT_EQ(Font::Simple, codePath); | |
| 192 } | |
| 193 | |
| 194 TEST(FontTest, TestCharacterRangeCodePath7) | |
| 195 { | |
| 196 static UChar c1[] = { 0x16FF }; | |
| 197 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 198 EXPECT_EQ(Font::Simple, codePath); | |
| 199 | |
| 200 static UChar c2[] = { 0x1700 }; | |
| 201 codePath = Font::characterRangeCodePath(c2, 1); | |
| 202 EXPECT_EQ(Font::Complex, codePath); | |
| 203 | |
| 204 static UChar c3[] = { 0x1800 }; | |
| 205 codePath = Font::characterRangeCodePath(c3, 1); | |
| 206 EXPECT_EQ(Font::Complex, codePath); | |
| 207 | |
| 208 static UChar c4[] = { 0x18AF }; | |
| 209 codePath = Font::characterRangeCodePath(c4, 1); | |
| 210 EXPECT_EQ(Font::Complex, codePath); | |
| 211 | |
| 212 static UChar c5[] = { 0x18B0 }; | |
| 213 codePath = Font::characterRangeCodePath(c5, 1); | |
| 214 EXPECT_EQ(Font::Simple, codePath); | |
| 215 } | |
| 216 | |
| 217 TEST(FontTest, TestCharacterRangeCodePath8) | |
| 218 { | |
| 219 static UChar c1[] = { 0x18FF }; | |
| 220 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 221 EXPECT_EQ(Font::Simple, codePath); | |
| 222 | |
| 223 static UChar c2[] = { 0x1900 }; | |
| 224 codePath = Font::characterRangeCodePath(c2, 1); | |
| 225 EXPECT_EQ(Font::Complex, codePath); | |
| 226 | |
| 227 static UChar c3[] = { 0x1940 }; | |
| 228 codePath = Font::characterRangeCodePath(c3, 1); | |
| 229 EXPECT_EQ(Font::Complex, codePath); | |
| 230 | |
| 231 static UChar c4[] = { 0x194F }; | |
| 232 codePath = Font::characterRangeCodePath(c4, 1); | |
| 233 EXPECT_EQ(Font::Complex, codePath); | |
| 234 | |
| 235 static UChar c5[] = { 0x1950 }; | |
| 236 codePath = Font::characterRangeCodePath(c5, 1); | |
| 237 EXPECT_EQ(Font::Simple, codePath); | |
| 238 } | |
| 239 | |
| 240 TEST(FontTest, TestCharacterRangeCodePath9) | |
| 241 { | |
| 242 static UChar c1[] = { 0x197F }; | |
| 243 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 244 EXPECT_EQ(Font::Simple, codePath); | |
| 245 | |
| 246 static UChar c2[] = { 0x1980 }; | |
| 247 codePath = Font::characterRangeCodePath(c2, 1); | |
| 248 EXPECT_EQ(Font::Complex, codePath); | |
| 249 | |
| 250 static UChar c3[] = { 0x19D0 }; | |
| 251 codePath = Font::characterRangeCodePath(c3, 1); | |
| 252 EXPECT_EQ(Font::Complex, codePath); | |
| 253 | |
| 254 static UChar c4[] = { 0x19DF }; | |
| 255 codePath = Font::characterRangeCodePath(c4, 1); | |
| 256 EXPECT_EQ(Font::Complex, codePath); | |
| 257 | |
| 258 static UChar c5[] = { 0x19E0 }; | |
| 259 codePath = Font::characterRangeCodePath(c5, 1); | |
| 260 EXPECT_EQ(Font::Simple, codePath); | |
| 261 } | |
| 262 | |
| 263 TEST(FontTest, TestCharacterRangeCodePath10) | |
| 264 { | |
| 265 static UChar c1[] = { 0x19FF }; | |
| 266 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 267 EXPECT_EQ(Font::Simple, codePath); | |
| 268 | |
| 269 static UChar c2[] = { 0x1A00 }; | |
| 270 codePath = Font::characterRangeCodePath(c2, 1); | |
| 271 EXPECT_EQ(Font::Complex, codePath); | |
| 272 | |
| 273 static UChar c3[] = { 0x1C00 }; | |
| 274 codePath = Font::characterRangeCodePath(c3, 1); | |
| 275 EXPECT_EQ(Font::Complex, codePath); | |
| 276 | |
| 277 static UChar c4[] = { 0x1CFF }; | |
| 278 codePath = Font::characterRangeCodePath(c4, 1); | |
| 279 EXPECT_EQ(Font::Complex, codePath); | |
| 280 | |
| 281 static UChar c5[] = { 0x1D00 }; | |
| 282 codePath = Font::characterRangeCodePath(c5, 1); | |
| 283 EXPECT_EQ(Font::Simple, codePath); | |
| 284 } | |
| 285 | |
| 286 TEST(FontTest, TestCharacterRangeCodePath11) | |
| 287 { | |
| 288 static UChar c1[] = { 0x1DBF }; | |
| 289 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 290 EXPECT_EQ(Font::Simple, codePath); | |
| 291 | |
| 292 static UChar c2[] = { 0x1DC0 }; | |
| 293 codePath = Font::characterRangeCodePath(c2, 1); | |
| 294 EXPECT_EQ(Font::Complex, codePath); | |
| 295 | |
| 296 static UChar c3[] = { 0x1DD0 }; | |
| 297 codePath = Font::characterRangeCodePath(c3, 1); | |
| 298 EXPECT_EQ(Font::Complex, codePath); | |
| 299 | |
| 300 static UChar c4[] = { 0x1DFF }; | |
| 301 codePath = Font::characterRangeCodePath(c4, 1); | |
| 302 EXPECT_EQ(Font::Complex, codePath); | |
| 303 | |
| 304 static UChar c5[] = { 0x1E00 }; | |
| 305 codePath = Font::characterRangeCodePath(c5, 1); | |
| 306 EXPECT_EQ(Font::SimpleWithGlyphOverflow, codePath); | |
| 307 | |
| 308 static UChar c6[] = { 0x2000 }; | |
| 309 codePath = Font::characterRangeCodePath(c6, 1); | |
| 310 EXPECT_EQ(Font::SimpleWithGlyphOverflow, codePath); | |
| 311 | |
| 312 static UChar c7[] = { 0x2001 }; | |
| 313 codePath = Font::characterRangeCodePath(c7, 1); | |
| 314 EXPECT_EQ(Font::Simple, codePath); | |
| 315 } | |
| 316 | |
| 317 TEST(FontTest, TestCharacterRangeCodePath12) | |
| 318 { | |
| 319 static UChar c1[] = { 0x20CF }; | |
| 320 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 321 EXPECT_EQ(Font::Simple, codePath); | |
| 322 | |
| 323 static UChar c2[] = { 0x20D0 }; | |
| 324 codePath = Font::characterRangeCodePath(c2, 1); | |
| 325 EXPECT_EQ(Font::Complex, codePath); | |
| 326 | |
| 327 static UChar c3[] = { 0x20F0 }; | |
| 328 codePath = Font::characterRangeCodePath(c3, 1); | |
| 329 EXPECT_EQ(Font::Complex, codePath); | |
| 330 | |
| 331 static UChar c4[] = { 0x20FF }; | |
| 332 codePath = Font::characterRangeCodePath(c4, 1); | |
| 333 EXPECT_EQ(Font::Complex, codePath); | |
| 334 | |
| 335 static UChar c5[] = { 0x2100 }; | |
| 336 codePath = Font::characterRangeCodePath(c5, 1); | |
| 337 EXPECT_EQ(Font::Simple, codePath); | |
| 338 } | |
| 339 | |
| 340 TEST(FontTest, TestCharacterRangeCodePath13) | |
| 341 { | |
| 342 static UChar c1[] = { 0x2CED }; | |
| 343 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 344 EXPECT_EQ(Font::Simple, codePath); | |
| 345 | |
| 346 static UChar c2[] = { 0x2CEF }; | |
| 347 codePath = Font::characterRangeCodePath(c2, 1); | |
| 348 EXPECT_EQ(Font::Complex, codePath); | |
| 349 | |
| 350 static UChar c3[] = { 0x2CF0 }; | |
| 351 codePath = Font::characterRangeCodePath(c3, 1); | |
| 352 EXPECT_EQ(Font::Complex, codePath); | |
| 353 | |
| 354 static UChar c4[] = { 0x2CF1 }; | |
| 355 codePath = Font::characterRangeCodePath(c4, 1); | |
| 356 EXPECT_EQ(Font::Complex, codePath); | |
| 357 | |
| 358 static UChar c5[] = { 0x2CF2 }; | |
| 359 codePath = Font::characterRangeCodePath(c5, 1); | |
| 360 EXPECT_EQ(Font::Simple, codePath); | |
| 361 } | |
| 362 | |
| 363 TEST(FontTest, TestCharacterRangeCodePath14) | |
| 364 { | |
| 365 static UChar c1[] = { 0x3029 }; | |
| 366 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 367 EXPECT_EQ(Font::Simple, codePath); | |
| 368 | |
| 369 static UChar c2[] = { 0x302A }; | |
| 370 codePath = Font::characterRangeCodePath(c2, 1); | |
| 371 EXPECT_EQ(Font::Complex, codePath); | |
| 372 | |
| 373 static UChar c3[] = { 0x302C }; | |
| 374 codePath = Font::characterRangeCodePath(c3, 1); | |
| 375 EXPECT_EQ(Font::Complex, codePath); | |
| 376 | |
| 377 static UChar c4[] = { 0x302F }; | |
| 378 codePath = Font::characterRangeCodePath(c4, 1); | |
| 379 EXPECT_EQ(Font::Complex, codePath); | |
| 380 | |
| 381 static UChar c5[] = { 0x3030 }; | |
| 382 codePath = Font::characterRangeCodePath(c5, 1); | |
| 383 EXPECT_EQ(Font::Simple, codePath); | |
| 384 } | |
| 385 | |
| 386 TEST(FontTest, TestCharacterRangeCodePath15) | |
| 387 { | |
| 388 static UChar c1[] = { 0xA67B }; | |
| 389 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 390 EXPECT_EQ(Font::Simple, codePath); | |
| 391 | |
| 392 static UChar c2[] = { 0xA67C }; | |
| 393 codePath = Font::characterRangeCodePath(c2, 1); | |
| 394 EXPECT_EQ(Font::Complex, codePath); | |
| 395 | |
| 396 static UChar c4[] = { 0xA67D }; | |
| 397 codePath = Font::characterRangeCodePath(c4, 1); | |
| 398 EXPECT_EQ(Font::Complex, codePath); | |
| 399 | |
| 400 static UChar c5[] = { 0xA67E }; | |
| 401 codePath = Font::characterRangeCodePath(c5, 1); | |
| 402 EXPECT_EQ(Font::Simple, codePath); | |
| 403 } | |
| 404 | |
| 405 TEST(FontTest, TestCharacterRangeCodePath16) | |
| 406 { | |
| 407 static UChar c1[] = { 0xA6E9 }; | |
| 408 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 409 EXPECT_EQ(Font::Simple, codePath); | |
| 410 | |
| 411 static UChar c2[] = { 0xA6F0 }; | |
| 412 codePath = Font::characterRangeCodePath(c2, 1); | |
| 413 EXPECT_EQ(Font::Complex, codePath); | |
| 414 | |
| 415 static UChar c4[] = { 0xA6F1 }; | |
| 416 codePath = Font::characterRangeCodePath(c4, 1); | |
| 417 EXPECT_EQ(Font::Complex, codePath); | |
| 418 | |
| 419 static UChar c5[] = { 0xA6F2 }; | |
| 420 codePath = Font::characterRangeCodePath(c5, 1); | |
| 421 EXPECT_EQ(Font::Simple, codePath); | |
| 422 } | |
| 423 | |
| 424 TEST(FontTest, TestCharacterRangeCodePath17) | |
| 425 { | |
| 426 static UChar c1[] = { 0xA7FF }; | |
| 427 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 428 EXPECT_EQ(Font::Simple, codePath); | |
| 429 | |
| 430 static UChar c2[] = { 0xA800 }; | |
| 431 codePath = Font::characterRangeCodePath(c2, 1); | |
| 432 EXPECT_EQ(Font::Complex, codePath); | |
| 433 | |
| 434 static UChar c3[] = { 0xAA00 }; | |
| 435 codePath = Font::characterRangeCodePath(c3, 1); | |
| 436 EXPECT_EQ(Font::Complex, codePath); | |
| 437 | |
| 438 static UChar c4[] = { 0xABFF }; | |
| 439 codePath = Font::characterRangeCodePath(c4, 1); | |
| 440 EXPECT_EQ(Font::Complex, codePath); | |
| 441 | |
| 442 static UChar c5[] = { 0xAC00 }; | |
| 443 codePath = Font::characterRangeCodePath(c5, 1); | |
| 444 EXPECT_EQ(Font::Simple, codePath); | |
| 445 } | |
| 446 | |
| 447 TEST(FontTest, TestCharacterRangeCodePath18) | |
| 448 { | |
| 449 static UChar c1[] = { 0xD7AF }; | |
| 450 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 451 EXPECT_EQ(Font::Simple, codePath); | |
| 452 | |
| 453 static UChar c2[] = { 0xD7B0 }; | |
| 454 codePath = Font::characterRangeCodePath(c2, 1); | |
| 455 EXPECT_EQ(Font::Complex, codePath); | |
| 456 | |
| 457 static UChar c3[] = { 0xD7F0 }; | |
| 458 codePath = Font::characterRangeCodePath(c3, 1); | |
| 459 EXPECT_EQ(Font::Complex, codePath); | |
| 460 | |
| 461 static UChar c4[] = { 0xD7FF }; | |
| 462 codePath = Font::characterRangeCodePath(c4, 1); | |
| 463 EXPECT_EQ(Font::Complex, codePath); | |
| 464 | |
| 465 static UChar c5[] = { 0xD800 }; | |
| 466 codePath = Font::characterRangeCodePath(c5, 1); | |
| 467 EXPECT_EQ(Font::Simple, codePath); | |
| 468 } | |
| 469 | |
| 470 TEST(FontTest, TestCharacterRangeCodePath19) | |
| 471 { | |
| 472 static UChar c1[] = { 0xFDFF }; | |
| 473 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 474 EXPECT_EQ(Font::Simple, codePath); | |
| 475 | |
| 476 static UChar c2[] = { 0xFE00 }; | |
| 477 codePath = Font::characterRangeCodePath(c2, 1); | |
| 478 EXPECT_EQ(Font::Complex, codePath); | |
| 479 | |
| 480 static UChar c3[] = { 0xFE05 }; | |
| 481 codePath = Font::characterRangeCodePath(c3, 1); | |
| 482 EXPECT_EQ(Font::Complex, codePath); | |
| 483 | |
| 484 static UChar c4[] = { 0xFE0F }; | |
| 485 codePath = Font::characterRangeCodePath(c4, 1); | |
| 486 EXPECT_EQ(Font::Complex, codePath); | |
| 487 | |
| 488 static UChar c5[] = { 0xFE10 }; | |
| 489 codePath = Font::characterRangeCodePath(c5, 1); | |
| 490 EXPECT_EQ(Font::Simple, codePath); | |
| 491 } | |
| 492 | |
| 493 TEST(FontTest, TestCharacterRangeCodePath20) | |
| 494 { | |
| 495 static UChar c1[] = { 0xFD1F }; | |
| 496 Font::CodePath codePath = Font::characterRangeCodePath(c1, 1); | |
| 497 EXPECT_EQ(Font::Simple, codePath); | |
| 498 | |
| 499 static UChar c2[] = { 0xFE20 }; | |
| 500 codePath = Font::characterRangeCodePath(c2, 1); | |
| 501 EXPECT_EQ(Font::Complex, codePath); | |
| 502 | |
| 503 static UChar c3[] = { 0xFE28 }; | |
| 504 codePath = Font::characterRangeCodePath(c3, 1); | |
| 505 EXPECT_EQ(Font::Complex, codePath); | |
| 506 | |
| 507 static UChar c4[] = { 0xFE2F }; | |
| 508 codePath = Font::characterRangeCodePath(c4, 1); | |
| 509 EXPECT_EQ(Font::Complex, codePath); | |
| 510 | |
| 511 static UChar c5[] = { 0xFE30 }; | |
| 512 codePath = Font::characterRangeCodePath(c5, 1); | |
| 513 EXPECT_EQ(Font::Simple, codePath); | |
| 514 } | 100 } |
| 515 | 101 |
| 516 TEST(FontTest, TestCharacterRangeCodePathSurrogate1) | 102 TEST(FontTest, TestCharacterRangeCodePathSurrogate1) |
| 517 { | 103 { |
| 518 /* To be surrogate ... */ | 104 /* To be surrogate ... */ |
| 519 /* 1st character must be 0xD800 .. 0xDBFF */ | 105 /* 1st character must be 0xD800 .. 0xDBFF */ |
| 520 /* 2nd character must be 0xdc00 .. 0xdfff */ | 106 /* 2nd character must be 0xdc00 .. 0xdfff */ |
| 521 | 107 |
| 522 /* The following 5 should all be Simple because they are not surrogate. */ | 108 /* The following 5 should all be Simple because they are not surrogate. */ |
| 523 static UChar c1[] = { 0xD800, 0xDBFE }; | 109 static UChar c1[] = { 0xD800, 0xDBFE }; |
| 524 Font::CodePath codePath = Font::characterRangeCodePath(c1, 2); | 110 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c1, 2)); |
| 525 EXPECT_EQ(Font::Simple, codePath); | |
| 526 | |
| 527 static UChar c2[] = { 0xD800, 0xE000 }; | 111 static UChar c2[] = { 0xD800, 0xE000 }; |
| 528 codePath = Font::characterRangeCodePath(c2, 2); | 112 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c2, 2)); |
| 529 EXPECT_EQ(Font::Simple, codePath); | |
| 530 | |
| 531 static UChar c3[] = { 0xDBFF, 0xDBFE }; | 113 static UChar c3[] = { 0xDBFF, 0xDBFE }; |
| 532 codePath = Font::characterRangeCodePath(c3, 2); | 114 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c3, 2)); |
| 533 EXPECT_EQ(Font::Simple, codePath); | |
| 534 | |
| 535 static UChar c4[] = { 0xDBFF, 0xE000 }; | 115 static UChar c4[] = { 0xDBFF, 0xE000 }; |
| 536 codePath = Font::characterRangeCodePath(c4, 2); | 116 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c4, 2)); |
| 537 EXPECT_EQ(Font::Simple, codePath); | |
| 538 | |
| 539 static UChar c5[] = { 0xDC00, 0xDBFF }; | 117 static UChar c5[] = { 0xDC00, 0xDBFF }; |
| 540 codePath = Font::characterRangeCodePath(c5, 2); | 118 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c5, 2)); |
| 541 EXPECT_EQ(Font::Simple, codePath); | |
| 542 | 119 |
| 543 /* To be Complex, the Supplementary Character must be in either */ | 120 /* To be Complex, the Supplementary Character must be in either */ |
| 544 /* U+1F1E6 through U+1F1FF or U+E0100 through U+E01EF. */ | 121 /* U+1F1E6 through U+1F1FF or U+E0100 through U+E01EF. */ |
| 545 /* That is, a lead of 0xD83C with trail 0xDDE6 .. 0xDDFF or */ | 122 /* That is, a lead of 0xD83C with trail 0xDDE6 .. 0xDDFF or */ |
| 546 /* a lead of 0xDB40 with trail 0xDD00 .. 0xDDEF. */ | 123 /* a lead of 0xDB40 with trail 0xDD00 .. 0xDDEF. */ |
| 547 static UChar c6[] = { 0xD83C, 0xDDE5 }; | 124 static UChar c6[] = { 0xD83C, 0xDDE5 }; |
| 548 codePath = Font::characterRangeCodePath(c6, 2); | 125 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c6, 2)); |
| 549 EXPECT_EQ(Font::Simple, codePath); | |
| 550 | |
| 551 static UChar c7[] = { 0xD83C, 0xDDE6 }; | 126 static UChar c7[] = { 0xD83C, 0xDDE6 }; |
| 552 codePath = Font::characterRangeCodePath(c7, 2); | 127 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c7, 2)); |
| 553 EXPECT_EQ(Font::Complex, codePath); | |
| 554 | |
| 555 static UChar c8[] = { 0xD83C, 0xDDF0 }; | 128 static UChar c8[] = { 0xD83C, 0xDDF0 }; |
| 556 codePath = Font::characterRangeCodePath(c8, 2); | 129 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c8, 2)); |
| 557 EXPECT_EQ(Font::Complex, codePath); | |
| 558 | |
| 559 static UChar c9[] = { 0xD83C, 0xDDFF }; | 130 static UChar c9[] = { 0xD83C, 0xDDFF }; |
| 560 codePath = Font::characterRangeCodePath(c9, 2); | 131 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c9, 2)); |
| 561 EXPECT_EQ(Font::Complex, codePath); | |
| 562 | |
| 563 static UChar c10[] = { 0xD83C, 0xDE00 }; | 132 static UChar c10[] = { 0xD83C, 0xDE00 }; |
| 564 codePath = Font::characterRangeCodePath(c10, 2); | 133 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c10, 2)); |
| 565 EXPECT_EQ(Font::Simple, codePath); | |
| 566 | 134 |
| 567 static UChar c11[] = { 0xDB40, 0xDCFF }; | 135 static UChar c11[] = { 0xDB40, 0xDCFF }; |
| 568 codePath = Font::characterRangeCodePath(c11, 2); | 136 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c11, 2)); |
| 569 EXPECT_EQ(Font::Simple, codePath); | |
| 570 | |
| 571 static UChar c12[] = { 0xDB40, 0xDD00 }; | 137 static UChar c12[] = { 0xDB40, 0xDD00 }; |
| 572 codePath = Font::characterRangeCodePath(c12, 2); | 138 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c12, 2)); |
| 573 EXPECT_EQ(Font::Complex, codePath); | |
| 574 | |
| 575 static UChar c13[] = { 0xDB40, 0xDDED }; | 139 static UChar c13[] = { 0xDB40, 0xDDED }; |
| 576 codePath = Font::characterRangeCodePath(c13, 2); | 140 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c13, 2)); |
| 577 EXPECT_EQ(Font::Complex, codePath); | |
| 578 | |
| 579 static UChar c14[] = { 0xDB40, 0xDDEF }; | 141 static UChar c14[] = { 0xDB40, 0xDDEF }; |
| 580 codePath = Font::characterRangeCodePath(c14, 2); | 142 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c14, 2)); |
| 581 EXPECT_EQ(Font::Complex, codePath); | |
| 582 | |
| 583 static UChar c15[] = { 0xDB40, 0xDDF0 }; | 143 static UChar c15[] = { 0xDB40, 0xDDF0 }; |
| 584 codePath = Font::characterRangeCodePath(c15, 2); | 144 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c15, 2)); |
| 585 EXPECT_EQ(Font::Simple, codePath); | |
| 586 } | 145 } |
| 587 | 146 |
| 588 TEST(FontTest, TestCharacterRangeCodePathString) | 147 TEST(FontTest, TestCharacterRangeCodePathString) |
| 589 { | 148 { |
| 590 // Simple-Simple is still simple | 149 // Simple-Simple is still simple |
| 591 static UChar c1[] = { 0x2FF, 0x2FF }; | 150 static UChar c1[] = { 0x2FF, 0x2FF }; |
| 592 Font::CodePath codePath = Font::characterRangeCodePath(c1, 2); | 151 EXPECT_EQ(Font::Simple, Font::characterRangeCodePath(c1, 2)); |
| 593 EXPECT_EQ(Font::Simple, codePath); | |
| 594 | |
| 595 // Complex-Simple is Complex | 152 // Complex-Simple is Complex |
| 596 static UChar c2[] = { 0x300, 0x2FF }; | 153 static UChar c2[] = { 0x300, 0x2FF }; |
| 597 codePath = Font::characterRangeCodePath(c2, 2); | 154 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c2, 2)); |
| 598 EXPECT_EQ(Font::Complex, codePath); | |
| 599 | |
| 600 // Simple-Complex is Complex | 155 // Simple-Complex is Complex |
| 601 static UChar c3[] = { 0x2FF, 0x330 }; | 156 static UChar c3[] = { 0x2FF, 0x330 }; |
| 602 codePath = Font::characterRangeCodePath(c3, 2); | 157 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c3, 2)); |
| 603 EXPECT_EQ(Font::Complex, codePath); | |
| 604 | |
| 605 // Complex-Complex is Complex | 158 // Complex-Complex is Complex |
| 606 static UChar c4[] = { 0x36F, 0x330 }; | 159 static UChar c4[] = { 0x36F, 0x330 }; |
| 607 codePath = Font::characterRangeCodePath(c4, 2); | 160 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c4, 2)); |
| 608 EXPECT_EQ(Font::Complex, codePath); | |
| 609 | |
| 610 // SimpleWithGlyphOverflow-Simple is SimpleWithGlyphOverflow | 161 // SimpleWithGlyphOverflow-Simple is SimpleWithGlyphOverflow |
| 611 static UChar c5[] = { 0x1E00, 0x2FF }; | 162 static UChar c5[] = { 0x1E00, 0x2FF }; |
| 612 codePath = Font::characterRangeCodePath(c5, 2); | 163 EXPECT_EQ(Font::SimpleWithGlyphOverflow, Font::characterRangeCodePath(c5, 2)
); |
| 613 EXPECT_EQ(Font::SimpleWithGlyphOverflow, codePath); | |
| 614 | |
| 615 // Simple-SimpleWithGlyphOverflow is SimpleWithGlyphOverflow | 164 // Simple-SimpleWithGlyphOverflow is SimpleWithGlyphOverflow |
| 616 static UChar c6[] = { 0x2FF, 0x2000 }; | 165 static UChar c6[] = { 0x2FF, 0x2000 }; |
| 617 codePath = Font::characterRangeCodePath(c6, 2); | 166 EXPECT_EQ(Font::SimpleWithGlyphOverflow, Font::characterRangeCodePath(c6, 2)
); |
| 618 EXPECT_EQ(Font::SimpleWithGlyphOverflow, codePath); | |
| 619 | |
| 620 // SimpleWithGlyphOverflow-Complex is Complex | 167 // SimpleWithGlyphOverflow-Complex is Complex |
| 621 static UChar c7[] = { 0x1E00, 0x330 }; | 168 static UChar c7[] = { 0x1E00, 0x330 }; |
| 622 codePath = Font::characterRangeCodePath(c7, 2); | 169 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c7, 2)); |
| 623 EXPECT_EQ(Font::Complex, codePath); | |
| 624 | |
| 625 // Complex-SimpleWithGlyphOverflow is Complex | 170 // Complex-SimpleWithGlyphOverflow is Complex |
| 626 static UChar c8[] = { 0x330, 0x2000 }; | 171 static UChar c8[] = { 0x330, 0x2000 }; |
| 627 codePath = Font::characterRangeCodePath(c8, 2); | 172 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c8, 2)); |
| 628 EXPECT_EQ(Font::Complex, codePath); | |
| 629 | |
| 630 // Surrogate-Complex is Complex | 173 // Surrogate-Complex is Complex |
| 631 static UChar c9[] = { 0xD83C, 0xDDE5, 0x330 }; | 174 static UChar c9[] = { 0xD83C, 0xDDE5, 0x330 }; |
| 632 codePath = Font::characterRangeCodePath(c9, 3); | 175 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c9, 3)); |
| 633 EXPECT_EQ(Font::Complex, codePath); | |
| 634 | |
| 635 // Complex-Surrogate is Complex | 176 // Complex-Surrogate is Complex |
| 636 static UChar c10[] = { 0x330, 0xD83C, 0xDDE5 }; | 177 static UChar c10[] = { 0x330, 0xD83C, 0xDDE5 }; |
| 637 codePath = Font::characterRangeCodePath(c10, 3); | 178 EXPECT_EQ(Font::Complex, Font::characterRangeCodePath(c10, 3)); |
| 638 EXPECT_EQ(Font::Complex, codePath); | 179 } |
| 639 } | 180 |
| 640 | 181 static void TestSpecificUChar32RangeIdeograph(UChar32 rangeStart, UChar32 rangeE
nd) |
| 182 { |
| 183 EXPECT_FALSE(Font::isCJKIdeograph(rangeStart - 1)); |
| 184 EXPECT_TRUE(Font::isCJKIdeograph(rangeStart)); |
| 185 EXPECT_TRUE(Font::isCJKIdeograph((UChar32)((uint64_t)rangeStart + (uint64_t)
rangeEnd) / 2)); |
| 186 EXPECT_TRUE(Font::isCJKIdeograph(rangeEnd)); |
| 187 EXPECT_FALSE(Font::isCJKIdeograph(rangeEnd + 1)); |
| 188 } |
| 189 |
| 190 TEST(FontTest, TestIsCJKIdeograph) |
| 191 { |
| 192 // The basic CJK Unified Ideographs block. |
| 193 TestSpecificUChar32RangeIdeograph(0x4E00, 0x9FFF); |
| 194 // CJK Unified Ideographs Extension A. |
| 195 TestSpecificUChar32RangeIdeograph(0x3400, 0x4DBF); |
| 196 // CJK Unified Ideographs Extension A and Kangxi Radicals. |
| 197 TestSpecificUChar32RangeIdeograph(0x2E80, 0x2FDF); |
| 198 // CJK Strokes. |
| 199 TestSpecificUChar32RangeIdeograph(0x31C0, 0x31EF); |
| 200 // CJK Compatibility Ideographs. |
| 201 TestSpecificUChar32RangeIdeograph(0xF900, 0xFAFF); |
| 202 // CJK Unified Ideographs Extension B. |
| 203 TestSpecificUChar32RangeIdeograph(0x20000, 0x2A6DF); |
| 204 // CJK Unified Ideographs Extension C. |
| 205 // CJK Unified Ideographs Extension D. |
| 206 TestSpecificUChar32RangeIdeograph(0x2A700, 0x2B81F); |
| 207 // CJK Compatibility Ideographs Supplement. |
| 208 TestSpecificUChar32RangeIdeograph(0x2F800, 0x2FA1F); |
| 209 } |
| 210 |
| 211 static void TestSpecificUChar32RangeIdeographSymbol(UChar32 rangeStart, UChar32
rangeEnd) |
| 212 { |
| 213 EXPECT_FALSE(Font::isCJKIdeographOrSymbol(rangeStart - 1)); |
| 214 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(rangeStart)); |
| 215 EXPECT_TRUE(Font::isCJKIdeographOrSymbol((UChar32)((uint64_t)rangeStart + (u
int64_t)rangeEnd) / 2)); |
| 216 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(rangeEnd)); |
| 217 EXPECT_FALSE(Font::isCJKIdeographOrSymbol(rangeEnd + 1)); |
| 218 } |
| 219 |
| 220 TEST(FontTest, TestIsCJKIdeographOrSymbol) |
| 221 { |
| 222 // CJK Compatibility Ideographs Supplement. |
| 223 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2C7)); |
| 224 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2CA)); |
| 225 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2CB)); |
| 226 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2D9)); |
| 227 |
| 228 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2020)); |
| 229 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2021)); |
| 230 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2030)); |
| 231 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x203B)); |
| 232 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x203C)); |
| 233 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2042)); |
| 234 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2047)); |
| 235 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2048)); |
| 236 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2049)); |
| 237 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2051)); |
| 238 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x20DD)); |
| 239 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x20DE)); |
| 240 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2100)); |
| 241 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2103)); |
| 242 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2105)); |
| 243 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2109)); |
| 244 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x210A)); |
| 245 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2113)); |
| 246 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2116)); |
| 247 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2121)); |
| 248 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x212B)); |
| 249 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x213B)); |
| 250 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2150)); |
| 251 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2151)); |
| 252 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2152)); |
| 253 |
| 254 TestSpecificUChar32RangeIdeographSymbol(0x2156, 0x215A); |
| 255 TestSpecificUChar32RangeIdeographSymbol(0x2160, 0x216B); |
| 256 TestSpecificUChar32RangeIdeographSymbol(0x2170, 0x217B); |
| 257 |
| 258 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x217F)); |
| 259 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2189)); |
| 260 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2307)); |
| 261 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2312)); |
| 262 |
| 263 EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x23BD)); |
| 264 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x23BE)); |
| 265 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x23C4)); |
| 266 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x23CC)); |
| 267 EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x23CD)); |
| 268 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x23CE)); |
| 269 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2423)); |
| 270 |
| 271 TestSpecificUChar32RangeIdeographSymbol(0x2460, 0x2492); |
| 272 TestSpecificUChar32RangeIdeographSymbol(0x249C, 0x24FF); |
| 273 |
| 274 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25A0)); |
| 275 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25A1)); |
| 276 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25A2)); |
| 277 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25AA)); |
| 278 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25AB)); |
| 279 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B1)); |
| 280 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B2)); |
| 281 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B3)); |
| 282 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B6)); |
| 283 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25B7)); |
| 284 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25BC)); |
| 285 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25BD)); |
| 286 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C0)); |
| 287 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C1)); |
| 288 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C6)); |
| 289 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C7)); |
| 290 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25C9)); |
| 291 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25CB)); |
| 292 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25CC)); |
| 293 |
| 294 TestSpecificUChar32RangeIdeographSymbol(0x25CE, 0x25D3); |
| 295 TestSpecificUChar32RangeIdeographSymbol(0x25E2, 0x25E6); |
| 296 |
| 297 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x25EF)); |
| 298 |
| 299 TestSpecificUChar32RangeIdeographSymbol(0x2600, 0x2603); |
| 300 |
| 301 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2605)); |
| 302 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2606)); |
| 303 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x260E)); |
| 304 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2616)); |
| 305 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2617)); |
| 306 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2640)); |
| 307 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2642)); |
| 308 |
| 309 TestSpecificUChar32RangeIdeographSymbol(0x2660, 0x266F); |
| 310 TestSpecificUChar32RangeIdeographSymbol(0x2672, 0x267D); |
| 311 |
| 312 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x26A0)); |
| 313 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x26BD)); |
| 314 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x26BE)); |
| 315 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2713)); |
| 316 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x271A)); |
| 317 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x273F)); |
| 318 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2740)); |
| 319 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2756)); |
| 320 |
| 321 TestSpecificUChar32RangeIdeographSymbol(0x2776, 0x277F); |
| 322 |
| 323 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x2B1A)); |
| 324 |
| 325 TestSpecificUChar32RangeIdeographSymbol(0x2FF0, 0x302F); |
| 326 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x3031)); |
| 327 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x312F)); |
| 328 EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x3130)); |
| 329 |
| 330 EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x318F)); |
| 331 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x3190)); |
| 332 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x319F)); |
| 333 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x31BF)); |
| 334 |
| 335 EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0x31FF)); |
| 336 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x3200)); |
| 337 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x3300)); |
| 338 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x33FF)); |
| 339 |
| 340 TestSpecificUChar32RangeIdeographSymbol(0xF860, 0xF862); |
| 341 TestSpecificUChar32RangeIdeographSymbol(0xFE30, 0xFE4F); |
| 342 |
| 343 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0xFE10)); |
| 344 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0xFE11)); |
| 345 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0xFE12)); |
| 346 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0xFE19)); |
| 347 |
| 348 EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0xFF0D)); |
| 349 EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0xFF1B)); |
| 350 EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0xFF1C)); |
| 351 EXPECT_FALSE(Font::isCJKIdeographOrSymbol(0xFF1E)); |
| 352 |
| 353 TestSpecificUChar32RangeIdeographSymbol(0xFF00, 0xFFEF); |
| 354 |
| 355 EXPECT_TRUE(Font::isCJKIdeographOrSymbol(0x1F100)); |
| 356 |
| 357 TestSpecificUChar32RangeIdeographSymbol(0x1F110, 0x1F129); |
| 358 TestSpecificUChar32RangeIdeographSymbol(0x1F130, 0x1F149); |
| 359 TestSpecificUChar32RangeIdeographSymbol(0x1F150, 0x1F169); |
| 360 TestSpecificUChar32RangeIdeographSymbol(0x1F170, 0x1F189); |
| 361 TestSpecificUChar32RangeIdeographSymbol(0x1F200, 0x1F6FF); |
| 362 } |
| 641 | 363 |
| 642 } // namespace WebCore | 364 } // namespace WebCore |
| 643 | 365 |
| OLD | NEW |