Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 720fc1082286802ee65af48d21b4a5dbac84ef5b
      
https://github.com/WebKit/WebKit/commit/720fc1082286802ee65af48d21b4a5dbac84ef5b
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-06-12 (Fri, 12 Jun 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-zero-advance-glyph-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-zero-advance-glyph.html
    M Source/WebCore/platform/graphics/ComplexTextController.cpp
    M Source/WebCore/platform/graphics/WidthIterator.cpp

  Log Message:
  -----------
  Synthetic bold adds advance width to zero-advance glyphs
https://bugs.webkit.org/show_bug.cgi?id=316951
rdar://179418570

Reviewed by Darin Adler and Brent Fulgham.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

Synthetic bold padded every glyph's advance by syntheticBoldOffset()
(fontSize / 36), including glyphs whose real advance is 0 (combining
marks, zero-width spaces, empty/zero-width fonts). A run of such glyphs
measured N * fontSize / 36 wide instead of 0, e.g. a bold heading in a
zero-advance font reserved a visible gap not present in other engines.

A zero-advance glyph draws in place and must not advance the pen.
Letter-spacing already guards this with `if (advance.width())`; apply the
same guard to synthetic bold in both text paths. The simplified-measuring
path asserts no synthetic bold, so it needs no change.

Test: css/css-fonts/synthetic-bold-zero-advance-glyph.html

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-zero-advance-glyph-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/synthetic-bold-zero-advance-glyph.html:
 Added.
(WebCore::ComplexTextController::enclosingGlyphBoundsForTextRun):
* Source/WebCore/platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::applyCSSVisibilityRules):

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



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

Reply via email to