Chromium Code Reviews| 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]); |