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

Side by Side Diff: ui/gfx/render_text_harfbuzz.cc

Issue 2054273002: Font fallback for UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unittests Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/render_text_harfbuzz.h" 5 #include "ui/gfx/render_text_harfbuzz.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <set> 8 #include <set>
9 9
10 #include "base/i18n/bidi_line_iterator.h" 10 #include "base/i18n/bidi_line_iterator.h"
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 for (const Font& font : font_list().GetFonts()) { 1389 for (const Font& font : font_list().GetFonts()) {
1390 if (CompareFamily(text, font, font.GetFontRenderParams(), run, &best_font, 1390 if (CompareFamily(text, font, font.GetFontRenderParams(), run, &best_font,
1391 &best_render_params, &best_missing_glyphs)) 1391 &best_render_params, &best_missing_glyphs))
1392 return; 1392 return;
1393 } 1393 }
1394 1394
1395 #if defined(OS_WIN) 1395 #if defined(OS_WIN)
1396 Font uniscribe_font(primary_font); 1396 Font uniscribe_font(primary_font);
1397 std::string uniscribe_family; 1397 std::string uniscribe_family;
1398 const base::char16* run_text = &(text[run->range.start()]); 1398 const base::char16* run_text = &(text[run->range.start()]);
1399 if (GetUniscribeFallbackFont(primary_font, run_text, run->range.length(), 1399 if (GetFallbackFont(primary_font, run_text, run->range.length(),
1400 &uniscribe_font)) { 1400 &uniscribe_font)) {
1401 uniscribe_family = uniscribe_font.GetFontName(); 1401 uniscribe_family = uniscribe_font.GetFontName();
1402 if (CompareFamily(text, uniscribe_font, 1402 if (CompareFamily(text, uniscribe_font,
1403 uniscribe_font.GetFontRenderParams(), run, 1403 uniscribe_font.GetFontRenderParams(), run,
1404 &best_font, &best_render_params, &best_missing_glyphs)) 1404 &best_font, &best_render_params, &best_missing_glyphs))
1405 return; 1405 return;
1406 } 1406 }
1407 #endif 1407 #endif
1408 1408
1409 std::vector<Font> fallback_font_list = GetFallbackFonts(primary_font); 1409 std::vector<Font> fallback_font_list = GetFallbackFonts(primary_font);
1410 1410
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 DCHECK(!update_layout_run_list_); 1584 DCHECK(!update_layout_run_list_);
1585 DCHECK(!update_display_run_list_); 1585 DCHECK(!update_display_run_list_);
1586 return text_elided() ? display_run_list_.get() : &layout_run_list_; 1586 return text_elided() ? display_run_list_.get() : &layout_run_list_;
1587 } 1587 }
1588 1588
1589 const internal::TextRunList* RenderTextHarfBuzz::GetRunList() const { 1589 const internal::TextRunList* RenderTextHarfBuzz::GetRunList() const {
1590 return const_cast<RenderTextHarfBuzz*>(this)->GetRunList(); 1590 return const_cast<RenderTextHarfBuzz*>(this)->GetRunList();
1591 } 1591 }
1592 1592
1593 } // namespace gfx 1593 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698