OLD | NEW |
---|---|
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 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1386 FontRenderParams best_render_params; | 1386 FontRenderParams best_render_params; |
1387 size_t best_missing_glyphs = std::numeric_limits<size_t>::max(); | 1387 size_t best_missing_glyphs = std::numeric_limits<size_t>::max(); |
1388 | 1388 |
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); |
msw
2016/06/23 20:59:38
nit: rename |fallback_font| or similar
Ilya Kulshin
2016/06/24 20:48:24
Done.
| |
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 Loading... | |
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 |
OLD | NEW |