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

Side by Side Diff: ui/gfx/platform_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 | « ui/gfx/pango_util.cc ('k') | ui/gfx/platform_font_ios.h » ('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_H_ 5 #ifndef UI_GFX_PLATFORM_FONT_H_
6 #define UI_GFX_PLATFORM_FONT_H_ 6 #define UI_GFX_PLATFORM_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 Font; 17 class Font;
18 struct FontRenderParams;
18 19
19 class GFX_EXPORT PlatformFont : public base::RefCounted<PlatformFont> { 20 class GFX_EXPORT PlatformFont : public base::RefCounted<PlatformFont> {
20 public: 21 public:
21 // Creates an appropriate PlatformFont implementation. 22 // Creates an appropriate PlatformFont implementation.
22 static PlatformFont* CreateDefault(); 23 static PlatformFont* CreateDefault();
23 static PlatformFont* CreateFromNativeFont(NativeFont native_font); 24 static PlatformFont* CreateFromNativeFont(NativeFont native_font);
24 // Creates a PlatformFont implementation with the specified |font_name| 25 // Creates a PlatformFont implementation with the specified |font_name|
25 // (encoded in UTF-8) and |font_size| in pixels. 26 // (encoded in UTF-8) and |font_size| in pixels.
26 static PlatformFont* CreateFromNameAndSize(const std::string& font_name, 27 static PlatformFont* CreateFromNameAndSize(const std::string& font_name,
27 int font_size); 28 int font_size);
(...skipping 27 matching lines...) Expand all
55 56
56 // Returns the specified font name in UTF-8. 57 // Returns the specified font name in UTF-8.
57 virtual std::string GetFontName() const = 0; 58 virtual std::string GetFontName() const = 0;
58 59
59 // Returns the actually used font name in UTF-8. 60 // Returns the actually used font name in UTF-8.
60 virtual std::string GetActualFontNameForTesting() const = 0; 61 virtual std::string GetActualFontNameForTesting() const = 0;
61 62
62 // Returns the font size in pixels. 63 // Returns the font size in pixels.
63 virtual int GetFontSize() const = 0; 64 virtual int GetFontSize() const = 0;
64 65
66 // Returns an object describing how the font should be rendered.
67 virtual const FontRenderParams& GetFontRenderParams() const = 0;
68
65 // Returns the native font handle. 69 // Returns the native font handle.
66 virtual NativeFont GetNativeFont() const = 0; 70 virtual NativeFont GetNativeFont() const = 0;
67 71
68 protected: 72 protected:
69 virtual ~PlatformFont() {} 73 virtual ~PlatformFont() {}
70 74
71 private: 75 private:
72 friend class base::RefCounted<PlatformFont>; 76 friend class base::RefCounted<PlatformFont>;
73 }; 77 };
74 78
75 } // namespace gfx 79 } // namespace gfx
76 80
77 #endif // UI_GFX_PLATFORM_FONT_H_ 81 #endif // UI_GFX_PLATFORM_FONT_H_
OLDNEW
« no previous file with comments | « ui/gfx/pango_util.cc ('k') | ui/gfx/platform_font_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698