+2014-04-21 Myles C. Maxfield <mmaxfield@apple.com>
+
+ [OS X] Glyph spacing for system fonts may be incorrect
+ https://bugs.webkit.org/show_bug.cgi?id=131967
+
+ Reviewed by Simon Fraser.
+
+ Updating test to be more robust.
+
+ * fast/forms/search/intrinsic-search-width-with-decoration-border-padding-expected.txt:
+ * fast/forms/search/intrinsic-search-width-with-decoration-border-padding.html:
+
2014-04-22 Manuel Rego Casasnovas <rego@igalia.com>
REGRESSION (r167652): Broke fast/regions/cssom/region-range-for-box-crash.html in debug mode
+2014-04-21 Myles C. Maxfield <mmaxfield@apple.com>
+
+ [OS X] Glyph spacing for system fonts may be incorrect
+ https://bugs.webkit.org/show_bug.cgi?id=131967
+
+ Reviewed by Simon Fraser.
+
+ Covered by existing tests.
+
+ * platform/graphics/mac/SimpleFontDataMac.mm:
+ (WebCore::SimpleFontData::platformWidthForGlyph): Update to use CTFontGetAdvancesForGlyphs() for system fonts
+ (WebCore::hasCustomTracking):
+
2014-04-22 David Hyatt <hyatt@apple.com>
[New Multicolumn] widows/orphans cause assertion failures.
#import <wtf/StdLibExtras.h>
#import <wtf/RetainPtr.h>
+#if defined(__has_include) && __has_include(<CoreText/CTFontDescriptorPriv.h>)
+#import <CoreText/CTFontDescriptorPriv.h>
+#endif
+
+extern "C" bool CTFontDescriptorIsSystemUIFont(CTFontDescriptorRef);
+
#if !PLATFORM(IOS)
@interface NSFont (WebAppKitSecretAPI)
- (BOOL)_isFakeFixedPitch;
return boundingBox;
}
+static bool hasCustomTracking(CTFontRef font)
+{
+#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1090
+ UNUSED_PARAM(font);
+ return false;
+#else
+ RetainPtr<CTFontDescriptorRef> descriptor = CTFontCopyFontDescriptor(font);
+ return CTFontDescriptorIsSystemUIFont(descriptor.get())
+#endif
+}
+
#if !PLATFORM(IOS)
float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
{
CGSize advance = CGSizeZero;
- if (platformData().orientation() == Horizontal || m_isBrokenIdeographFallback) {
+ bool horizontal = platformData().orientation() == Horizontal;
+ if ((horizontal || m_isBrokenIdeographFallback) && !hasCustomTracking(m_platformData.ctFont())) {
NSFont *font = platformData().font();
if (font && platformData().isColorBitmapFont())
advance = NSSizeToCGSize([font advancementForGlyph:glyph]);
}
}
} else
- CTFontGetAdvancesForGlyphs(m_platformData.ctFont(), kCTFontVerticalOrientation, &glyph, &advance, 1);
+ CTFontGetAdvancesForGlyphs(m_platformData.ctFont(), horizontal ? kCTFontHorizontalOrientation : kCTFontVerticalOrientation, &glyph, &advance, 1);
return advance.width + m_syntheticBoldOffset;
}