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

Side by Side 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: Add more tests Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/webui/options/font_settings_utils.h" 5 #include "chrome/browser/ui/webui/options/font_settings_utils.h"
6 6
7 #include "ui/gfx/font.h"
8 #include "ui/gfx/platform_font_win.h"
9
7 namespace options { 10 namespace options {
8 11
9 // static 12 // static
10 void FontSettingsUtilities::ValidateSavedFonts(PrefService* prefs) { 13 void FontSettingsUtilities::ValidateSavedFonts(PrefService* prefs) {
11 // Nothing to do for Windows. 14 // Nothing to do for Windows.
12 } 15 }
13 16
17 // Returns the localized name of a font so that settings can find it within the
msw 2016/10/26 20:33:49 Ditto, this comment belongs in the header or in th
18 // list of system fonts. On Windows, the list of system fonts has names only
19 // for the system locale, but the pref value may be in the English name.
20 std::string FontSettingsUtilities::MaybeGetLocalizedFontName(
21 const std::string& font_name_or_list) {
22 std::string font_name = ResolveFontList(font_name_or_list);
23 if (font_name.empty())
24 return font_name;
25 gfx::Font font(font_name, 12); // dummy font size
26 return static_cast<gfx::PlatformFontWin*>(font.platform_font())
27 ->GetLocalizedFontName();
28 }
29
14 } // namespace options 30 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698