Changeset 245191 in webkit
- Timestamp:
- May 10, 2019 1:30:05 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245181 r245191 1 2019-05-10 Zalan Bujtas <zalan@apple.com> 2 3 [iOS] baidu.com: Synthetic bold renders too far apart, appears doubled. 4 https://bugs.webkit.org/show_bug.cgi?id=197781 5 <rdar://problem/48027412> 6 7 Reviewed by Simon Fraser. 8 9 * fast/text/large-synthetic-bold-with-scale-transform-expected.html: Added. 10 * fast/text/large-synthetic-bold-with-scale-transform.html: Added. 11 1 12 2019-05-10 Simon Fraser <simon.fraser@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r245190 r245191 1 2019-05-10 Zalan Bujtas <zalan@apple.com> 2 3 [iOS] baidu.com: Synthetic bold renders too far apart, appears doubled. 4 https://bugs.webkit.org/show_bug.cgi?id=197781 5 <rdar://problem/48027412> 6 7 Reviewed by Simon Fraser. 8 9 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 10 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. 11 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. 12 13 Test: fast/text/large-synthetic-bold-with-scale-transform.html 14 15 * platform/graphics/cocoa/FontCascadeCocoa.mm: 16 (WebCore::FontCascade::drawGlyphs): 17 1 18 2019-05-10 Brent Fulgham <bfulgham@apple.com> 2 19 -
trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm
r242325 r245191 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.