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

textAlign processing #177

Closed
cconcolato opened this issue May 19, 2020 · 6 comments · Fixed by #183
Closed

textAlign processing #177

cconcolato opened this issue May 19, 2020 · 6 comments · Fixed by #183

Comments

@cconcolato
Copy link

At https://github.com/sandflow/imscJS/blob/master/src/main/js/html.js#L1433-L1458, tts:direction is used to determine the mapping of tts:textAlign and not context.ipd. TTML2 says:

The tts:textAlign attribute is used to specify a style property that defines how inline areas are aligned within a containing block area in the inline progression direction.

Is the current code correct?

@palemieux palemieux added this to the 1.1.2 Release milestone May 19, 2020
@palemieux palemieux self-assigned this May 29, 2020
@palemieux
Copy link
Contributor

@cconcolato Can you provide a sample that would exercise this code path?

@palemieux
Copy link
Contributor

@cconcolato What do you expect in the following case?

<?xml version="1.0" encoding="UTF-8"?>
<tt:tt xmlns:tt="http://www.w3.org/ns/ttml" xmlns="http://www.w3.org/ns/ttml" xmlns:tts="http://www.w3.org/ns/ttml#styling" xml:lang="en">
  <head>
    <layout>
    	<region xml:id="r1" tts:writingMode="tblr" />
    </layout>
  </head>
  <body>
    <div>
      <p begin="0s" end="10s" region="r1" tts:textAlign="end" tts:direction="rtl">Hello</p>
    </div>
  </body>
</tt:tt>

@cconcolato
Copy link
Author

In my understanding, because the writing mode is "tblr", the block progression direction is "lr" and the inline progression direction is "tb". The direction attribute does not change that and the textAlign property should interpret end as end of "tb", i.e. bottom of the region. See image below.
1

@palemieux
Copy link
Contributor

palemieux commented May 30, 2020

@cconcolato Hello should be on the left since the direction is tblr, right?

@palemieux
Copy link
Contributor

@cconcolato Please review the PR at #183

@cconcolato
Copy link
Author

You were right. I had a bug too. Here is the corrected image.
1

palemieux added a commit that referenced this issue Nov 21, 2020
nigelmegitt pushed a commit to bbc/imscJS that referenced this issue Dec 11, 2020
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.

2 participants