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

textCombine support generates a span per character #194

Closed
jeffcunat opened this issue Nov 10, 2020 · 1 comment
Closed

textCombine support generates a span per character #194

jeffcunat opened this issue Nov 10, 2020 · 1 comment
Assignees
Milestone

Comments

@jeffcunat
Copy link

jeffcunat commented Nov 10, 2020

Since version 1.1.0, generated html for ttml span contains one <span> per character.

For what I understand, textCombine style should be used only in the context of a vertical writing mode.
But it seems that we always go into this part of the code whether we are writing horizontally or not

// wrap characters in spans to find the line wrap locations

See ttml file example provided
sub_eng_short.xml.zip

For example
TTML code
<span style="s1">eng : 00:00:00.000</span>

Generated html code
<span style="margin: 0px; color: rgb(255, 255, 0); direction: ltr; font-family: sans-serif; font-size: 46px; font-style: normal; font-weight: normal; text-decoration: none; text-combine-upright: none; unicode-bidi: normal; visibility: visible; white-space: nowrap;"><span>e</span><span>n</span><span>g</span><span> </span><span>:</span><span> </span><span>0</span><span>0</span><span>:</span><span>0</span><span>0</span><span>:</span><span>0</span><span>1</span><span>.</span><span>0</span><span>0</span><span>0</span></span>

@palemieux palemieux self-assigned this Nov 21, 2020
@palemieux
Copy link
Contributor

Wrapping each character in an individual HTML <span> is required to determine end of line locations. This is in turn required for linePadding, rubyReserve, textEmphasis, applyMultiRowAlign and fillLineGap. textCombine actually turns off the wrapping of individual characters since no line break can happen within.

So, until CSS, adds support for the styles above, imscJS will need to continue wrapping characters into individual <span> elements :(

Did I understand the issue correctly?

palemieux pushed a commit that referenced this issue Jul 16, 2021
* Merge adjacent spans on the same line that originate from the same ISD element (after line wrapping is performed) (#194, #109)
* Improve fillLineGap with semi-opaque background colors (#200)

Co-authored-by: Robert Bryer <robert.bryer@bbc.co.uk>
@palemieux palemieux added this to the 1.1.3 Release milestone Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants