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

Unified Diff: ui/gfx/render_text_harfbuzz.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: comments addressed 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
« no previous file with comments | « ui/gfx/render_text_harfbuzz.h ('k') | ui/gfx/render_text_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_harfbuzz.cc
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
index 3ee533290ca729bb9871427740e29c597c6d1489..653775a09f669e45107840a7f505810dcbe296e7 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -1104,18 +1104,32 @@ void RenderTextHarfBuzz::ShapeRun(internal::TextRunHarfBuzz* run) {
#if defined(OS_WIN)
Font uniscribe_font;
+ bool got_uniscribe_font = false;
const base::char16* run_text = &(GetLayoutText()[run->range.start()]);
if (GetUniscribeFallbackFont(primary_font, run_text, run->range.length(),
- &uniscribe_font) &&
- CompareFamily(run, uniscribe_font.GetFontName(),
- uniscribe_font.GetFontRenderParams(),
- &best_family, &best_render_params, &best_missing_glyphs))
- return;
+ &uniscribe_font)) {
+ got_uniscribe_font = true;
+ if (CompareFamily(run, uniscribe_font.GetFontName(),
+ uniscribe_font.GetFontRenderParams(),
+ &best_family, &best_render_params, &best_missing_glyphs))
+ return;
+ }
#endif
- // Skip the first fallback font, which is |primary_font|.
std::vector<std::string> fallback_families =
GetFallbackFontFamilies(primary_font.GetFontName());
+
+#if defined(OS_WIN)
+ // Append fonts in the fallback list of the Uniscribe font.
+ if (got_uniscribe_font) {
+ std::vector<std::string> uniscribe_fallbacks =
+ GetFallbackFontFamilies(uniscribe_font.GetFontName());
+ fallback_families.insert(fallback_families.end(),
+ uniscribe_fallbacks.begin(), uniscribe_fallbacks.end());
Daniel Erat 2014/10/28 14:32:59 patch set 2 skipped the first uniscribe fallback f
ckocagil 2014/10/28 17:39:04 Yes, fixed.
+ }
+#endif
+
+ // Skip the first fallback font, which is |primary_font|.
for (size_t i = 1; i < fallback_families.size(); ++i) {
FontRenderParamsQuery query(false);
query.families.push_back(fallback_families[i]);
« no previous file with comments | « ui/gfx/render_text_harfbuzz.h ('k') | ui/gfx/render_text_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698