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

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

Issue 382273002: ui/gfx: Allow for font-specific rendering settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix fontconfig leak 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 | « content/browser/renderer_host/sandbox_ipc_linux.cc ('k') | ui/gfx/font.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 struct FontRenderParams;
17 class PlatformFont; 18 class PlatformFont;
18 19
19 // Font provides a wrapper around an underlying font. Copy and assignment 20 // Font provides a wrapper around an underlying font. Copy and assignment
20 // operators are explicitly allowed, and cheap. 21 // operators are explicitly allowed, and cheap.
21 // 22 //
22 // Figure of font metrics: 23 // Figure of font metrics:
23 // +--------+-------------------+------------------+ 24 // +--------+-------------------+------------------+
24 // | | | internal leading | 25 // | | | internal leading |
25 // | | ascent (baseline) +------------------+ 26 // | | ascent (baseline) +------------------+
26 // | height | | cap height | 27 // | height | | cap height |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 87
87 // Returns the specified font name in UTF-8. 88 // Returns the specified font name in UTF-8.
88 std::string GetFontName() const; 89 std::string GetFontName() const;
89 90
90 // Returns the actually used font name in UTF-8. 91 // Returns the actually used font name in UTF-8.
91 std::string GetActualFontNameForTesting() const; 92 std::string GetActualFontNameForTesting() const;
92 93
93 // Returns the font size in pixels. 94 // Returns the font size in pixels.
94 int GetFontSize() const; 95 int GetFontSize() const;
95 96
97 // Returns an object describing how the font should be rendered.
98 const FontRenderParams& GetFontRenderParams() const;
99
96 // Returns the native font handle. 100 // Returns the native font handle.
97 // Lifetime lore: 101 // Lifetime lore:
98 // Windows: This handle is owned by the Font object, and should not be 102 // Windows: This handle is owned by the Font object, and should not be
99 // destroyed by the caller. 103 // destroyed by the caller.
100 // Mac: The object is owned by the system and should not be released. 104 // Mac: The object is owned by the system and should not be released.
101 // Gtk: This handle is created on demand, and must be freed by calling 105 // Gtk: This handle is created on demand, and must be freed by calling
102 // pango_font_description_free() when the caller is done using it or 106 // pango_font_description_free() when the caller is done using it or
103 // by using ScopedPangoFontDescription. 107 // by using ScopedPangoFontDescription.
104 NativeFont GetNativeFont() const; 108 NativeFont GetNativeFont() const;
105 109
106 // Raw access to the underlying platform font implementation. Can be 110 // Raw access to the underlying platform font implementation. Can be
107 // static_cast to a known implementation type if needed. 111 // static_cast to a known implementation type if needed.
108 PlatformFont* platform_font() const { return platform_font_.get(); } 112 PlatformFont* platform_font() const { return platform_font_.get(); }
109 113
110 private: 114 private:
111 // Wrapped platform font implementation. 115 // Wrapped platform font implementation.
112 scoped_refptr<PlatformFont> platform_font_; 116 scoped_refptr<PlatformFont> platform_font_;
113 }; 117 };
114 118
115 } // namespace gfx 119 } // namespace gfx
116 120
117 #endif // UI_GFX_FONT_H_ 121 #endif // UI_GFX_FONT_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/sandbox_ipc_linux.cc ('k') | ui/gfx/font.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698