[Webkit-unassigned] [Bug 255712] New: WebKit applies extraneous spaces when letter-spacing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 20 00:46:36 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=255712

            Bug ID: 255712
           Summary: WebKit applies extraneous spaces when letter-spacing
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: xfq.free at gmail.com
                CC: bfulgham at webkit.org, simon.fraser at apple.com,
                    zalan at apple.com

Currently WebKit applies letter-spacing by adding a space after every letter in the text that is tracked. This results in a superfluous space at the end of the range, which creates an inappropriate gap before the following text. Letter spacing at the end of a line makes the line look misaligned in justified or right-justified text. It also has implications for text that has other styling, such as an outline or a coloured background, at the same time as being stretched.

Example in German: https://user-images.githubusercontent.com/4839211/87327736-5c89f780-c52c-11ea-8d22-7b994925d61a.png

Spec: https://github.com/w3c/csswg-drafts/issues/1518
https://drafts.csswg.org/css-text-3/#letter-spacing-property requires letter-spacing to only insert space within the selection, not outside, so it is the browser implementations that need to be fixed.

Tests & results:
Letter-spaced text should create no space on the outside of the selection: https://github.com/w3c/line_paragraph_tests/issues/55

Webkit puts the letter spacing after a letter even when it is at the end of a line, which makes the line look misaligned in justified or right-justified text.

For now, content authors have to work around the problem by applying a negative margin to remove the trailing space.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230420/42180b6d/attachment.htm>


More information about the webkit-unassigned mailing list