Title: [211667] trunk
Revision
211667
Author
mmaxfi...@apple.com
Date
2017-02-03 21:53:39 -0800 (Fri, 03 Feb 2017)

Log Message

REGRESSION(r204858): Synthetic bold text in vertical writing mode is rotated away from original text
https://bugs.webkit.org/show_bug.cgi?id=167826
<rdar://problem/28193222>

Reviewed by Zalan Bujtas.

Source/WebCore:

When drawing vertical text, the rotation is not reset between successive paint calls. We implement
synthetic bold by drawing text twice, which means that the second draw call was getting rotated
twice. This was an oversight in r204858.

Test: fast/text/synthetic-bold-vertical-text.html

* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::showGlyphsWithAdvances):

LayoutTests:

* fast/text/synthetic-bold-vertical-text-expected.html: Added.
* fast/text/synthetic-bold-vertical-text.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (211666 => 211667)


--- trunk/LayoutTests/ChangeLog	2017-02-04 05:18:18 UTC (rev 211666)
+++ trunk/LayoutTests/ChangeLog	2017-02-04 05:53:39 UTC (rev 211667)
@@ -1,3 +1,14 @@
+2017-02-03  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        REGRESSION(r204858): Synthetic bold text in vertical writing mode is rotated away from original text
+        https://bugs.webkit.org/show_bug.cgi?id=167826
+        <rdar://problem/28193222>
+
+        Reviewed by Zalan Bujtas.
+
+        * fast/text/synthetic-bold-vertical-text-expected.html: Added.
+        * fast/text/synthetic-bold-vertical-text.html: Added.
+
 2017-02-03  Jeremy Jones  <jere...@apple.com>
 
         WK1 mouse events are missing movementX and movementY for pointerlock.

Added: trunk/LayoutTests/fast/text/synthetic-bold-vertical-text-expected.html (0 => 211667)


--- trunk/LayoutTests/fast/text/synthetic-bold-vertical-text-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/synthetic-bold-vertical-text-expected.html	2017-02-04 05:53:39 UTC (rev 211667)
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that synthetic bold on vertical text doesn't draw outside of the bounds of the line box. The test passes if you see nothing below.
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/synthetic-bold-vertical-text.html (0 => 211667)


--- trunk/LayoutTests/fast/text/synthetic-bold-vertical-text.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/synthetic-bold-vertical-text.html	2017-02-04 05:53:39 UTC (rev 211667)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that synthetic bold on vertical text doesn't draw outside of the bounds of the line box. The test passes if you see nothing below.
+<div style="position: relative;">
+<div id="test" style="position: absolute; left: 50px; top: 50px; font-family: 'Hiragino Maru Gothic ProN'; writing-mode: vertical-rl; font-weight: bold">Hello</div>
+<div id="cover" style="position: absolute; left: 50px; top: 50px; width: 40px; height: 50vh; background: white;"></div>
+</div>
+</body>
+</html>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (211666 => 211667)


--- trunk/Source/WebCore/ChangeLog	2017-02-04 05:18:18 UTC (rev 211666)
+++ trunk/Source/WebCore/ChangeLog	2017-02-04 05:53:39 UTC (rev 211667)
@@ -1,3 +1,20 @@
+2017-02-03  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        REGRESSION(r204858): Synthetic bold text in vertical writing mode is rotated away from original text
+        https://bugs.webkit.org/show_bug.cgi?id=167826
+        <rdar://problem/28193222>
+
+        Reviewed by Zalan Bujtas.
+
+        When drawing vertical text, the rotation is not reset between successive paint calls. We implement
+        synthetic bold by drawing text twice, which means that the second draw call was getting rotated
+        twice. This was an oversight in r204858.
+
+        Test: fast/text/synthetic-bold-vertical-text.html
+
+        * platform/graphics/cocoa/FontCascadeCocoa.mm:
+        (WebCore::showGlyphsWithAdvances):
+
 2017-02-03  Joseph Pecoraro  <pecor...@apple.com>
 
         Performance Timing: Convert WTF::MonotonicTime and WTF::Seconds

Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm (211666 => 211667)


--- trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm	2017-02-04 05:18:18 UTC (rev 211666)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm	2017-02-04 05:53:39 UTC (rev 211667)
@@ -148,7 +148,7 @@
         CGAffineTransform rotateLeftTransform = CGAffineTransformMake(0, -1, 1, 0, 0, 0);
         CGAffineTransform textMatrix = CGContextGetTextMatrix(context);
         CGAffineTransform runMatrix = CGAffineTransformConcat(textMatrix, rotateLeftTransform);
-        CGContextSetTextMatrix(context, runMatrix);
+        ScopedTextMatrix savedMatrix(runMatrix, context);
 
         Vector<CGSize, 256> translations(count);
         CTFontGetVerticalTranslationsForGlyphs(platformData.ctFont(), glyphs, translations.data(), count);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to