diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-17 03:29:26 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-17 03:29:26 +0000 |
commit | 2019966658e19a873744641668e134b92123f1d5 (patch) | |
tree | 853ac0828cc46bec543851b7c57c70a3bb1fc06e /chrome/common/font_descriptor_mac.h | |
parent | f7d992aa311c3cec1fc95ce06338b129f4b34cbe (diff) | |
download | chromium_src-2019966658e19a873744641668e134b92123f1d5.zip chromium_src-2019966658e19a873744641668e134b92123f1d5.tar.gz chromium_src-2019966658e19a873744641668e134b92123f1d5.tar.bz2 |
Mac: More pluming for OOP font loading
* Add font_descriptor and corresponding pluming to send an NSFont over IPC.
* Rejigger font_loader to accept an NSFont as input and output an ATSFontContainerRef. The reasoning behind this is that WebKit ultimately controls the font lifetime and we can only deactivate the font container once the font is no longer in use.
BUG=29729
Test=Unit tests should pass.
Review URL: http://codereview.chromium.org/2804001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50076 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/font_descriptor_mac.h')
-rw-r--r-- | chrome/common/font_descriptor_mac.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/chrome/common/font_descriptor_mac.h b/chrome/common/font_descriptor_mac.h new file mode 100644 index 0000000..25ae9db --- /dev/null +++ b/chrome/common/font_descriptor_mac.h @@ -0,0 +1,32 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_COMMON_FONT_DESCRIPTOR_MAC_H_ +#define CHROME_COMMON_FONT_DESCRIPTOR_MAC_H_ + +#include "base/string16.h" + +#ifdef __OBJC__ +@class NSFont; +#else +class NSFont; +#endif + +// Container to allow serializing an NSFont over IPC. +struct FontDescriptor { + explicit FontDescriptor(NSFont* font); + + FontDescriptor() : font_point_size(0) {} + + // Return an autoreleased NSFont corresponding to the font description. + NSFont* nsFont() const; + + // Name of the font. + string16 font_name; + + // Size in points. + float font_point_size; +}; + +#endif // CHROME_COMMON_FONT_DESCRIPTOR_MAC_H_ |