Re: WebVTT wrapping

On Sat, 31 Dec 2011, Glenn Maynard wrote:
> On Mon, Dec 5, 2011 at 11:37 PM, Glenn Maynard <glenn@zewt.org> wrote:
> > On Mon, Dec 5, 2011 at 7:38 PM, Ian Hickson <ian@hixie.ch> wrote:
> >
> >> > If wrapping to similar line lengths is what's wanted, then the VTT 
> >> > renderer (and so CSS) should support that.
> >>
> >> Possibly. It's not currently. It would require a new 'white-space' 
> >> value. Given that, it would be easy to support in VTT; just have 
> >> authors not use line breaks at all, and let the renderer do it.
> >>
> > I think this is much better than having people do it by hand.
> 
> As a real example of this sort of approach causing problems, see the 
> attached, which is from the YouTube Android app.  When the caption font 
> size is set to "extra large", it falls apart.  (In case the archive 
> breaks attachments: http://i.imgur.com/IaGNv.png, 
> http://i.imgur.com/zcgTv.png.)
> 
> This could also be triggered by differences in font engines, different 
> fonts being used (for any number of reasons), differences in 
> word-breaking and hyphenization rules (both of which are left to the 
> UA), the stylesheet used during authoring not being loaded, and so on.
> 
> It also makes manual editing of captions harder, since you need to view 
> the final output in order to adjust wrapping.  It complicates tools 
> significantly: *every* tool that modifies caption text will need some 
> way to update wrapping, which means every tool effectively needs access 
> to a complete parser, renderer, the fonts (assumed to be) in use, and so 
> on.  If you want to change the line width, you have to re-wrap the 
> entire document.  Allowing a user-adjustable maximum width (as any eBook 
> reader supports) is probably impossible.

I've fixed WebVTT to say that lines should be wrapped with line balancing. 
So now if you want good line wrapping you can just put it all on one line, 
and if you want explicit line breaks you can just put those in too.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Wednesday, 25 April 2012 00:12:16 UTC