Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f62c19686abf9be1da062e32b09ea68ea7a23fe4
      
https://github.com/WebKit/WebKit/commit/f62c19686abf9be1da062e32b09ea68ea7a23fe4
  Author: Brent Fulgham <[email protected]>
  Date:   2026-09-15 (Tue, 15 Sep 2026)

  Changed paths:
    M LayoutTests/fast/text/tab-width-synthetic-bold-complex-expected.html
    M LayoutTests/fast/text/tab-width-synthetic-bold-complex.html
    M LayoutTests/fast/text/tab-width-synthetic-bold-expected.html
    M LayoutTests/fast/text/tab-width-synthetic-bold.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-does-not-widen-advances-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-does-not-widen-advances.html
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-space-width-expected.html
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-space-width-ref.html
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-space-width.html
    A 
LayoutTests/platform/ios/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt
    M LayoutTests/platform/ios/fast/text/font-weights-zh-expected.txt
    M LayoutTests/platform/ios/fonts/fantasy-expected.txt
    M LayoutTests/platform/ios/tables/mozilla/bugs/bug2479-3-expected.txt
    M 
LayoutTests/platform/mac-sequoia-wk2/tables/mozilla/bugs/bug2479-3-expected.txt
    M LayoutTests/platform/mac-wk2/tables/mozilla/bugs/bug2479-3-expected.txt
    M LayoutTests/platform/mac/fast/css/font-face-multiple-faces-expected.txt
    M 
LayoutTests/platform/mac/fast/css/font-face-synthetic-bold-italic-expected.txt
    M LayoutTests/platform/mac/fast/css/font-face-weight-matching-expected.txt
    A 
LayoutTests/platform/mac/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt
    M LayoutTests/platform/mac/fast/text/atsui-multiple-renderers-expected.txt
    M 
LayoutTests/platform/mac/fast/text/complex-synthetic-bold-space-width-expected.txt
    M LayoutTests/platform/mac/fonts/cursive-expected.txt
    M LayoutTests/platform/mac/fonts/fantasy-expected.png
    M LayoutTests/platform/mac/fonts/fantasy-expected.txt
    M LayoutTests/platform/mac/fonts/monospace-expected.png
    M LayoutTests/platform/mac/fonts/monospace-expected.txt
    M LayoutTests/platform/mac/svg/W3C-SVG-1.1/interact-cursor-01-f-expected.png
    M LayoutTests/platform/mac/svg/W3C-SVG-1.1/interact-cursor-01-f-expected.txt
    M LayoutTests/platform/mac/tables/mozilla/bugs/bug2479-3-expected.txt
    M Source/WebCore/platform/graphics/ComplexTextController.cpp
    M Source/WebCore/platform/graphics/Font.cpp
    M Source/WebCore/platform/graphics/Font.h
    M Source/WebCore/platform/graphics/FontBase.h
    M Source/WebCore/platform/graphics/FontCascade.h
    M Source/WebCore/platform/graphics/FontCascadeInlines.h
    M Source/WebCore/platform/graphics/WidthIterator.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp

  Log Message:
  -----------
  maisonalyzee.com: Text incorrectly wrapped
https://bugs.webkit.org/show_bug.cgi?id=201725
rdar://55307109

Reviewed by Vitor Roriz.

WebKit widens a synthetic-bold glyph's ink at paint time by a small offset to 
"thicken"
the ink to create the bold effect. It also adds the same small offset to the 
glyph's
advance, so that adjacent bold qlyphs would not visibly collide. That "padding" 
leaked into
every stored width derived from it (e.g., space width, tab-size, the 'ch' and 
'ic' units),
so a letter-spaced heading in a synthetic-bold WebFont can overflow its 
container and wrap.

Synthetic-oblique already allows ink to exceed the glyph's advance with no 
compensation,
and `GlyphOverflow` already tracks ink that spills past the advance. The extra 
padding
applied for synthetic-bold is redundant with the logic that already handles the 
cases it
was meant to protect against.

Removing the synthetic-bold offset from the advance leaves painting untouched, 
and corrects
the 'ch' and 'tab-size' to match the face's real metrics.

Since Chrome and the WebKit's Skia ports do not offset advances when drawing 
synthetic bold,
this change brings the CoreText, FreeType, and Windows ports into alignment 
with web-standard
behavior.

Tests: Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp
       
imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-does-not-widen-advances.html

* LayoutTests/fast/text/tab-width-synthetic-bold-complex-expected.html:
* LayoutTests/fast/text/tab-width-synthetic-bold-complex.html:
* LayoutTests/fast/text/tab-width-synthetic-bold-expected.html:
* LayoutTests/fast/text/tab-width-synthetic-bold.html:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-does-not-widen-advances-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-does-not-widen-advances.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-space-width-expected.html:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-space-width-ref.html:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-space-width.html:
* 
LayoutTests/platform/ios/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt:
 Added.
* LayoutTests/platform/ios/fast/text/font-weights-zh-expected.txt:
* LayoutTests/platform/ios/fonts/fantasy-expected.txt:
* LayoutTests/platform/ios/tables/mozilla/bugs/bug2479-3-expected.txt:
* 
LayoutTests/platform/mac-sequoia-wk2/tables/mozilla/bugs/bug2479-3-expected.txt:
* LayoutTests/platform/mac-wk2/tables/mozilla/bugs/bug2479-3-expected.txt:
* LayoutTests/platform/mac/fast/css/font-face-multiple-faces-expected.txt:
* 
LayoutTests/platform/mac/fast/css/font-face-synthetic-bold-italic-expected.txt:
* LayoutTests/platform/mac/fast/css/font-face-weight-matching-expected.txt:
* 
LayoutTests/platform/mac/fast/text-indicator/text-indicator-estimated-color-with-implicit-newline-expected.txt:
 Added.
* LayoutTests/platform/mac/fast/text/atsui-multiple-renderers-expected.txt:
* 
LayoutTests/platform/mac/fast/text/complex-synthetic-bold-space-width-expected.txt:
* LayoutTests/platform/mac/fonts/cursive-expected.txt:
* LayoutTests/platform/mac/fonts/fantasy-expected.png:
* LayoutTests/platform/mac/fonts/fantasy-expected.txt:
* LayoutTests/platform/mac/fonts/monospace-expected.png:
* LayoutTests/platform/mac/fonts/monospace-expected.txt:
* LayoutTests/platform/mac/svg/W3C-SVG-1.1/interact-cursor-01-f-expected.png:
* LayoutTests/platform/mac/svg/W3C-SVG-1.1/interact-cursor-01-f-expected.txt:
* LayoutTests/platform/mac/tables/mozilla/bugs/bug2479-3-expected.txt:
* Source/WebCore/platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::enclosingGlyphBoundsForTextRun):
* Source/WebCore/platform/graphics/Font.cpp:
(WebCore::Font::platformGlyphInit):
* Source/WebCore/platform/graphics/Font.h:
* Source/WebCore/platform/graphics/FontBase.h:
(WebCore::FontBase::spaceWidth const):
* Source/WebCore/platform/graphics/FontCascade.h:
* Source/WebCore/platform/graphics/FontCascadeInlines.h:
(WebCore::FontCascade::tabWidth const):
* Source/WebCore/platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advanceInternal):
(WebCore::WidthIterator::calculateAdditionalWidth const):
(WebCore::WidthIterator::applyCSSVisibilityRules):
* Tools/TestWebKitAPI/Tests/WebCore/ComplexTextController.cpp:
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, 
SyntheticBoldDoesNotSlideAFollowingMark)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, 
TabWidthDoesNotSlideAFollowingMark)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, 
TabWidthDoesNotSlideAMarkInRTL)):
(TestWebKitAPI::TEST_F(ComplexTextControllerTest, 
SyntheticBoldDoesNotSlideAMarkInRTL)):

Canonical link: https://commits.webkit.org/321206@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to