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

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

Issue 124693003: Makes the default ctor of gfx::FontList copy the pre-calculated metrics. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved the creation of |g_default_font_list| into the default ctor. Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/gfx/font_list.cc » ('j') | ui/gfx/font_list.cc » ('J')
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 #ifndef UI_GFX_FONT_LIST_H_ 5 #ifndef UI_GFX_FONT_LIST_H_
6 #define UI_GFX_FONT_LIST_H_ 6 #define UI_GFX_FONT_LIST_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 16 matching lines...) Expand all
27 // http://developer.gnome.org/pango/stable/pango-Fonts.html#pango-font-descripti on-from-string 27 // http://developer.gnome.org/pango/stable/pango-Fonts.html#pango-font-descripti on-from-string
28 // 28 //
29 // FontList could be initialized either way without conversion to the other 29 // FontList could be initialized either way without conversion to the other
30 // form. The conversion to the other form is done only when asked to get the 30 // form. The conversion to the other form is done only when asked to get the
31 // other form. 31 // other form.
32 // 32 //
33 // FontList allows operator= since FontList is a data member type in RenderText, 33 // FontList allows operator= since FontList is a data member type in RenderText,
34 // and operator= is used in RenderText::SetFontList(). 34 // and operator= is used in RenderText::SetFontList().
35 class GFX_EXPORT FontList { 35 class GFX_EXPORT FontList {
36 public: 36 public:
37 // Creates a font list with a Font with default name and style. 37 // Creates a font list with default font names, size and style, which are
38 // specified by SetDefaultFontDescription().
38 FontList(); 39 FontList();
39 40
40 // Creates a font list from a string representing font names, styles, and 41 // Creates a font list from a string representing font names, styles, and
41 // size. 42 // size.
42 explicit FontList(const std::string& font_description_string); 43 explicit FontList(const std::string& font_description_string);
43 44
44 // Creates a font list from font names, styles and size. 45 // Creates a font list from font names, styles and size.
45 FontList(const std::vector<std::string>& font_names, 46 FontList(const std::vector<std::string>& font_names,
46 int font_style, 47 int font_style,
47 int font_size); 48 int font_size);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 mutable int common_baseline_; 147 mutable int common_baseline_;
147 148
148 // Cached font style and size. 149 // Cached font style and size.
149 mutable int font_style_; 150 mutable int font_style_;
150 mutable int font_size_; 151 mutable int font_size_;
151 }; 152 };
152 153
153 } // namespace gfx 154 } // namespace gfx
154 155
155 #endif // UI_GFX_FONT_LIST_H_ 156 #endif // UI_GFX_FONT_LIST_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/font_list.cc » ('j') | ui/gfx/font_list.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698