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..33b0349733f3cfc2b312f3d306ed9e750eec01fd 100644 |
| --- a/ui/gfx/render_text_harfbuzz.cc |
| +++ b/ui/gfx/render_text_harfbuzz.cc |
| @@ -1104,13 +1104,16 @@ 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|. |
| @@ -1127,6 +1130,24 @@ void RenderTextHarfBuzz::ShapeRun(internal::TextRunHarfBuzz* run) { |
| return; |
| } |
| + // Try fonts in the fallback list of the Uniscribe font. |
|
msw
2014/10/27 17:28:51
Shouldn't this be in an #if defined(OS_WIN) block?
ckocagil
2014/10/28 03:24:42
Done.
|
| + if (got_uniscribe_font) { |
| + fallback_families = |
| + GetFallbackFontFamilies(uniscribe_font.GetFontName()); |
| + for (size_t i = 1; i < fallback_families.size(); ++i) { |
|
Daniel Erat
2014/10/27 18:49:24
there's a bunch of duplicated code here. is the Ge
ckocagil
2014/10/28 03:24:42
Done.
|
| + FontRenderParamsQuery query(false); |
| + query.families.push_back(fallback_families[i]); |
| + query.pixel_size = run->font_size; |
| + query.style = run->font_style; |
| + FontRenderParams fallback_render_params = |
| + GetFontRenderParams(query, NULL); |
| + if (CompareFamily(run, fallback_families[i], fallback_render_params, |
| + &best_family, &best_render_params, |
| + &best_missing_glyphs)) |
| + return; |
| + } |
| + } |
| + |
| if (!best_family.empty() && |
| (best_family == run->family || |
| ShapeRunWithFont(run, best_family, best_render_params))) |