summaryrefslogtreecommitdiffstats
path: root/ui/gfx/render_text_harfbuzz.cc
diff options
context:
space:
mode:
authorderat <derat@chromium.org>2014-10-25 08:17:27 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-25 15:17:39 +0000
commit2e3cf521ff59c2a3f657a72af04892f4a5783d6a (patch)
tree1e6468965a97ea3b970f2e7ef5c79609cf85c506 /ui/gfx/render_text_harfbuzz.cc
parentb49fe047c1bb57b38e137d043ee0ad5f91a311ad (diff)
downloadchromium_src-2e3cf521ff59c2a3f657a72af04892f4a5783d6a.zip
chromium_src-2e3cf521ff59c2a3f657a72af04892f4a5783d6a.tar.gz
chromium_src-2e3cf521ff59c2a3f657a72af04892f4a5783d6a.tar.bz2
Make RenderTextHarfBuzz examine full font list.
When evaluating which font to use for a run, RenderTextHarfBuzz should examine all fonts in the font list that was supplied to it. Previously, it only tried the primary font before resorting to its fallback logic. BUG=none Review URL: https://codereview.chromium.org/678683003 Cr-Commit-Position: refs/heads/master@{#301284}
Diffstat (limited to 'ui/gfx/render_text_harfbuzz.cc')
-rw-r--r--ui/gfx/render_text_harfbuzz.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
index 3ee5332..642c76e 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -1097,10 +1097,11 @@ void RenderTextHarfBuzz::ShapeRun(internal::TextRunHarfBuzz* run) {
FontRenderParams best_render_params;
size_t best_missing_glyphs = std::numeric_limits<size_t>::max();
- if (CompareFamily(run, primary_font.GetFontName(),
- primary_font.GetFontRenderParams(),
- &best_family, &best_render_params, &best_missing_glyphs))
- return;
+ for (const Font& font : font_list().GetFonts()) {
+ if (CompareFamily(run, font.GetFontName(), font.GetFontRenderParams(),
+ &best_family, &best_render_params, &best_missing_glyphs))
+ return;
+ }
#if defined(OS_WIN)
Font uniscribe_font;