Commit dae4b834 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Use IPA Mincho font on Linux instead of Kochi Mincho

Kochi Mincho is old and is not available on newer linux distros.  IPA Mincho is
a suitable replacement.  However, the IPA font metrics are slightly different
than Kochi.  There were some test expectations that certain font metrics (like
baseline) be different from Arial, but they're conincidentally not for IPA.  I
also swapped out Arial for Verdana so that the metrics would still be different.

BUG=812911
R=derat
TBR=asvitkine

Change-Id: Ida904c06ad8aa962ac850ff47cda1170103638fa
Reviewed-on: https://chromium-review.googlesource.com/923551Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarDan Erat <derat@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537456}
parent 0fbd51f0
...@@ -299,9 +299,9 @@ TEST(FontListTest, MAYBE_Fonts_DeriveWithSizeDelta) { ...@@ -299,9 +299,9 @@ TEST(FontListTest, MAYBE_Fonts_DeriveWithSizeDelta) {
#endif #endif
TEST(FontListTest, MAYBE_Fonts_GetHeight_GetBaseline) { TEST(FontListTest, MAYBE_Fonts_GetHeight_GetBaseline) {
// If a font list has only one font, the height and baseline must be the same. // If a font list has only one font, the height and baseline must be the same.
Font font1("Arial", 16); Font font1("Verdana", 16);
ASSERT_EQ("arial", base::ToLowerASCII(font1.GetActualFontNameForTesting())); ASSERT_EQ("verdana", base::ToLowerASCII(font1.GetActualFontNameForTesting()));
FontList font_list1("Arial, 16px"); FontList font_list1("Verdana, 16px");
EXPECT_EQ(font1.GetHeight(), font_list1.GetHeight()); EXPECT_EQ(font1.GetHeight(), font_list1.GetHeight());
EXPECT_EQ(font1.GetBaseline(), font_list1.GetBaseline()); EXPECT_EQ(font1.GetBaseline(), font_list1.GetBaseline());
......
...@@ -15,7 +15,7 @@ const char kSymbolFontName[] = "Symbol"; ...@@ -15,7 +15,7 @@ const char kSymbolFontName[] = "Symbol";
#endif #endif
#if defined(OS_LINUX) #if defined(OS_LINUX)
const char kCJKFontName[] = "Kochi Mincho"; const char kCJKFontName[] = "IPAMincho";
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
const char kCJKFontName[] = "Heiti SC"; const char kCJKFontName[] = "Heiti SC";
#else #else
......
...@@ -2502,25 +2502,26 @@ TEST_P(RenderTextTest, StringSizeEmptyString) { ...@@ -2502,25 +2502,26 @@ TEST_P(RenderTextTest, StringSizeEmptyString) {
} }
TEST_P(RenderTextTest, StringSizeRespectsFontListMetrics) { TEST_P(RenderTextTest, StringSizeRespectsFontListMetrics) {
// Check that Arial and the CJK font have different font metrics. // Check that Verdana and the CJK font have different font metrics.
Font arial_font("Arial", 16); Font verdana_font("Verdana", 16);
ASSERT_EQ("arial", ASSERT_EQ("verdana",
base::ToLowerASCII(arial_font.GetActualFontNameForTesting())); base::ToLowerASCII(verdana_font.GetActualFontNameForTesting()));
Font cjk_font(kCJKFontName, 16); Font cjk_font(kCJKFontName, 16);
ASSERT_EQ(base::ToLowerASCII(kCJKFontName), ASSERT_EQ(base::ToLowerASCII(kCJKFontName),
base::ToLowerASCII(cjk_font.GetActualFontNameForTesting())); base::ToLowerASCII(cjk_font.GetActualFontNameForTesting()));
EXPECT_NE(arial_font.GetHeight(), cjk_font.GetHeight()); EXPECT_NE(verdana_font.GetHeight(), cjk_font.GetHeight());
EXPECT_NE(arial_font.GetBaseline(), cjk_font.GetBaseline()); EXPECT_NE(verdana_font.GetBaseline(), cjk_font.GetBaseline());
// "a" should be rendered with Arial, not with the CJK font. // "a" should be rendered with Verdana, not with the CJK font.
const char* arial_font_text = "a"; const char* verdana_font_text = "a";
// "円" (U+5168 Han character YEN) should render with the CJK font, not Arial. // "円" (U+5168 Han character YEN) should render with the CJK font, not
// Verdana.
const char* cjk_font_text = "\u5168"; const char* cjk_font_text = "\u5168";
Font smaller_font = arial_font; Font smaller_font = verdana_font;
Font larger_font = cjk_font; Font larger_font = cjk_font;
const char* smaller_font_text = arial_font_text; const char* smaller_font_text = verdana_font_text;
const char* larger_font_text = cjk_font_text; const char* larger_font_text = cjk_font_text;
if (cjk_font.GetHeight() < arial_font.GetHeight() && if (cjk_font.GetHeight() < verdana_font.GetHeight() &&
cjk_font.GetBaseline() < arial_font.GetBaseline()) { cjk_font.GetBaseline() < verdana_font.GetBaseline()) {
std::swap(smaller_font, larger_font); std::swap(smaller_font, larger_font);
std::swap(smaller_font_text, larger_font_text); std::swap(smaller_font_text, larger_font_text);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment