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

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: msw review 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
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 std::string FontSettingsUtilities::MaybeGetLocalizedFontName(
18 const std::string& font_name_or_list) {
19 std::string font_name = ResolveFontList(font_name_or_list);
20 if (font_name.empty())
21 return font_name;
22 gfx::Font font(font_name, 12); // dummy font size
23 return static_cast<gfx::PlatformFontWin*>(font.platform_font())
24 ->GetLocalizedFontName();
25 }
26
14 } // namespace options 27 } // namespace options
OLDNEW
« 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