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

Unified Diff: tests/FontHostTest.cpp

Issue 596413002: Correct glyph with non-bmp from typeface on Mac. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « src/ports/SkFontHost_mac.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/FontHostTest.cpp
diff --git a/tests/FontHostTest.cpp b/tests/FontHostTest.cpp
index 0bb426afa8d8505242de610452f8189a9b031ada..249fe7b1fb054f9e41d9619f17200aa2dca22deb 100644
--- a/tests/FontHostTest.cpp
+++ b/tests/FontHostTest.cpp
@@ -68,9 +68,10 @@ static void test_countGlyphs(skiatest::Reporter* reporter, SkTypeface* face) {
}
// The following three are all the same code points in various encodings.
-static uint8_t utf8Chars[] = { 0x61, 0xE4, 0xB8, 0xAD, 0xD0, 0xAF, 0xD7, 0x99, 0xD7, 0x95, 0xF0, 0x9D, 0x84, 0x9E, 0x61 };
-static uint16_t utf16Chars[] = { 0x0061, 0x4E2D, 0x042F, 0x05D9, 0x05D5, 0xD834, 0xDD1E, 0x0061 };
-static uint32_t utf32Chars[] = { 0x00000061, 0x00004E2D, 0x0000042F, 0x000005D9, 0x000005D5, 0x0001D11E, 0x00000061 };
+// a中Яיו𝄞a𠮟
+static uint8_t utf8Chars[] = { 0x61, 0xE4,0xB8,0xAD, 0xD0,0xAF, 0xD7,0x99, 0xD7,0x95, 0xF0,0x9D,0x84,0x9E, 0x61, 0xF0,0xA0,0xAE,0x9F };
+static uint16_t utf16Chars[] = { 0x0061, 0x4E2D, 0x042F, 0x05D9, 0x05D5, 0xD834,0xDD1E, 0x0061, 0xD842,0xDF9F };
+static uint32_t utf32Chars[] = { 0x00000061, 0x00004E2D, 0x0000042F, 0x000005D9, 0x000005D5, 0x0001D11E, 0x00000061, 0x00020B9F };
struct CharsToGlyphs_TestData {
const void* chars;
@@ -79,9 +80,9 @@ struct CharsToGlyphs_TestData {
SkTypeface::Encoding typefaceEncoding;
const char* name;
} static charsToGlyphs_TestData[] = {
- { utf8Chars, 7, sizeof(utf8Chars), SkTypeface::kUTF8_Encoding, "Simple UTF-8" },
- { utf16Chars, 7, sizeof(utf16Chars), SkTypeface::kUTF16_Encoding, "Simple UTF-16" },
- { utf32Chars, 7, sizeof(utf32Chars), SkTypeface::kUTF32_Encoding, "Simple UTF-32" },
+ { utf8Chars, 8, sizeof(utf8Chars), SkTypeface::kUTF8_Encoding, "Simple UTF-8" },
+ { utf16Chars, 8, sizeof(utf16Chars), SkTypeface::kUTF16_Encoding, "Simple UTF-16" },
+ { utf32Chars, 8, sizeof(utf32Chars), SkTypeface::kUTF32_Encoding, "Simple UTF-32" },
};
// Test that SkPaint::textToGlyphs agrees with SkTypeface::charsToGlyphs.
@@ -210,8 +211,11 @@ static void test_tables(skiatest::Reporter* reporter, SkTypeface* face) {
static void test_tables(skiatest::Reporter* reporter) {
static const char* const gNames[] = {
NULL, // default font
- "Arial", "Times", "Times New Roman", "Helvetica", "Courier",
- "Courier New", "Terminal", "MS Sans Serif",
+ "Helvetica", "Arial",
+ "Times", "Times New Roman",
+ "Courier", "Courier New",
+ "Terminal", "MS Sans Serif",
+ "Hiragino Mincho ProN", "MS PGothic",
};
for (size_t i = 0; i < SK_ARRAY_COUNT(gNames); ++i) {
« no previous file with comments | « src/ports/SkFontHost_mac.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698