w3c / ttml2

Timed Text Markup Language 2 (TTML2)
https://w3c.github.io/ttml2/
Other
41 stars 16 forks source link

Application semantics of text emphasis. #1080

Closed skynavga closed 5 years ago

skynavga commented 5 years ago

When authored in TTML2 1ed [1], the application (applies) semantics of text emphasis was copied from the definition of text decoration, inadvertently including the text "or other inline areas", which should be removed since text emphasis cannot be applied to inline areas that are not glyph areas. This is an editorial change to remove unintentional language which has no affect on conformance.

[1] https://www.w3.org/TR/2018/REC-ttml2-20181108/#style-attribute-textEmphasis

nigelmegitt commented 5 years ago

I think we need to tread very carefully when removing this text. In this specific case, the question in my mind is if the inline area is affected by the presence of text emphasis. There are two ways in which I think it is or could be: the content of the inline area changes, and the layout of the inline area can change.

Layout

Consider line height, as defined by CSS ; I understand that the semantics of line height in TTML are not identical, but I'd like to set that to one side for the time being.

For reference, the CSS Text Decoration Module Level 3 specifies:

The effect of emphasis marks on the line height is the same as for ruby text.

and the text in Ruby Layout Module Level 1 says:

if the line-height specified on the ruby container is less than the distance between the top of the top ruby annotation container and the bottom of the bottom ruby annotation container, then additional leading is added on the appropriate side of the ruby base container such that if a block consisted of three lines each containing ruby identical to this, none of the ruby containers would overlap.

Although the marks drawn are only relative to glyph areas, there is still a layout consideration for inline areas that contain text emphasis, so in that sense text emphasis does apply to the inline areas.

Inline area content

The text emphasis does not in fact affect the drawing of any glyph already included in the text content; rather it adds additional glyph marks within the inline areas in which emphasised glyphs exist. From that perspective it changes the content of the inline areas.

Proposal: close issue with no change

In summary, my reasoning for closing this issue with no change is that some aspects of inline areas can be affected by the presence of text emphasis, so it therefore does apply to inline areas. We could go further and further in defining the precise nature of what is impacted, but I don't think it's helpful to do so.

If we remove "and inline areas" then that signals that no inline area is affected by the textEmphasis attribute; that's factually incorrect.

skynavga commented 5 years ago

You are reading too much into the meaning of applies. First, I am saying that the only reason that the text "or other inline areas" is present now is because I copied the text from the tts:textDecoration property, which we have. As such, I treated text emphasis as essentially a form of text decoration. As we have just agreed to remove this language "or other inline areas" from tts:textDecoration, it would be inconsistent to not do so here as well. Furthermore, the meaning of applies to in the current context means "add the text emphasis (decoration) to each affected glyph area". If we were to retain the language "or other inline areas" it would give the mistaken impression that, for example, one could apply text decoration to an inline image area, or to an ruby text container (which generates an inline area), or to an inline block area (generated by a span with inlineBlock display).

When we don't mention or exclude a specific type of area from the prose description, it does not mean that an implementation can ignore the semantics of the style in all unstated cases. All of the other semantics of layout and its side effects are still in scope.

nigelmegitt commented 5 years ago

@skynavga I've gone back and re-read what glyph area means - I think you're saying that text emphasis is always applied by adding glyphs to glyph areas and never to any other kind of inline area.

Can we add a note to the section on text emphasis pointing out that it may affect line height especially in a CSS based presentation system? My reading of tts:rubyReserve is that it does not make any allowance for text emphasis, only for ruby text.

nigelmegitt commented 5 years ago

To clarify previous comment, @skynavga has persuaded me that "glyph area" is actually the only kind of inline area that gets extra content due to text emphasis, so I'm okay with removing the "or other inline areas" text as proposed in the issue.