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 | 8 |
9 #include "base/i18n/bidi_line_iterator.h" | 9 #include "base/i18n/bidi_line_iterator.h" |
10 #include "base/i18n/break_iterator.h" | 10 #include "base/i18n/break_iterator.h" |
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 GetFallbackFontFamilies(primary_family); | 1248 GetFallbackFontFamilies(primary_family); |
1249 | 1249 |
1250 #if defined(OS_WIN) | 1250 #if defined(OS_WIN) |
1251 // Append fonts in the fallback list of the Uniscribe font. | 1251 // Append fonts in the fallback list of the Uniscribe font. |
1252 if (!uniscribe_family.empty()) { | 1252 if (!uniscribe_family.empty()) { |
1253 std::vector<std::string> uniscribe_fallbacks = | 1253 std::vector<std::string> uniscribe_fallbacks = |
1254 GetFallbackFontFamilies(uniscribe_family); | 1254 GetFallbackFontFamilies(uniscribe_family); |
1255 fallback_families.insert(fallback_families.end(), | 1255 fallback_families.insert(fallback_families.end(), |
1256 uniscribe_fallbacks.begin(), uniscribe_fallbacks.end()); | 1256 uniscribe_fallbacks.begin(), uniscribe_fallbacks.end()); |
1257 } | 1257 } |
| 1258 |
| 1259 // Add Segoe UI and its associated linked fonts to the fallback font list to |
| 1260 // ensure that the fallback list covers the basic cases. |
| 1261 // http://crbug.com/467459. On some Windows configurations the default font |
| 1262 // could be a raster font like System, which would not give us a reasonable |
| 1263 // fallback font list. |
| 1264 std::vector<std::string> default_fallback_families = |
| 1265 GetFallbackFontFamilies("Segoe UI"); |
| 1266 fallback_families.insert(fallback_families.end(), |
| 1267 default_fallback_families.begin(), default_fallback_families.end()); |
1258 #endif | 1268 #endif |
1259 | 1269 |
1260 // Try shaping with the fallback fonts. | 1270 // Try shaping with the fallback fonts. |
1261 for (const auto& family : fallback_families) { | 1271 for (const auto& family : fallback_families) { |
1262 if (family == primary_family) | 1272 if (family == primary_family) |
1263 continue; | 1273 continue; |
1264 #if defined(OS_WIN) | 1274 #if defined(OS_WIN) |
1265 if (family == uniscribe_family) | 1275 if (family == uniscribe_family) |
1266 continue; | 1276 continue; |
1267 #endif | 1277 #endif |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 DCHECK(!update_layout_run_list_); | 1478 DCHECK(!update_layout_run_list_); |
1469 DCHECK(!update_display_run_list_); | 1479 DCHECK(!update_display_run_list_); |
1470 return text_elided() ? display_run_list_.get() : &layout_run_list_; | 1480 return text_elided() ? display_run_list_.get() : &layout_run_list_; |
1471 } | 1481 } |
1472 | 1482 |
1473 const internal::TextRunList* RenderTextHarfBuzz::GetRunList() const { | 1483 const internal::TextRunList* RenderTextHarfBuzz::GetRunList() const { |
1474 return const_cast<RenderTextHarfBuzz*>(this)->GetRunList(); | 1484 return const_cast<RenderTextHarfBuzz*>(this)->GetRunList(); |
1475 } | 1485 } |
1476 | 1486 |
1477 } // namespace gfx | 1487 } // namespace gfx |
OLD | NEW |