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

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

Issue 400193004: Unify desktop Linux and Chrome OS font rendering params. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use initializer list Created 6 years, 5 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 | « ui/gfx/pango_util.h ('k') | ui/gfx/platform_font_pango.cc » ('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 #ifndef UI_GFX_PLATFORM_FONT_PANGO_H_ 5 #ifndef UI_GFX_PLATFORM_FONT_PANGO_H_
6 #define UI_GFX_PLATFORM_FONT_PANGO_H_ 6 #define UI_GFX_PLATFORM_FONT_PANGO_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 17 matching lines...) Expand all
28 // Converts |gfx_font| to a new pango font. Free the returned font with 28 // Converts |gfx_font| to a new pango font. Free the returned font with
29 // pango_font_description_free(). 29 // pango_font_description_free().
30 static PangoFontDescription* PangoFontFromGfxFont(const gfx::Font& gfx_font); 30 static PangoFontDescription* PangoFontFromGfxFont(const gfx::Font& gfx_font);
31 31
32 // Resets and reloads the cached system font used by the default constructor. 32 // Resets and reloads the cached system font used by the default constructor.
33 // This function is useful when the system font has changed, for example, when 33 // This function is useful when the system font has changed, for example, when
34 // the locale has changed. 34 // the locale has changed.
35 static void ReloadDefaultFont(); 35 static void ReloadDefaultFont();
36 36
37 #if defined(OS_CHROMEOS) 37 #if defined(OS_CHROMEOS)
38 // Sets the default font. 38 // Sets the default font. |font_description| is a Pango font description that
39 // will be passed to pango_font_description_from_string().
39 static void SetDefaultFontDescription(const std::string& font_description); 40 static void SetDefaultFontDescription(const std::string& font_description);
40 #endif 41 #endif
41 42
42 // Position as an offset from the height of the drawn text, used to draw 43 // Position as an offset from the height of the drawn text, used to draw
43 // an underline. This is a negative number, so the underline would be 44 // an underline. This is a negative number, so the underline would be
44 // drawn at y + height + underline_position. 45 // drawn at y + height + underline_position.
45 double underline_position() const; 46 double underline_position() const;
46 // The thickness to draw the underline. 47 // The thickness to draw the underline.
47 double underline_thickness() const; 48 double underline_thickness() const;
48 49
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // to compute them. 114 // to compute them.
114 bool pango_metrics_inited_; 115 bool pango_metrics_inited_;
115 double average_width_pixels_; 116 double average_width_pixels_;
116 double underline_position_pixels_; 117 double underline_position_pixels_;
117 double underline_thickness_pixels_; 118 double underline_thickness_pixels_;
118 119
119 // The default font, used for the default constructor. 120 // The default font, used for the default constructor.
120 static Font* default_font_; 121 static Font* default_font_;
121 122
122 #if defined(OS_CHROMEOS) 123 #if defined(OS_CHROMEOS)
124 // A Pango font description.
123 static std::string* default_font_description_; 125 static std::string* default_font_description_;
124 #endif 126 #endif
125 127
126 DISALLOW_COPY_AND_ASSIGN(PlatformFontPango); 128 DISALLOW_COPY_AND_ASSIGN(PlatformFontPango);
127 }; 129 };
128 130
129 } // namespace gfx 131 } // namespace gfx
130 132
131 #endif // UI_GFX_PLATFORM_FONT_PANGO_H_ 133 #endif // UI_GFX_PLATFORM_FONT_PANGO_H_
OLDNEW
« no previous file with comments | « ui/gfx/pango_util.h ('k') | ui/gfx/platform_font_pango.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698