Changeset 87201 in webkit
- Timestamp:
- May 24, 2011 2:01:47 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87197 r87201 1 2011-05-24 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 Move code to discover if a CTFont has vertical glyphs out of SimpleFontData::platformInit() 6 https://bugs.webkit.org/show_bug.cgi?id=61392 7 8 * platform/graphics/mac/SimpleFontDataMac.mm: 9 (WebCore::fontHasVerticalGlyphs): Moved code here... 10 (WebCore::SimpleFontData::platformInit): ...from here. 11 1 12 2011-05-24 Kenneth Russell <kbr@google.com> 2 13 -
trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
r86401 r87201 58 58 const float smallCapsFontSizeMultiplier = 0.7f; 59 59 static inline float scaleEmToUnits(float x, unsigned unitsPerEm) { return x / unitsPerEm; } 60 61 static bool fontHasVerticalGlyphs(CTFontRef ctFont) 62 { 63 // The check doesn't look neat but this is what AppKit does for vertical writing... 64 RetainPtr<CFArrayRef> tableTags(AdoptCF, CTFontCopyAvailableTables(ctFont, kCTFontTableOptionExcludeSynthetic)); 65 CFIndex numTables = CFArrayGetCount(tableTags.get()); 66 for (CFIndex index = 0; index < numTables; ++index) { 67 CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tableTags.get(), index); 68 if (tag == kCTFontTableVhea || tag == kCTFontTableVORG) 69 return true; 70 } 71 return false; 72 } 60 73 61 74 static bool initFontData(SimpleFontData* fontData) … … 213 226 } 214 227 215 if (platformData().orientation() == Vertical && !isTextOrientationFallback()) { 216 // The check doesn't look neat but this is what AppKit does for vertical writing... 217 RetainPtr<CFArrayRef> tableTags(AdoptCF, CTFontCopyAvailableTables(m_platformData.ctFont(), kCTFontTableOptionExcludeSynthetic)); 218 CFIndex numTables = CFArrayGetCount(tableTags.get()); 219 for (CFIndex index = 0; index < numTables; ++index) { 220 CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tableTags.get(), index); 221 if (tag == kCTFontTableVhea || tag == kCTFontTableVORG) { 222 m_hasVerticalGlyphs = true; 223 break; 224 } 225 } 226 } 228 if (platformData().orientation() == Vertical && !isTextOrientationFallback()) 229 m_hasVerticalGlyphs = fontHasVerticalGlyphs(m_platformData.ctFont()); 227 230 228 231 float xHeight;
Note: See TracChangeset
for help on using the changeset viewer.