Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the semantics of tts:fontSize="2em". #214

Closed
palemieux opened this issue Sep 19, 2016 · 8 comments · Fixed by #301
Closed

Clarify the semantics of tts:fontSize="2em". #214

palemieux opened this issue Sep 19, 2016 · 8 comments · Fixed by #301

Comments

@palemieux
Copy link
Contributor

XSL, which TTML uses as a reference for 'em', states that "a relative length is a unit-based value that is measured against the current value of the font-size property" and "when the "font-size" property is
evaluated, the current font-size for use in evaluation is the font-size of the parent element"

While TTML does not specify a definition for the current value of tts:fontSize, using the computed value of tts:fontSize of the parent would be consistent with XSL and the definition of the percentage metric in TTML.

See also #206

@skynavga skynavga changed the title Clarify the semantics of tts:fontSize="2em" Clarify the semantics of tts:fontSize="2em". Dec 22, 2016
@nigelmegitt nigelmegitt added this to the TTML1 Third Edition milestone Jan 12, 2017
@nigelmegitt
Copy link
Contributor

[Meeting 2017-01-12] @skynavga to add a note under tts:fontSize to say that em units in fontSize are resolved relative to the parent element's fontSize unless the element is region in which case they are relative to 1c (as agreed for #206).

@cconcolato
Copy link
Contributor

cconcolato commented Nov 3, 2017

It is unclear to me from reading the different issues, if this issue will be fixed in a compatible way compared to TTML2?

w3c/ttml2#216 seems to indicate that:

TTML2 will require a somewhat different treatment

Is this different treatment purely editorial? If not, is it compatible treatment?

@nigelmegitt
Copy link
Contributor

@cconcolato that's a good point - going through it with a worked example:

<tt ttp:cellResolution="32 15">
 <head>
  <layout>
    <region xml:id="r1" tts:fontSize="100% 100%"/>
  </layout>
 </head>
...
</tt>

The question is: what is the computed font size inherited by content selected into the region?

Processing as per TTML1:

  • The computed font size that is used as the basis for inheritance from the region is 1/32 of the root container region wide and 1/15 of the root container region high.

Processing as per TTML2:

  • The computed font size that is used as the basis for inheritance from the tt element is 1/15 of the root container height in both height and width since the initial value of 1c applies.
  • The region inherits this and does not change it.
  • The computed font size that is used as the basis for inheritance from the region is therefore 1/15 of the root container height in both height and width.

Therefore this document has a different apparent font size depending on whether the TTML1 or TTML2 processing semantic is used.

Unless my analysis is wrong, this is a problem.

@cconcolato
Copy link
Contributor

I agree with your analysis, but I suspect that the intention is that the behavior when processed by a TTML2 processor should be the same as for a TTML1 processor if the @version attribute is set to 1. This is currently not in the spec but @skynavga email indicates that TTT uses @version to:

[ttx] select between tt element and region element for root of style inheritance (1 instance)

As indicated in my response to the email, I think the behavior should not be triggered based on version but based on feature. We should have a #inherit-root-tt to select TTML2 behavior.

@skynavga
Copy link
Contributor

skynavga commented Dec 1, 2017

@nigelmegitt your analysis is wrong; I will provide details over the weekend

@nigelmegitt
Copy link
Contributor

@skynavga ok, looking forward to seeing that.

@nigelmegitt
Copy link
Contributor

I'd support a feature designator for root inheritance @cconcolato

@palemieux palemieux assigned palemieux and unassigned skynavga Dec 16, 2017
palemieux added a commit that referenced this issue Dec 19, 2017
Clarify tts:fontSize specified using two percentage values (#215)
@nigelmegitt
Copy link
Contributor

@skynavga in #214 (comment) you said you'd provide details over the weekend. Is anything preventing you from doing so?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants