Re: [csswg-drafts] [css-pseudo] Proposal: Add `text-wrap: balance` to supported `::cue` properties (#8640)

Using a rendered-length basis for `text-wrap: balance` likely works okay for paragraphs of text in long columns, but is probably the wrong choice for cues used for subtitles or captions, that are typically a small number, e.g. 2 or 3, sometimes 4, lines long.

Instead, for the subtitle and caption use case:

* text needs to be broken into "blocks" that are each short groups of lines, where each block appears consecutively in time
* both the blocks and the lines in the blocks should be broken based on grammatical structure, e.g. using natural language processing, though the blocks themselves need also to be chosen based on the timing of associated audio

An example of editorial guidance for this problem in English can be found in the [BBC Subtitle Guidelines section "Break at natural points"](https://www.bbc.co.uk/accessibility/forproducts/guides/subtitles#Break-at-natural-points)

The solution space for this could be one of several different options:
1. Authors divide the text into blocks, and the blocks into lines, inserting manual line breaks;
2. Authors divide the text into blocks without manual line breaks, and the renderer divides the blocks into lines;
3. Authors provide transcripts with word by word, or phrase by phrase, timings, and the renderer divides the transcripts into blocks, and the blocks into lines.

Of these options, 1 and 2 are currently the typical approach, that is essentially encoded into WebVTT and TTML. Option 3 could ultimately be a more accessible and elegant approach, but has only been demonstrated in prototype form some years ago, documented in [BBC R&D White Paper 295](https://www.bbc.co.uk/rd/publications/whitepaper295), and not adopted more broadly.

Option 1 is the most robust as long as the text size is not increased after authoring, since that can introduce additional line breaks. It does not need `text-wrap: balance`.

Option 2 is the one where something like `text-wrap: balance` could be most useful, but not if the algorithm is purely looking at line length.

-- 
GitHub Notification of comment by nigelmegitt
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8640#issuecomment-1742949606 using your GitHub account


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

Received on Monday, 2 October 2023 12:45:36 UTC