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

Unified Diff: ui/gfx/render_text_harfbuzz.cc

Issue 999173008: Don't add Segoe UI to the fallback font list if it is the system font. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build error Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_harfbuzz.cc
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
index 3c71cff58c57c1b5dabf7aacff9bf7cc9764be6e..a0a7b947a548087394a6b1b768ad5f89e275c152 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -10,6 +10,7 @@
#include "base/i18n/break_iterator.h"
#include "base/i18n/char_iterator.h"
#include "base/profiler/scoped_tracker.h"
+#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "third_party/harfbuzz-ng/src/hb.h"
@@ -1296,10 +1297,12 @@ void RenderTextHarfBuzz::ShapeRun(const base::string16& text,
// http://crbug.com/467459. On some Windows configurations the default font
// could be a raster font like System, which would not give us a reasonable
// fallback font list.
- std::vector<std::string> default_fallback_families =
- GetFallbackFontFamilies("Segoe UI");
- fallback_families.insert(fallback_families.end(),
- default_fallback_families.begin(), default_fallback_families.end());
+ if (!LowerCaseEqualsASCII(primary_family, "segoe ui")) {
msw 2015/03/24 17:38:52 nit: maybe check |uniscribe_family| too?
ananta 2015/03/24 20:10:12 Done.
+ std::vector<std::string> default_fallback_families =
+ GetFallbackFontFamilies("Segoe UI");
+ fallback_families.insert(fallback_families.end(),
+ default_fallback_families.begin(), default_fallback_families.end());
+ }
#endif
// Get rid of duplicate fonts in the fallback list. We use the std::unique
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698