W3C home > Mailing lists > Public > public-tt@w3.org > August 2012

Re: questions on simple profile - nested spans

From: Goldstein, Glenn <glenn.goldstein@viacom.com>
Date: Tue, 31 Jul 2012 17:34:45 +0000
To: "public-tt@w3.org" <public-tt@w3.org>
Message-ID: <75386C677798CF40BE98B873913D0052109E84@ABFABNJ04A.mtvn.ad.viacom.com>
i have a question on styles working across multiple spans, and nested spans in general. the simple delivery profile states:

"A document must contain only a single level of span element within a p element".

This constraint may make it difficult to support the typical CC look with with white text on a black background that hugs tight to the text. To achieve this look, i think the the tts:backgroundColor attribute needs to be on a <span> tag. if it's on the <p> tag, you get the black background as the largest constraint retangle on the mult-line caption (black background does not hug the text).

here is the structure i'm using:

<region xml:id="lowerThird"  >
        <style tts:origin="5% 5%" tts:extent="90% 90%" tts:displayAlign="after" tts:textAlign="center"
        tts:backgroundColor="transparent" tts:color="#ffffff" />

<p region="lowerThird" begin="xx" end="xx">
 <span tts:backgroundColor="#00000088">caption text here.<br/> with semi-transparent background hugging text</span>

note that putting the tts:backgroundColor on the <p> tag is not good, as you then get the black rectangle not hugging the text.

this is all fine, but what if one of the words in the caption needs to be in italics? then you'd need to do nested spans, like this:
<p region="lowerThird" begin="xx" end="xx">
 <span tts:backgroundColor="#00000088">caption text here.<br/> with <span tts:textStyle="italics">italic word</span>semi-transparent background hugging text</span>

this is working nicely on the TTML implementation i'm testing on xbox, but it uses nested spans. is that ok?


Glenn Goldstein | Vice President, Media Technology Strategy | VIACOM
glenng@mtvi.com | 212-846-3210 | 1515 Broadway, New York NY 10036

Picture (Metafile) 1.jpg
(image/jpeg attachment: Picture__Metafile__1.jpg)

Received on Friday, 3 August 2012 15:31:15 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 5 October 2017 18:24:06 UTC