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

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

Issue 25039002: Always aligns text at vertically center (Textfield, Label). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_views.cc ('k') | ui/gfx/font_unittest.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_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"
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "ui/gfx/gfx_export.h" 12 #include "ui/gfx/gfx_export.h"
13 #include "ui/gfx/native_widget_types.h" 13 #include "ui/gfx/native_widget_types.h"
14 14
15 namespace gfx { 15 namespace gfx {
16 16
17 class PlatformFont; 17 class PlatformFont;
18 18
19 // Font provides a wrapper around an underlying font. Copy and assignment 19 // Font provides a wrapper around an underlying font. Copy and assignment
20 // operators are explicitly allowed, and cheap. 20 // operators are explicitly allowed, and cheap.
21 //
22 // Figure of font metrics:
23 // +--------+-------------------+------------------+
24 // | | | internal leading |
25 // | | ascent (baseline) +------------------+
26 // | height | | cap height |
27 // | |-------------------+------------------+
28 // | | descent (height - baseline) |
29 // +--------+--------------------------------------+
21 class GFX_EXPORT Font { 30 class GFX_EXPORT Font {
22 public: 31 public:
23 // The following constants indicate the font style. 32 // The following constants indicate the font style.
24 enum FontStyle { 33 enum FontStyle {
25 NORMAL = 0, 34 NORMAL = 0,
26 BOLD = 1, 35 BOLD = 1,
27 ITALIC = 2, 36 ITALIC = 2,
28 UNDERLINE = 4, 37 UNDERLINE = 4,
29 }; 38 };
30 39
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 PlatformFont* platform_font() const { return platform_font_.get(); } 117 PlatformFont* platform_font() const { return platform_font_.get(); }
109 118
110 private: 119 private:
111 // Wrapped platform font implementation. 120 // Wrapped platform font implementation.
112 scoped_refptr<PlatformFont> platform_font_; 121 scoped_refptr<PlatformFont> platform_font_;
113 }; 122 };
114 123
115 } // namespace gfx 124 } // namespace gfx
116 125
117 #endif // UI_GFX_FONT_H_ 126 #endif // UI_GFX_FONT_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_views.cc ('k') | ui/gfx/font_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698