summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm')
-rw-r--r--WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm27
1 files changed, 4 insertions, 23 deletions
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