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

Unified Diff: tests/FontHostTest.cpp

Issue 1163833003: Add cmap 3,0 (symbol) as Unicode fallback. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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_FreeType.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 ff275e2ad5ddbc83f6d80846985f35d281a181cb..db83e06b621a286c651840d9d6e29a9defd1abde 100644
--- a/tests/FontHostTest.cpp
+++ b/tests/FontHostTest.cpp
@@ -153,6 +153,22 @@ static void test_fontstream(skiatest::Reporter* reporter) {
}
}
+static void test_symbolfont(skiatest::Reporter* reporter) {
+ SkAutoTUnref<SkTypeface> typeface(GetResourceAsTypeface("/fonts/SpiderSymbol.ttf"));
+ if (!typeface) {
+ SkDebugf("Skipping FontHostTest::test_symbolfont\n");
+ return;
+ }
+
+ SkUnichar c = 0xf021;
+ uint16_t g;
+ SkPaint paint;
+ paint.setTypeface(typeface);
+ paint.setTextEncoding(SkPaint::kUTF32_TextEncoding);
+ paint.textToGlyphs(&c, 4, &g);
+ REPORTER_ASSERT(reporter, g == 3);
+}
+
static void test_tables(skiatest::Reporter* reporter, SkTypeface* face) {
if (false) { // avoid bit rot, suppress warning
SkFontID fontID = face->uniqueID();
@@ -295,6 +311,7 @@ DEF_TEST(FontHost, reporter) {
test_tables(reporter);
test_fontstream(reporter);
test_advances(reporter);
+ test_symbolfont(reporter);
}
// need tests for SkStrSearch
« no previous file with comments | « src/ports/SkFontHost_FreeType.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698