[iOS] baidu.com: Synthetic bold renders too far apart, appears doubled.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 May 2019 20:30:05 +0000 (20:30 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 May 2019 20:30:05 +0000 (20:30 +0000)
commit53eec4ac04cb232ac8ce1a3addb9b5f4b2c02d74
tree189a2e51f6b9f6c20e3e1cf2c098f87179b7170d
parent9f1a26daddaac57f964574918c1258c456d6df41
[iOS] baidu.com: Synthetic bold renders too far apart, appears doubled.
https://bugs.webkit.org/show_bug.cgi?id=197781
<rdar://problem/48027412>

Reviewed by Simon Fraser.

Source/WebCore:

Synthetic bold is essentially two regular glyphs painted with an offset. While on macOS this offset is always 1px (CSS), on iOS larger font produces higher offset value. At paint time, this offset value (in CSS px unit) get converted
to a device pixel value taking context scale into account. This conversion ensures that the gap between the 2 regular glyphs won't get wider (in device pixels) as the user pinch zooms in.
This works as long as the scale on the context is >= 1. This patch ensures that a scaled down context won't blow up this gap.

Test: fast/text/large-synthetic-bold-with-scale-transform.html

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

LayoutTests:

* fast/text/large-synthetic-bold-with-scale-transform-expected.html: Added.
* fast/text/large-synthetic-bold-with-scale-transform.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/large-synthetic-bold-with-scale-transform-expected.html [new file with mode: 0644]
LayoutTests/fast/text/large-synthetic-bold-with-scale-transform.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm