w3c / ttml-webvtt-mapping

TTML to WebVTT mapping
https://w3c.github.io/ttml-webvtt-mapping/
Other
7 stars 8 forks source link

tts:origin to VTTCue position/line looks backwards #25

Closed joeyparrish closed 8 years ago

joeyparrish commented 8 years ago

This text in the mapping spec looks backward to me:

To convert tts:origin to WebVTT cue settings: ...

  • If the block progression direction is top to bottom:
    • The value of the "line" cue setting is the percentage value for the second coordinate of the origin attribute.
    • The value of the "position" cue setting is the percentage value for the first coordinate of the origin attribute.
  • If the block progression direction is left to right:
    • The value of the "line" cue setting is the percentage value for the first coordinate of the origin attribute.
    • The value of the "position" cue setting is the percentage value for the second coordinate of the origin attribute.

The VTT spec says:

The position defines the indent of the cue box in the direction defined by the writing direction.

For horizontal text (left to right), the x coordinate (first coordinate) should be used to indent the text horizontally. Therefore the first coordinate should set position, not line.

Is this a mistake, or do I misunderstand the specs?

andreastai commented 8 years ago

You may have mixed up inline- and block-progression-direction. If the direction of blocks (e.g. a paragraph) is left-to-right the lines do not stack top-to-bottom but from left-to-right. The inline-progression (the direction of the words and characters) would be in this case top-to-bottom. In WebVTT terms you would speak about "vertical cues". For vertical cues the indent of the cue box is defined by the y-coordinate of tts:origin (so the second value).

joeyparrish commented 8 years ago

The TTML spec says:

The tts:origin attribute is used to specify the x and y coordinates of the origin of a region area with respect to the origin of the Root Container Region.

The WebVTT spec says:

The position defines the indent of the cue box in the direction defined by the writing direction.

and:

A writing direction, either

  • horizontal (a line extends horizontally and is offset vertically from the video viewport’s top edge, with consecutive lines displayed below each other),
  • vertical growing left (a line extends vertically and is offset horizontally from the video viewport’s right edge, with consecutive lines displayed to the left of each other), or
  • vertical growing right (a line extends vertically and is offset horizontally from the video viewport’s left edge, with consecutive lines displayed to the right of each other).

So for "horizontal writing direction", as in English, the WebVTT indent and therefore the position is the x coordinate from TTML. Is this correct?

But what you're saying is that the mapping spec refers to "block progression direction", and not "inline progression direction". The latter is the same as the "writing direction", while the former is the inverse of that. Do I understand you correctly?

andreastai commented 8 years ago

So for "horizontal writing direction", as in English, the WebVTT indent and therefore the position is the x coordinate from TTML. Is this correct?

"horizontal writing direction" in WebVTT terms: yes

But what you're saying is that the mapping spec refers to "block progression direction", and not "inline progression direction". The latter is the same as the "writing direction", while the former is the inverse of that. Do I understand you correctly?

Yes. As in the text you copied in your first comment

If the block progression direction is left to right: ....

Thanks for your very helpful feedback. Positioning is one of the most difficult mapping tasks. I will think about how this spec part you referred to can be made clearer.

joeyparrish commented 8 years ago

Awesome, thank you for clarifying for me.

andreastai commented 8 years ago

Great! Glad that we can be of help! Please continue open issues if you find other problems in the spec. This the best way how we can improve it!

If you are fine with the clarification you may close this issue.

joeyparrish commented 8 years ago

My issue is solved by the explanation you gave, yes. So I will close.

But I think it might be helpful to future readers of the spec if that bit of the spec was clarified WRT "block progression direction" vs "inline progression direction". So please consider adding a note or rewording in some way.

Thanks!