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

Support of fontSize cellResolution units in TTML subtitles #2403

Closed
glhvta opened this issue Feb 19, 2020 · 3 comments · Fixed by #2442
Closed

Support of fontSize cellResolution units in TTML subtitles #2403

glhvta opened this issue Feb 19, 2020 · 3 comments · Fixed by #2442
Labels
component: captions/subtitles The issue involves captions or subtitles component: TTML The issue involves TTML subtitles specifically status: archived Archived and locked; will not be updated type: enhancement New feature or request
Milestone

Comments

@glhvta
Copy link
Contributor

glhvta commented Feb 19, 2020

Have you read the FAQ and checked for duplicate open issues?
Yes

What version of Shaka Player are you using?
v2.5.9

Please ask your question
Hi,

According to the TTML spec fontSize
https://www.w3.org/TR/ttml1/#style-attribute-fontSize
fontSize value can be percentage or scalar in the next units
https://www.w3.org/TR/ttml1/#style-value-length

  • "px"
  • "em"
  • "c"

We have ttml subs with the next styles

<styling>
   <style xml:id="s0" tts:color="rgba(255,255,255,255)" tts:fontSize="0.80c"  />
</styling>

tts:fontSize="0.80c" is in cellResolution units

We are using the default shaka.text.TtmlTextParser
And seems like fontSize will not be provided to the text displayer in this case, as now default TtmlTextParser does not support cellResolution units for the font size.

https://github.com/google/shaka-player/blob/697a6ff785046dff3b7dea1d44fc8fc87cee925b/lib/text/ttml_text_parser.js#L531-L535

https://github.com/google/shaka-player/blob/697a6ff785046dff3b7dea1d44fc8fc87cee925b/lib/text/ttml_text_parser.js#L971-L977

Is it possible to add the support of fontSize cellResolution units to TtmlTextParser?

Thanks!

@glhvta glhvta added the type: question A question from the community label Feb 19, 2020
@joeyparrish joeyparrish added type: enhancement New feature or request and removed type: question A question from the community labels Feb 19, 2020
@joeyparrish
Copy link
Member

Sounds reasonable. Do you have any sample TTML we could use for testing and development?

@shaka-bot shaka-bot added this to the Backlog milestone Feb 19, 2020
@glhvta
Copy link
Contributor Author

glhvta commented Feb 19, 2020

yes, in this archive, you can find samples TTML with fontSize attribute in percentages and in cellResolution unit.

ttml-captions.zip

@joeyparrish
Copy link
Member

Perfect. Thanks!

@glhvta glhvta changed the title Question about support of fontSize cellResolution units in TTML subtitles Support of fontSize cellResolution units in TTML subtitles Feb 26, 2020
@joeyparrish joeyparrish added component: captions/subtitles The issue involves captions or subtitles component: TTML The issue involves TTML subtitles specifically labels Feb 28, 2020
joeyparrish pushed a commit that referenced this issue Mar 6, 2020
@joeyparrish joeyparrish modified the milestones: Backlog, v2.6 Mar 6, 2020
@shaka-project shaka-project locked and limited conversation to collaborators May 5, 2020
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: captions/subtitles The issue involves captions or subtitles component: TTML The issue involves TTML subtitles specifically status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
3 participants