diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-12 01:52:29 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-12 01:52:29 +0000 |
commit | 335db8d0ed06b83f44831b9684f8ab9132cfc3e9 (patch) | |
tree | b42c4d9ed2fba7f5b3cadc5082295cce73021ea8 /chrome/common/gfx/chrome_font.h | |
parent | 7f4bfe196f0976c7151de206601860b47f913fcb (diff) | |
download | chromium_src-335db8d0ed06b83f44831b9684f8ab9132cfc3e9.zip chromium_src-335db8d0ed06b83f44831b9684f8ab9132cfc3e9.tar.gz chromium_src-335db8d0ed06b83f44831b9684f8ab9132cfc3e9.tar.bz2 |
...
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6872 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gfx/chrome_font.h')
-rw-r--r-- | chrome/common/gfx/chrome_font.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/chrome/common/gfx/chrome_font.h b/chrome/common/gfx/chrome_font.h index a26ceaf..cac7499 100644 --- a/chrome/common/gfx/chrome_font.h +++ b/chrome/common/gfx/chrome_font.h @@ -6,7 +6,6 @@ #define CHROME_COMMON_GFX_CHROME_FONT_H_ #include "build/build_config.h" -#include "base/gfx/native_widget_types.h" #include <string> @@ -18,6 +17,17 @@ class SkPaint; class SkTypeface; #endif +#if defined(OS_WIN) +typedef struct HFONT__* NativeFont; +#elif defined(OS_MACOSX) +typedef void* NativeFont; // TODO(port): set the correct type here +#elif defined(OS_LINUX) +class SkTypeface; +typedef SkTypeface* NativeFont; +#else // null port. +#error No known OS defined +#endif + #include "base/basictypes.h" #include "base/ref_counted.h" @@ -31,7 +41,7 @@ class ChromeFont { BOLD = 1, ITALIC = 2, UNDERLINED = 4, - WEB = 8, // TODO: what does this mean? + WEB = 8, // TODO(agl): what does this mean? }; // Creates a ChromeFont given font name (e.g. arial), font size (e.g. 12). @@ -81,7 +91,7 @@ class ChromeFont { // Font Size. int FontSize(); - gfx::NativeFont nativeFont() const; + NativeFont nativeFont() const; #if defined(OS_WIN) // Creates a font with the default name and style. @@ -104,7 +114,7 @@ class ChromeFont { return dlus * font_ref_->height() / 8; } #elif defined(OS_LINUX) - // We need a copy constructor to deal with the Skia reference counting + // We need a copy constructor to deal with the Skia reference counting. ChromeFont(const ChromeFont& other); #endif @@ -172,7 +182,7 @@ class ChromeFont { explicit ChromeFont(SkTypeface* typeface, const std::wstring& name, int size, int style); // Setup a Skia context to use the current typeface - void setupPaint(SkPaint* paint) const; + void PaintSetup(SkPaint* paint) const; // Calculate and cache the font metrics void calculateMetrics(); |