diff options
author | Russell Brenner <russellbrenner@google.com> | 2010-11-18 17:33:13 -0800 |
---|---|---|
committer | Russell Brenner <russellbrenner@google.com> | 2010-12-02 13:47:21 -0800 |
commit | 6b70adc33054f8aee8c54d0f460458a9df11b8a5 (patch) | |
tree | 103a13998c33944d6ab3b8318c509a037e639460 /WebCore/platform/graphics/cocoa | |
parent | bdf4ebc8e70b2d221b6ee7a65660918ecb1d33aa (diff) | |
download | external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.zip external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.tar.gz external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.tar.bz2 |
Merge WebKit at r72274: Initial merge by git.
Change-Id: Ie51f0b4a16da82942bd516dce59cfb79ebbe25fb
Diffstat (limited to 'WebCore/platform/graphics/cocoa')
-rw-r--r-- | WebCore/platform/graphics/cocoa/FontPlatformData.h | 2 | ||||
-rw-r--r-- | WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm | 27 |
2 files changed, 5 insertions, 24 deletions
diff --git a/WebCore/platform/graphics/cocoa/FontPlatformData.h b/WebCore/platform/graphics/cocoa/FontPlatformData.h index 17ae4b5..7ab84f5 100644 --- a/WebCore/platform/graphics/cocoa/FontPlatformData.h +++ b/WebCore/platform/graphics/cocoa/FontPlatformData.h @@ -73,7 +73,7 @@ class FontPlatformData { { } - FontPlatformData(NSFont *nsFont, bool syntheticBold = false, bool syntheticOblique = false, FontOrientation = Horizontal); + FontPlatformData(NSFont *nsFont, float size, bool syntheticBold = false, bool syntheticOblique = false, FontOrientation = Horizontal); FontPlatformData(CGFontRef cgFont, ATSUFontID fontID, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation) : m_syntheticBold(syntheticBold) diff --git a/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm b/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm index dbfec5f..52a88ed 100644 --- a/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm +++ b/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm @@ -44,9 +44,10 @@ void FontPlatformData::loadFont(NSFont* nsFont, float, NSFont*& outNSFont, CGFon } #endif // PLATFORM(MAC) -FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool syntheticOblique, FontOrientation orientation) +FontPlatformData::FontPlatformData(NSFont *nsFont, float size, bool syntheticBold, bool syntheticOblique, FontOrientation orientation) : m_syntheticBold(syntheticBold) , m_syntheticOblique(syntheticOblique) + , m_size(size) , m_font(nsFont) #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) // FIXME: Chromium: The following code isn't correct for the Chromium port since the sandbox might @@ -58,28 +59,8 @@ FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool synt { ASSERT_ARG(nsFont, nsFont); - m_size = [nsFont pointSize]; - CGFontRef cgFont = 0; - loadFont(nsFont, m_size, m_font, cgFont, m_atsuFontID); - - if (orientation == Vertical) { - // Ignore vertical orientation when the font doesn't support vertical metrics. - // The check doesn't look neat but this is what AppKit does for vertical writing... - RetainPtr<CFArrayRef> tableTags(AdoptCF, CTFontCopyAvailableTables(ctFont(), kCTFontTableOptionExcludeSynthetic)); - CFIndex numTables = CFArrayGetCount(tableTags.get()); - bool found = false; - for (CFIndex index = 0; index < numTables; ++index) { - CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tableTags.get(), index); - if (tag == kCTFontTableVhea || tag == kCTFontTableVORG) { - found = true; - break; - } - } - - if (found == false) - orientation = Horizontal; - } + loadFont(nsFont, size, m_font, cgFont, m_atsuFontID); m_orientation = orientation; @@ -185,7 +166,7 @@ bool FontPlatformData::roundsGlyphAdvances() const bool FontPlatformData::allowsLigatures() const { - return m_orientation == Horizontal && ![[m_font coveredCharacterSet] characterIsMember:'a']; + return ![[m_font coveredCharacterSet] characterIsMember:'a']; } CTFontRef FontPlatformData::ctFont() const |