Text shaping in the simple path is flipped in the y direction
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 May 2018 17:38:54 +0000 (17:38 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 May 2018 17:38:54 +0000 (17:38 +0000)
commit698956b9514e4637bbdb8e013495f63526961156
treeca354f2416e9d8ae6288a3fb2d8b07e0fb5802e2
parent6546feb878a978d5f04ef49e340bc352c2c48243
Text shaping in the simple path is flipped in the y direction
https://bugs.webkit.org/show_bug.cgi?id=185062
<rdar://problem/39778678>

Reviewed by Simon Fraser.

Source/WebCore:

Shaping in our simple codepath occurs in an "increasing-y-goes-up" coordinate system, but our painting
code uses an "increasing-y-goes-down" coordinate system. We weren't fixing up the coordinate systems
because we never noticed. This is because the simple codepath is only designed for kerning and ligatures,
neither of which move glyphs vertically in the common case.

Test: fast/text/vertical-displacement-simple-codepath.html

* platform/graphics/Font.cpp:
(WebCore::Font::applyTransforms const):
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::applyFontTransforms):

Tools:

Huge thanks to Ulrike Rausch of LiebeFonts for contributing the test fonts!!!

* Scripts/webkitpy/common/config/contributors.json:

LayoutTests:

This test renders a font which uses our fast text codepath but also includes vertical
displacements inside its liga feature. The test makes sure that the vertical displacement
occurs in the correct direction.

The test fonts were created by Ulrike Rausch of LiebeFonts specifically for the purpose
of testing. Huge thanks to her!! Figuring out this bug would not have been possible if
not for her huge help!

* fast/text/resources/LiebeTest-calt.woff: Added.
* fast/text/resources/LiebeTest-dlig.woff: Added.
* fast/text/resources/LiebeTest-liga.woff: Added.
* fast/text/resources/LiebeTest-swsh.woff: Added.
* fast/text/vertical-displacement-simple-codepath-expected.html: Added.
* fast/text/vertical-displacement-simple-codepath.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231361 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/text/resources/LiebeTest-calt.woff [new file with mode: 0644]
LayoutTests/fast/text/resources/LiebeTest-dlig.woff [new file with mode: 0644]
LayoutTests/fast/text/resources/LiebeTest-liga.woff [new file with mode: 0644]
LayoutTests/fast/text/resources/LiebeTest-swsh.woff [new file with mode: 0644]
LayoutTests/fast/text/vertical-displacement-simple-codepath-expected.html [new file with mode: 0644]
LayoutTests/fast/text/vertical-displacement-simple-codepath.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Font.cpp
Source/WebCore/platform/graphics/WidthIterator.cpp
Tools/ChangeLog
Tools/Scripts/webkitpy/common/config/contributors.json