Changeset 245230 in webkit
- Timestamp:
- May 12, 2019, 11:51:20 PM (7 years ago)
- Location:
- branches/safari-608.1.24-branch
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/text/large-synthetic-bold-with-scale-transform-expected.html (added)
-
LayoutTests/fast/text/large-synthetic-bold-with-scale-transform.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-608.1.24-branch/LayoutTests/ChangeLog
r245225 r245230 1 2019-05-12 Babak Shafiei <bshafiei@apple.com> 2 3 Cherry-pick r245191. rdar://problem/48027412 4 5 [iOS] baidu.com: Synthetic bold renders too far apart, appears doubled. 6 https://bugs.webkit.org/show_bug.cgi?id=197781 7 <rdar://problem/48027412> 8 9 Reviewed by Simon Fraser. 10 11 Source/WebCore: 12 13 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 14 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. 15 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. 16 17 Test: fast/text/large-synthetic-bold-with-scale-transform.html 18 19 * platform/graphics/cocoa/FontCascadeCocoa.mm: 20 (WebCore::FontCascade::drawGlyphs): 21 22 LayoutTests: 23 24 * fast/text/large-synthetic-bold-with-scale-transform-expected.html: Added. 25 * fast/text/large-synthetic-bold-with-scale-transform.html: Added. 26 27 28 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245191 268f45cc-cd09-0410-ab3c-d52691b4dbfc 29 30 2019-05-10 Zalan Bujtas <zalan@apple.com> 31 32 [iOS] baidu.com: Synthetic bold renders too far apart, appears doubled. 33 https://bugs.webkit.org/show_bug.cgi?id=197781 34 <rdar://problem/48027412> 35 36 Reviewed by Simon Fraser. 37 38 * fast/text/large-synthetic-bold-with-scale-transform-expected.html: Added. 39 * fast/text/large-synthetic-bold-with-scale-transform.html: Added. 40 1 41 2019-05-12 Babak Shafiei <bshafiei@apple.com> 2 42 -
branches/safari-608.1.24-branch/Source/WebCore/ChangeLog
r245126 r245230 1 2019-05-12 Babak Shafiei <bshafiei@apple.com> 2 3 Cherry-pick r245191. rdar://problem/48027412 4 5 [iOS] baidu.com: Synthetic bold renders too far apart, appears doubled. 6 https://bugs.webkit.org/show_bug.cgi?id=197781 7 <rdar://problem/48027412> 8 9 Reviewed by Simon Fraser. 10 11 Source/WebCore: 12 13 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 14 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. 15 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. 16 17 Test: fast/text/large-synthetic-bold-with-scale-transform.html 18 19 * platform/graphics/cocoa/FontCascadeCocoa.mm: 20 (WebCore::FontCascade::drawGlyphs): 21 22 LayoutTests: 23 24 * fast/text/large-synthetic-bold-with-scale-transform-expected.html: Added. 25 * fast/text/large-synthetic-bold-with-scale-transform.html: Added. 26 27 28 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245191 268f45cc-cd09-0410-ab3c-d52691b4dbfc 29 30 2019-05-10 Zalan Bujtas <zalan@apple.com> 31 32 [iOS] baidu.com: Synthetic bold renders too far apart, appears doubled. 33 https://bugs.webkit.org/show_bug.cgi?id=197781 34 <rdar://problem/48027412> 35 36 Reviewed by Simon Fraser. 37 38 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 39 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. 40 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. 41 42 Test: fast/text/large-synthetic-bold-with-scale-transform.html 43 44 * platform/graphics/cocoa/FontCascadeCocoa.mm: 45 (WebCore::FontCascade::drawGlyphs): 46 1 47 2019-05-09 Antti Koivisto <antti@apple.com> 2 48 -
branches/safari-608.1.24-branch/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm
r242325 r245230 277 277 FloatSize horizontalUnitSizeInDevicePixels = contextCTM.mapSize(FloatSize(1, 0)); 278 278 float horizontalUnitLengthInDevicePixels = sqrtf(horizontalUnitSizeInDevicePixels.width() * horizontalUnitSizeInDevicePixels.width() + horizontalUnitSizeInDevicePixels.height() * horizontalUnitSizeInDevicePixels.height()); 279 if (horizontalUnitLengthInDevicePixels) 280 syntheticBoldOffset /= horizontalUnitLengthInDevicePixels; 279 if (horizontalUnitLengthInDevicePixels) { 280 // Make sure that a scaled down context won't blow up the gap between the glyphs. 281 syntheticBoldOffset = std::min(syntheticBoldOffset, syntheticBoldOffset / horizontalUnitLengthInDevicePixels); 282 } 281 283 }; 282 284
Note:
See TracChangeset
for help on using the changeset viewer.