Index: ui/gfx/render_text_unittest.cc |
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc |
index 1c6f902d936fb435827912df67561e1d1af51c51..69b420d69cf1e0ad5b0ba5ff09ade670fb292bbf 100644 |
--- a/ui/gfx/render_text_unittest.cc |
+++ b/ui/gfx/render_text_unittest.cc |
@@ -16,6 +16,7 @@ |
#include "ui/gfx/break_list.h" |
#include "ui/gfx/canvas.h" |
#include "ui/gfx/font.h" |
+#include "ui/gfx/platform_font_win.h" |
#include "ui/gfx/render_text_harfbuzz.h" |
#if defined(OS_WIN) |
@@ -30,6 +31,7 @@ |
using base::ASCIIToUTF16; |
using base::UTF8ToUTF16; |
using base::WideToUTF16; |
+using base::WideToUTF8; |
namespace gfx { |
@@ -2326,4 +2328,24 @@ TEST_F(RenderTextTest, StringFitsOwnWidth) { |
EXPECT_EQ(kString, render_text->GetLayoutText()); |
} |
+// Ensure that the fallback fonts of the Uniscribe font are tried for shaping. |
+#if defined(OS_WIN) |
+TEST_F(RenderTextTest, HarfBuzz_UniscribeFallback) { |
+ RenderTextHarfBuzz render_text; |
+ PlatformFontWin* font_win = new PlatformFontWin("Meiryo", 12); |
+ // Japanese name for Meiryo. This name won't be found in the system's linked |
+ // fonts, forcing RTHB to try the Uniscribe font and its fallbacks. |
+ font_win->font_ref_->font_name_ = WideToUTF8(L"\x30e1\x30a4\x30ea\x30aa"); |
+ Font font(font_win); |
+ FontList font_list(font); |
+ |
+ render_text.SetFontList(font_list); |
+ // Korean character "han". |
+ render_text.SetText(WideToUTF16(L"\xd55c")); |
+ render_text.EnsureLayout(); |
+ ASSERT_EQ(1U, render_text.runs_.size()); |
+ EXPECT_EQ(0U, render_text.runs_[0]->CountMissingGlyphs()); |
+} |
+#endif // defined(OS_WIN) |
+ |
} // namespace gfx |