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

Side by Side Diff: chrome/browser/ui/webui/options/font_settings_utils.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
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/webui/options/font_settings_utils.h"
6
7 #include "ui/gfx/font.h"
8
9 namespace options {
10
11 // Returns the first available font if it starts with ",".
msw 2016/10/26 20:33:49 These comments belong with the function declaratio
kojii 2016/10/26 22:20:02 Thank you, not very familiar with Chromium side ye
12 std::string FontSettingsUtilities::ResolveFontList(
13 const std::string& font_name_or_list) {
14 if (!font_name_or_list.empty() && font_name_or_list[0] == ',')
15 return gfx::Font::FirstAvailableOrFirst(font_name_or_list);
msw 2016/10/26 20:33:49 Why aren't we using the standard gfx::FontList cod
kojii 2016/10/26 22:20:02 gfx::FontList cascades by the availability of glyp
msw 2016/10/27 00:04:18 Using FontList to just parse the string and then r
16 return font_name_or_list;
17 }
18
19 #if !defined(OS_WIN)
20 // Returns the localized name of a font so that settings can find it within the
21 // list of system fonts. On Windows, the list of system fonts has names only
22 // for the system locale, but the pref value may be in the English name.
23 std::string FontSettingsUtilities::MaybeGetLocalizedFontName(
msw 2016/10/26 20:33:49 Ditto to my comments and questions above.
24 const std::string& font_name_or_list) {
25 return ResolveFontList(font_name_or_list);
26 }
27 #endif
28
29 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698