Title: [268638] trunk
Revision
268638
Author
mmaxfi...@apple.com
Date
2020-10-17 00:06:23 -0700 (Sat, 17 Oct 2020)

Log Message

REGRESSION(r268561): Synthetic oblique text is drawn upside-down
https://bugs.webkit.org/show_bug.cgi?id=217867
<rdar://problem/70400846>

Reviewed by Darin Adler.

Source/WebCore:

I made a typo.

Test: fast/text/synthetic-oblique.html

* platform/graphics/FontCascade.h:
(WebCore::FontCascade::syntheticObliqueAngle):
* platform/graphics/coretext/FontCascadeCoreText.cpp:
(WebCore::computeOverallTextMatrix):

LayoutTests:

* fast/text/synthetic-oblique-expected.html: Added.
* fast/text/synthetic-oblique.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (268637 => 268638)


--- trunk/LayoutTests/ChangeLog	2020-10-17 06:46:25 UTC (rev 268637)
+++ trunk/LayoutTests/ChangeLog	2020-10-17 07:06:23 UTC (rev 268638)
@@ -1,3 +1,14 @@
+2020-10-17  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        REGRESSION(r268561): Synthetic oblique text is drawn upside-down
+        https://bugs.webkit.org/show_bug.cgi?id=217867
+        <rdar://problem/70400846>
+
+        Reviewed by Darin Adler.
+
+        * fast/text/synthetic-oblique-expected.html: Added.
+        * fast/text/synthetic-oblique.html: Added.
+
 2020-10-16  Devin Rousso  <drou...@apple.com>
 
         Web Inspector: REGRESSION(r266669): DOMBreakpoint.js:106:23: CONSOLE ASSERT ERROR domNode should not change once set

Added: trunk/LayoutTests/fast/text/synthetic-oblique-expected-mismatch.html (0 => 268638)


--- trunk/LayoutTests/fast/text/synthetic-oblique-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/synthetic-oblique-expected-mismatch.html	2020-10-17 07:06:23 UTC (rev 268638)
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+</body>
+</html>

Added: trunk/LayoutTests/fast/text/synthetic-oblique.html (0 => 268638)


--- trunk/LayoutTests/fast/text/synthetic-oblique.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/synthetic-oblique.html	2020-10-17 07:06:23 UTC (rev 268638)
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: "Test Font";
+    src: url("../../resources/Ahem.ttf") format("truetype");
+}
+
+#wrapper {
+    overflow: hidden;
+    width: 100px;
+    height: 100px;
+}
+
+#test {
+    font: 1000px "Test Font";
+    font-style: oblique;
+    width: 10000px;
+    padding-left: 20px;
+    position: relative;
+    left: -4080px;
+}
+</style>
+</head>
+<body>
+<div id="wrapper"><div id="test">Test</div></div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (268637 => 268638)


--- trunk/Source/WebCore/ChangeLog	2020-10-17 06:46:25 UTC (rev 268637)
+++ trunk/Source/WebCore/ChangeLog	2020-10-17 07:06:23 UTC (rev 268638)
@@ -1,3 +1,20 @@
+2020-10-17  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        REGRESSION(r268561): Synthetic oblique text is drawn upside-down
+        https://bugs.webkit.org/show_bug.cgi?id=217867
+        <rdar://problem/70400846>
+
+        Reviewed by Darin Adler.
+
+        I made a typo.
+
+        Test: fast/text/synthetic-oblique.html
+
+        * platform/graphics/FontCascade.h:
+        (WebCore::FontCascade::syntheticObliqueAngle):
+        * platform/graphics/coretext/FontCascadeCoreText.cpp:
+        (WebCore::computeOverallTextMatrix):
+
 2020-10-16  Said Abou-Hallawa  <sabouhall...@apple.com>
 
         [GPU Process] Introduce RemoteResourceCache to manage the resources in the GPU Process

Modified: trunk/Source/WebCore/platform/graphics/FontCascade.h (268637 => 268638)


--- trunk/Source/WebCore/platform/graphics/FontCascade.h	2020-10-17 06:46:25 UTC (rev 268637)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.h	2020-10-17 07:06:23 UTC (rev 268638)
@@ -196,7 +196,7 @@
 
     bool primaryFontIsSystemFont() const;
 
-    static int syntheticObliqueAngle() { return 14; }
+    static float syntheticObliqueAngle() { return 14; }
 
     std::unique_ptr<DisplayList::DisplayList> displayListForTextRun(GraphicsContext&, const TextRun&, unsigned from = 0, Optional<unsigned> to = { }, CustomFontNotReadyAction = CustomFontNotReadyAction::DoNotPaintIfFontNotReady) const;
 

Modified: trunk/Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp (268637 => 268638)


--- trunk/Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp	2020-10-17 06:46:25 UTC (rev 268637)
+++ trunk/Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp	2020-10-17 07:06:23 UTC (rev 268638)
@@ -146,7 +146,7 @@
     result.setB(-result.b());
     result.setD(-result.d());
     if (platformData.syntheticOblique()) {
-        float obliqueSkew = tanf(FontCascade::syntheticObliqueAngle() * piFloat / 180);
+        float obliqueSkew = tanf(deg2rad(FontCascade::syntheticObliqueAngle()));
         if (platformData.orientation() == FontOrientation::Vertical) {
             if (font.isTextOrientationFallback())
                 result = AffineTransform(1, obliqueSkew, 0, 1, 0, 0) * result;
@@ -153,7 +153,7 @@
             else
                 result = AffineTransform(1, -obliqueSkew, 0, 1, 0, 0) * result;
         } else
-            result = AffineTransform(1, 0, -obliqueSkew, 1, 0, 0);
+            result = AffineTransform(1, 0, -obliqueSkew, 1, 0, 0) * result;
     }
 
     // We're emulating the behavior of CGContextSetTextPosition() by adding constant amounts to each glyph's position
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to