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

Unified Diff: ui/gfx/render_text_unittest.cc

Issue 674233003: RenderTextHarfBuzz: Try fallback fonts of the Uniscribe font while shaping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix include Created 6 years, 2 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
Index: ui/gfx/render_text_unittest.cc
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc
index e7115814759bc19c5979bb605416db0265d23d8c..876c8a8e0ba68c97607872a495e4d8ea4e294843 100644
--- a/ui/gfx/render_text_unittest.cc
+++ b/ui/gfx/render_text_unittest.cc
@@ -20,6 +20,7 @@
#if defined(OS_WIN)
#include "base/win/windows_version.h"
+#include "ui/gfx/platform_font_win.h"
#include "ui/gfx/render_text_win.h"
#endif
@@ -30,6 +31,7 @@
using base::ASCIIToUTF16;
using base::UTF8ToUTF16;
using base::WideToUTF16;
+using base::WideToUTF8;
namespace gfx {
@@ -2352,4 +2354,23 @@ TEST_F(RenderTextTest, FontListFallback) {
}
#endif // !defined(OS_WIN)
+// 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");
+ FontList font_list((Font(font_win)));
+
+ 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

Powered by Google App Engine
This is Rietveld 408576698