This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
As I was creating more details for the conversion from CEA-608/708 caption format specifications to WebVTT, I've come across a need to specify real numbers and not just integers as percentage values for the "line" cue setting: http://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/608toVTT.html#positioning-in-cea-608 Can we allow floating-point numbers as percentage values for line and position cue settings?
In a 1080p setting, 1% is 10 pixels, and the font size at 5% is 50 pixels. Does it really matter that you can't position it more accurately than 10 pixels? I guess it's not a big deal, but it does have knock-on effects throughout the API.
It's not just the 10px, but it's a cumulative effect. For example, CEA-608 defines 15 lines on 80% of the video height. That's 5.33% line height. If that gets reduced to 5%, then we end up with an extra line. I have no means of getting to exactly 15 lines.
Just round instead of truncating.
That just creates an uneven distribution of lines on top of the video with different gaps.
So just use WebVTT's line feature, instead of trying to use CEA-608. :-) Trying to coerce one format into another format is pointless. If you want to support CEA-608, then just implement it. WebVTT isn't supposed to be a format that implements other formats. It's supposed to be subtitles for the Web.
It doesn't matter if it's CEA-608 or anything else that I try to implement - I should be able to decide how many lines of text I want displayed on top of my video and be able to position my text exactly on those lines. The line numbering doesn't help for this, because with line numbers the browser and the font decide how much distance there is between lines. The crux is: if I want exact placement based on percentage, then that should have a sufficiently large resolution to place exactly - if possible down to the pixel level. For this we need floats as percentage.
(In reply to Silvia Pfeiffer from comment #6) > It doesn't matter if it's CEA-608 or anything else that I try to implement - > I should be able to decide how many lines of text I want displayed on top of > my video and be able to position my text exactly on those lines. The line > numbering doesn't help for this, because with line numbers the browser and > the font decide how much distance there is between lines. > > The crux is: if I want exact placement based on percentage, then that should > have a sufficiently large resolution to place exactly - if possible down to > the pixel level. For this we need floats as percentage. +1 to the need for floats as percentage values.
I am currently reviewing https://github.com/w3c/webvtt/pull/18 which refers to this bug. This bug only argues for greater precision for line, but sure, it would be silly to only fix line and not the other two. The current spec limits the range of position and size to 0-100, so those can be packed efficiently to reduce memory. Going to double for all of these attributes gives us way more precision than we need, wasting memory. I think we should either go with float, or something silly like allowing a single extra decimal, giving us a precision of 1000, if that is sufficient for the use case.
It's also good to be consistent considering bug 23865
Given the recommendation to use double in WebIDL [1] and the fact that there is not a single use of "float" in the APIs of the HTML spec, I suggest we stay consistent in our WebIDL with "double". [1] http://heycam.github.io/webidl/#idl-float
Fixed in https://github.com/w3c/webvtt/commit/64825911acce356bdd95c5ce8a8755f87f1d0702