[csswg-drafts] [css-text] Enable finer control over text-justify (#7738)

scottkellum has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-text] Enable finer control over text-justify ==
[css-text#text-justify-property](https://drafts.csswg.org/css-text/#text-justify-property)

Currently there is little control over justification settings in CSS. This often results in egregious [rivers](https://en.wikipedia.org/wiki/River_(typography)) when text is justified. While there is some control with the `text-justify` property, it lacks necessary control to adequately fine tune justification.

Design programs like Adobe InDesign allow for nuanced control of 3 characteristics: word spacing, letter spacing, and font stretch. The current keywords only allow for word spacing and letter spacing to be turned on or off, with no support for font stretch.

## Proposal

Allow a series of numbers to be passed into `text-justify` to choose what text characteristics are altered by the justification algorithm. `text-justify: 1 0 0` would be the same as `inter-word` and `text-justify: 0 1 0` would be the same as `inter-character`. You could change this setting to `text-justify: 1 1 0` to evenly distribute the extra space to both word spacing and letter spacing, or `text-justify: 1 1 1` to include `font-stretch` as well. Additionally, proportions could be changed by adjusting the values. `text-justify: 2 1 0` would mean twice as much of the extra space would be distributed to word spacing as letter spacing.

## Related resources:

- [TypeNetwork’s justification using variable font width](https://variablefonts.typenetwork.com/topics/spacing/justification)
- [TypeEd’s guide to hyphenation and justification](https://type-ed.com/resources/rag-right/2015/10/01/secret-setting-balanced-block-copy)

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7738 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 14 September 2022 04:03:58 UTC