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

Unified Diff: chrome/browser/ui/webui/options/font_settings_utils_win.cc

Issue 2441343003: Allow the default generic font family settings to find the first available font (Closed)
Patch Set: msw review Created 4 years, 2 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 | « chrome/browser/ui/webui/options/font_settings_utils_unittest.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/font_settings_utils_win.cc
diff --git a/chrome/browser/ui/webui/options/font_settings_utils_win.cc b/chrome/browser/ui/webui/options/font_settings_utils_win.cc
index c96c27f968daa1acb61d71413a819cf9e252f286..aa3dd7941eefdd68e62e99dbb1bcff5350c377b4 100644
--- a/chrome/browser/ui/webui/options/font_settings_utils_win.cc
+++ b/chrome/browser/ui/webui/options/font_settings_utils_win.cc
@@ -4,6 +4,9 @@
#include "chrome/browser/ui/webui/options/font_settings_utils.h"
+#include "ui/gfx/font.h"
+#include "ui/gfx/platform_font_win.h"
+
namespace options {
// static
@@ -11,4 +14,14 @@ void FontSettingsUtilities::ValidateSavedFonts(PrefService* prefs) {
// Nothing to do for Windows.
}
+std::string FontSettingsUtilities::MaybeGetLocalizedFontName(
+ const std::string& font_name_or_list) {
+ std::string font_name = ResolveFontList(font_name_or_list);
+ if (font_name.empty())
+ return font_name;
+ gfx::Font font(font_name, 12); // dummy font size
+ return static_cast<gfx::PlatformFontWin*>(font.platform_font())
+ ->GetLocalizedFontName();
+}
+
} // namespace options
« no previous file with comments | « chrome/browser/ui/webui/options/font_settings_utils_unittest.cc ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698