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

Unified Diff: Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp

Issue 1149693002: Add Unicode Variation Selector support to harfBuzzGetGlyph (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add -expected back that was accidentally removed during rebase 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 | « Source/platform/fonts/shaping/HarfBuzzShaper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp
diff --git a/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp b/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp
index 18ba9fb67a6eec54dedb121a96f3955fbc83c3b9..00ef055387769529377f4054eb7135dcd2c5e369 100644
--- a/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp
+++ b/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp
@@ -85,8 +85,19 @@ TEST_F(HarfBuzzShaperTest, ResolveCandidateRunsUnicodeVariants)
EXPECT_EQ(1u, shaper.numberOfRunsForTesting()) << test.name;
ASSERT_TRUE(shaper.runInfoForTesting(0, startIndex, numGlyphs, script)) << test.name;
EXPECT_EQ(0u, startIndex) << test.name;
- // TODO(kojii): HarfBuzzFace does not support UVS yet and numGlyphs becomes 2
- // EXPECT_EQ(1u, numGlyphs) << test.name;
+ if (numGlyphs == 2) {
+ // If the specified VS is not in the font, it's mapped to .notdef.
+ // then hb_ot_hide_default_ignorables() swaps it to a space with zero-advance.
+ // http://lists.freedesktop.org/archives/harfbuzz/2015-May/004888.html
+ // OpenType recommends Glyph ID 3 for a space; not a hard requirement though.
+ // https://www.microsoft.com/typography/otspec/recom.htm
+#if !OS(MACOSX)
+ EXPECT_EQ(3u, shaper.glyphForTesting(0, 1)) << test.name;
+#endif
+ EXPECT_EQ(0.f, shaper.advanceForTesting(0, 1)) << test.name;
+ } else {
+ EXPECT_EQ(1u, numGlyphs) << test.name;
+ }
EXPECT_EQ(test.script, script) << test.name;
}
}
« no previous file with comments | « Source/platform/fonts/shaping/HarfBuzzShaper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698