https://bugs.webkit.org/show_bug.cgi?id=128709
Reviewed by Simon Fraser.
Source/WebCore:
This patch simply disables skipping underlines being used with SVG fonts.
It's a stopgap until we can support skipping properly with SVG fonts.
Test: svg/custom/svg-fonts-skip-ink.html
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::ctFont):
* platform/graphics/mac/FontMac.mm:
(WebCore::Font::dashesForIntersectionsWithRect):
LayoutTests:
This text checks that some text without descenders in an SVG font renders the same with and
without text-decoration-skip: ink.
* svg/custom/svg-fonts-skip-ink-expected.html: Added.
* svg/custom/svg-fonts-skip-ink.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164075
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-02-13 Myles C. Maxfield <mmaxfield@apple.com>
+
+ text-decoration-skip: ink skips randomly when using SVG fonts
+ https://bugs.webkit.org/show_bug.cgi?id=128709
+
+ Reviewed by Simon Fraser.
+
+ This text checks that some text without descenders in an SVG font renders the same with and
+ without text-decoration-skip: ink.
+
+ * svg/custom/svg-fonts-skip-ink-expected.html: Added.
+ * svg/custom/svg-fonts-skip-ink.html: Added.
+
2014-02-13 Brent Fulgham <bfulgham@apple.com>
Create some latched scrolling tests.
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: 'SVGraffiti';
+ src: url("resources/graffiti.svg#SVGraffiti") format(svg)
+}
+body {
+ font:100px 'SVGraffiti';
+ -webkit-text-decoration-skip: none;
+ text-decoration: underline;
+}
+</style>
+</head>
+<body>
+NSNorth Podcast
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: 'SVGraffiti';
+ src: url("resources/graffiti.svg#SVGraffiti") format(svg)
+}
+body {
+ font:100px 'SVGraffiti';
+ -webkit-text-decoration-skip: ink;
+ text-decoration: underline;
+}
+</style>
+</head>
+<body>
+NSNorth Podcast
+</body>
+</html>
+2014-02-13 Myles C. Maxfield <mmaxfield@apple.com>
+
+ text-decoration-skip: ink skips randomly when using SVG fonts
+ https://bugs.webkit.org/show_bug.cgi?id=128709
+
+ Reviewed by Simon Fraser.
+
+ This patch simply disables skipping underlines being used with SVG fonts.
+ It's a stopgap until we can support skipping properly with SVG fonts.
+
+ Test: svg/custom/svg-fonts-skip-ink.html
+
+ * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+ (WebCore::FontPlatformData::ctFont):
+ * platform/graphics/mac/FontMac.mm:
+ (WebCore::Font::dashesForIntersectionsWithRect):
+
2014-02-13 Daniel Bates <dabates@apple.com>
Fix the ARM build when HAVE_ARM_NEON_INTRINSICS is enabled
else
fontDescriptor = cascadeToLastResortFontDescriptor();
m_CTFont = adoptCF(CTFontCreateCopyWithAttributes(m_CTFont.get(), m_size, 0, fontDescriptor));
- } else
+ } else {
+ ASSERT(m_cgFont.get());
m_CTFont = adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, cascadeToLastResortFontDescriptor()));
+ }
#else
// Apple Color Emoji size is adjusted (and then re-adjusted by Core Text) and capped.
CGFloat size = !m_isEmoji ? m_size : m_size <= 15 ? 4 * (m_size + 2) / static_cast<CGFloat>(5) : 16;
DashArray Font::dashesForIntersectionsWithRect(const TextRun& run, const FloatPoint& textOrigin, const FloatRect& lineExtents) const
{
+ if (loadingCustomFonts())
+ return DashArray();
+
float deltaX;
GlyphBuffer glyphBuffer;
if (codePath(run) != Complex)
DashArray result;
for (int i = 0; i < glyphBuffer.size(); ++i) {
GlyphIterationState info = GlyphIterationState(CGPointMake(0, 0), CGPointMake(0, 0), lineExtents.y(), lineExtents.y() + lineExtents.height(), lineExtents.x() + lineExtents.width(), lineExtents.x());
- RetainPtr<CGPathRef> path = adoptCF(CTFontCreatePathForGlyph(glyphBuffer.fontDataAt(i)->platformData().ctFont(), glyphBuffer.glyphAt(i), &translation));
+ const SimpleFontData* fontData = glyphBuffer.fontDataAt(i);
+ if (fontData->isSVGFont())
+ continue;
+ RetainPtr<CGPathRef> path = adoptCF(CTFontCreatePathForGlyph(fontData->platformData().ctFont(), glyphBuffer.glyphAt(i), &translation));
CGPathApply(path.get(), &info, &findPathIntersections);
if (info.minX < info.maxX) {
result.append(info.minX - lineExtents.x());