diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-25 20:33:23 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-25 20:33:23 +0000 |
commit | c98fe6fa60b3262364158809ca0d462f1009709f (patch) | |
tree | ced35f47a361eb85b6db911c066be70e9c77a2b1 /chrome/common/gfx/chrome_font.h | |
parent | 309c8ff514d506364567d9e6095a295b8d5c3d3e (diff) | |
download | chromium_src-c98fe6fa60b3262364158809ca0d462f1009709f.zip chromium_src-c98fe6fa60b3262364158809ca0d462f1009709f.tar.gz chromium_src-c98fe6fa60b3262364158809ca0d462f1009709f.tar.bz2 |
Enable the ToolbarModel on Mac and Linux. Implement ChromeFont on Mac.
Review URL: http://codereview.chromium.org/28124
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10368 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/gfx/chrome_font.h')
-rw-r--r-- | chrome/common/gfx/chrome_font.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/chrome/common/gfx/chrome_font.h b/chrome/common/gfx/chrome_font.h index f4b2a9a..8ac225c 100644 --- a/chrome/common/gfx/chrome_font.h +++ b/chrome/common/gfx/chrome_font.h @@ -20,7 +20,12 @@ class SkTypeface; #if defined(OS_WIN) typedef struct HFONT__* NativeFont; #elif defined(OS_MACOSX) -typedef void* NativeFont; // TODO(port): set the correct type here +#ifdef __OBJC__ +@class NSFont; +#else +class NSFont; +#endif +typedef NSFont* NativeFont; #elif defined(OS_LINUX) class SkTypeface; typedef SkTypeface* NativeFont; @@ -208,6 +213,20 @@ class ChromeFont { int height_; int ascent_; int avg_width_; +#elif defined(OS_MACOSX) + explicit ChromeFont(const std::wstring& font_name, int font_size, int style); + + // Calculate and cache the font metrics. + void calculateMetrics(); + + std::wstring font_name_; + int font_size_; + int style_; + + // Cached metrics, generated at construction + int height_; + int ascent_; + int avg_width_; #endif }; |