Bug 157383 - Implement “text-spacing” property as specified in CSS Text Module Level 4
Summary: Implement “text-spacing” property as specified in CSS Text Module Level 4
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: https://drafts.csswg.org/css-text-4/#...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-05-05 13:11 PDT by Minsheng Liu
Modified: 2023-03-26 23:54 PDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Minsheng Liu 2016-05-05 13:11:25 PDT
Spec URL: https://drafts.csswg.org/css-text-4/#text-spacing-property

> This property controls spacing between adjacent characters on the same line within the same inline formatting context using a set of character-class-based rules.

This property is very important for CJK typography:

1. It controls the spacing between CJK characters and other characters, which is required by CJK typography.

In the past content creators have to manually insert spaces. Such a practice often creates inconsistence across pages (not everyone is used to inserting spaces between letters and characters). Moreover, due to the web page’s font fallback rule, the width of a space character is hard to control. The default setting in many Western fonts might be too wide or too narrow for the purpose of separating CJK characters from letters visually.

2. It controls the spacing within sequence of full-width punctuations. For instance, a full-width open bracket “(” looks like:
_( (I use underscore to represent the spacing)
. When two such brackets are adjacent, it will look like:
_(_(
while it looks better with:
_((
. Since the spacing is encoded inside the font, it is very hard to remove it—excepting wrapping the character inside a <span> and apply negative margin to it, which might have its own issues when dealing with line breaks.

Note also the property “punctuation”, which
> Creates extra non-breaking spacing around punctuation as required by language-specific typographic conventions.
It currently only matters to French, which I am unfamiliar with. It should be very important though.

I believe this feature will benefit users in CJK regions significantly, so I look forward to someone interested in implementing it. I am a bit inexperienced in C++ and lack the experience in hacking WebKit. However, if I have enough time I might give it a try.
Comment 1 Radar WebKit Bug Importer 2022-09-22 23:15:40 PDT
<rdar://problem/100310977>
Comment 2 Fuqiao Xue 2023-03-26 23:54:40 PDT
FWIW, the property has been refactored in Feb 2023: https://github.com/w3c/csswg-drafts/commit/29661048af03edf0c093f339e03afc41803c6238