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

Side by Side Diff: ui/gfx/font.h

Issue 2441343003: Allow the default generic font family settings to find the first available font (Closed)
Patch Set: Code shared in ui/gfx 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 #ifndef UI_GFX_FONT_H_ 5 #ifndef UI_GFX_FONT_H_
6 #define UI_GFX_FONT_H_ 6 #define UI_GFX_FONT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // Windows: This handle is owned by the Font object, and should not be 123 // Windows: This handle is owned by the Font object, and should not be
124 // destroyed by the caller. 124 // destroyed by the caller.
125 // Mac: The object is owned by the system and should not be released. 125 // Mac: The object is owned by the system and should not be released.
126 NativeFont GetNativeFont() const; 126 NativeFont GetNativeFont() const;
127 #endif 127 #endif
128 128
129 // Raw access to the underlying platform font implementation. Can be 129 // Raw access to the underlying platform font implementation. Can be
130 // static_cast to a known implementation type if needed. 130 // static_cast to a known implementation type if needed.
131 PlatformFont* platform_font() const { return platform_font_.get(); } 131 PlatformFont* platform_font() const { return platform_font_.get(); }
132 132
133 // Returns the first available font name. If there is no available font,
134 // returns the first font name. Empty entries are ignored.
135 // Used by Blink and webui to pick the primary standard/serif/sans/fixed/etc.
136 // fonts from region-specific IDS lists.
137 static std::string FirstAvailableOrFirst(const std::string& font_name_list);
msw 2016/10/28 07:05:06 This probably shouldn't be a Font class member fun
kojii 2016/10/28 07:57:30 FontList makes perfect sense to me, I was actually
138
133 private: 139 private:
134 // Wrapped platform font implementation. 140 // Wrapped platform font implementation.
135 scoped_refptr<PlatformFont> platform_font_; 141 scoped_refptr<PlatformFont> platform_font_;
136 }; 142 };
137 143
138 #ifndef NDEBUG 144 #ifndef NDEBUG
139 GFX_EXPORT std::ostream& operator<<(std::ostream& stream, 145 GFX_EXPORT std::ostream& operator<<(std::ostream& stream,
140 const Font::Weight weight); 146 const Font::Weight weight);
141 #endif 147 #endif
142 148
143 } // namespace gfx 149 } // namespace gfx
144 150
145 #endif // UI_GFX_FONT_H_ 151 #endif // UI_GFX_FONT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698