Re: Displaying multiple lines in WebVTT

On Fri, Apr 6, 2012 at 12:22 AM, Glenn Maynard <glenn@zewt.org> wrote:
> [..]
>
> When the font being used to render captions is larger than the font the
> author used, it can easily result in lines no longer fitting, which results
> in captions meant to render like this:
>
>> word word word word word word word word word word word<br>
>> word word word word word word
>
> (<br> being the author's manual break) ending up looking like this:
>
>> word word word word word word word word word word
>> word<br>
>> word word word word word word
>
> This isn't theoretical.  I've seen this artifact in the real world many
> times (probably with SRT).
>
> (Please don't say that users can't be allowed to choose their own minimum
> font sizes.  That's a fundamental accessibility feature.  I always set a
> minimum font size in my browser, because web pages often use font sizes too
> small for my comfort.  That needs to apply to captions, just as with other
> web content.)
>
> This can happen if the line is longer than expected for any other reason,
> too.  Different font engines will result in different renderings; different
> fonts will be used due to font replacement when the font selected isn't
> available; even the same font can render differently in different versions
> of a font, and so on.  Content that expects a particular font rendering is
> broken, whether it's an HTML document or a caption, and we should do what we
> can to minimize that sort of content.  Currently, the format *encourages*
> it, which is very bad.
>
[..]
>
>> >  A "balanced" word-wrapping mode should also be
>> > added, to wrap lines in with balanced line-lengths, which is the typical
>> > wrapping method for captions.
>>
>> How do you suggest that should look?
>
>
> Basically, instead of using paragraph-style wrapping, which wraps (roughly
> speaking) at the latest opportunity per line:
>
> word word word word word word word word word word
> word word word word word word word word word word
> word word
>
> it adjusts the breaks to attempt to make each line a similar length:
>
> word word word word word word word word
> word word word word word word word word
> word word word word word word
>
> It would never use a greater number of line breaks than in the regular
> wrapping mode.  Above, two line breaks are used, and balanced wrapping would
> never increase that to three in an attempt to balance more evently.  It
> would only move the breaks around.
>
> (This would be a CSS feature that WebVTT would use, not a WebVTT-specific
> feature.  I think Ian at least sounded open to the idea when I talked to him
> about it last.)

I've had a bit of a chat with some people on the Chrome team that work
on CSS and the balanced text wrapping mode that we are after indeed is
not easy to implement using CSS. It basically requires a new CSS
algorithm.

We're considering this to be a new value for text-wrap - something
like "text-wrap: balance;". It would states something along the lines
of what you outlined - basically that it minimizes white space in the
last line of a multi-line paragraph by re-distributing this white
space over all lines and thus making the individual lines shorter. How
a browser implements this would be up to the browser.

What we likely need to do is: write a proposal (in a wiki page or so)
for this new mode, explaining our use case. We should then send it out
to the www-style list for general discussion. If you are keen, do go
ahead with preparing such a proposal.

Cheers,
Silvia.

Received on Tuesday, 17 April 2012 21:46:35 UTC