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 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1283 GetFallbackFontFamilies(primary_family); | 1283 GetFallbackFontFamilies(primary_family); |
1284 | 1284 |
1285 #if defined(OS_WIN) | 1285 #if defined(OS_WIN) |
1286 // Append fonts in the fallback list of the Uniscribe font. | 1286 // Append fonts in the fallback list of the Uniscribe font. |
1287 if (!uniscribe_family.empty()) { | 1287 if (!uniscribe_family.empty()) { |
1288 std::vector<std::string> uniscribe_fallbacks = | 1288 std::vector<std::string> uniscribe_fallbacks = |
1289 GetFallbackFontFamilies(uniscribe_family); | 1289 GetFallbackFontFamilies(uniscribe_family); |
1290 fallback_families.insert(fallback_families.end(), | 1290 fallback_families.insert(fallback_families.end(), |
1291 uniscribe_fallbacks.begin(), uniscribe_fallbacks.end()); | 1291 uniscribe_fallbacks.begin(), uniscribe_fallbacks.end()); |
1292 } | 1292 } |
1293 | |
1294 // Add Segoe UI and its associated linked fonts to the fallback font list to | |
1295 // ensure that the fallback list covers the basic cases. | |
1296 // http://crbug.com/467459. On some Windows configurations the default font | |
1297 // could be a raster font like System, which would not give us a reasonable | |
1298 // fallback font list. | |
1299 std::vector<std::string> default_fallback_families = | |
1300 GetFallbackFontFamilies("Segoe UI"); | |
msw
2015/03/18 15:53:23
(1) Why does the bug only occur with DirectWrite?
scottmg
2015/03/18 16:13:04
It's definitely quite a mess. We did reproduce cor
ananta
2015/03/18 18:41:12
The current approach of font fallback does not wor
| |
1301 fallback_families.insert(fallback_families.end(), | |
1302 default_fallback_families.begin(), default_fallback_families.end()); | |
1293 #endif | 1303 #endif |
1294 | 1304 |
1295 // Try shaping with the fallback fonts. | 1305 // Try shaping with the fallback fonts. |
1296 for (const auto& family : fallback_families) { | 1306 for (const auto& family : fallback_families) { |
1297 if (family == primary_family) | 1307 if (family == primary_family) |
1298 continue; | 1308 continue; |
1299 #if defined(OS_WIN) | 1309 #if defined(OS_WIN) |
1300 if (family == uniscribe_family) | 1310 if (family == uniscribe_family) |
1301 continue; | 1311 continue; |
1302 #endif | 1312 #endif |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1492 DCHECK(!update_layout_run_list_); | 1502 DCHECK(!update_layout_run_list_); |
1493 DCHECK(!update_display_run_list_); | 1503 DCHECK(!update_display_run_list_); |
1494 return text_elided() ? display_run_list_.get() : &layout_run_list_; | 1504 return text_elided() ? display_run_list_.get() : &layout_run_list_; |
1495 } | 1505 } |
1496 | 1506 |
1497 const internal::TextRunList* RenderTextHarfBuzz::GetRunList() const { | 1507 const internal::TextRunList* RenderTextHarfBuzz::GetRunList() const { |
1498 return const_cast<RenderTextHarfBuzz*>(this)->GetRunList(); | 1508 return const_cast<RenderTextHarfBuzz*>(this)->GetRunList(); |
1499 } | 1509 } |
1500 | 1510 |
1501 } // namespace gfx | 1511 } // namespace gfx |
OLD | NEW |