This PR fixes issue #166 (font size percentages getting re-multiplied each time they are inherited) and one unticketed TODO comment (tts:textEmphasis not working on nested <span>s.)
The input file for this test contains a <span> with a tts:textEmphasis and an additional <span> nested within it. The TTML2 spec says that tts:textEmphasis is a heritable property, so it should be applying to the nested <span>.
In the upstream "expected" result (bottom,) not only are the decorations missing on the nested <span>'s text, but the text itself is missing too. In the "new" rendition (top,) the text and its decorations are present. This is a better representation of the source file and more closely resembles the reference rendering from w3c as well.
ttml2-prstn-ruby-align-imsc11-4
The input file for this test has most of the document at a font size of 48px, but the English text has a font size of 75% in a child element. This ought to be 75% of 48 pixels, or 36 pixels.
In the intermediate golden file (bottom,) we can see that the font size on the English text is too small. In the new rendering (top,) the font size is correct. I have also verified this by diffing the SVG files:
As you can see, the erroneous font size of 27 is removed, and the correct size of 36 is retained.
This issue happened because the percentage of 75% was re-applied every time the font size was inherited by a child element, which is the TTT issue 166 that I am fixing here. 75% of 36 is 27.
This PR fixes issue #166 (font size percentages getting re-multiplied each time they are inherited) and one unticketed TODO comment (
tts:textEmphasis
not working on nested<span>
s.)Both of these fixes were authored by myself.
Test Changes
ttml2-prstn-text-emphasis-imsc11-2
The original for this test case is here: https://github.com/w3c/imsc-tests/blob/main/imsc1_1/ttml/textEmphasis/textEmphasis002.ttml And the reference rendering is here: https://github.com/w3c/imsc-tests/blob/main/imsc1_1/png/textEmphasis002/0.000000.png
The input file for this test contains a
<span>
with atts:textEmphasis
and an additional<span>
nested within it. The TTML2 spec says thattts:textEmphasis
is a heritable property, so it should be applying to the nested<span>
.In the upstream "expected" result (bottom,) not only are the decorations missing on the nested
<span>
's text, but the text itself is missing too. In the "new" rendition (top,) the text and its decorations are present. This is a better representation of the source file and more closely resembles the reference rendering from w3c as well.ttml2-prstn-ruby-align-imsc11-4
The input file for this test has most of the document at a font size of
48px
, but the English text has a font size of75%
in a child element. This ought to be 75% of 48 pixels, or 36 pixels.In the intermediate golden file (bottom,) we can see that the font size on the English text is too small. In the new rendering (top,) the font size is correct. I have also verified this by diffing the SVG files:
As you can see, the erroneous font size of 27 is removed, and the correct size of 36 is retained.
This issue happened because the percentage of 75% was re-applied every time the font size was inherited by a child element, which is the TTT issue 166 that I am fixing here. 75% of 36 is 27.