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

Apparent double nesting of rubies impacting bouten spacing and baseline shifts (when rubyReserve is used) #188

Closed
jbaden opened this issue Jun 25, 2020 · 4 comments · Fixed by #189

Comments

@jbaden
Copy link

jbaden commented Jun 25, 2020

Hi @palemieux,

After further testing and review, I believe the rubyReserve issue you identified may also impact boutens (tts:textEmphasis).

"To polyfill tts:rubyReserve, applyRubyReserve() inserts a zero-width ruby annotation before the first HTML span in each line. This breaks if the first span is itself within a ruby annotation. Probably can be fixed."

In the following XML excerpts & corresponding images generated from IMSC11 Renderer, I've noticed that the baseline shifts when boutens are applied if they are exercised at the very beginning of a line (Example 2). In Example 3, I've added punctuation before the tts:textEmphasis span and the baseline is preserved (as expected with rubyReserve):

Example 1

2-line Horizontal Event without Boutens; with rubyReserve:
<p begin="100000000t" dur="20000000t" region="bottom-left-justified" ebutts:multiRowAlign="start">強調したい時に使<br/>強調したい時に使</p>

noBoutens

Example 2

2-line Horizontal Event with Boutens + rubyReserve (no preceding character/punctuation before span tts:textEmphasis)
<p begin="120000000t" dur="20000000t" region="bottom-left-justified" ebutts:multiRowAlign="start"><span style="bouten-filled-circle-outside">強調したい時に使<br/>強調したい時に使</span></p>

withBoutens

Example 3

2-line Horizontal Event with Boutens + rubyReserve (with a preceding character/punctuation before span tts:textEmphasis)

<p begin="140000000t" dur="20000000t" region="bottom-left-justified" ebutts:multiRowAlign="start">〝<span tts:textEmphasis="filled circle before">強</span><span tts:textEmphasis="filled circle before">調</span><span tts:textEmphasis="filled circle before">し</span><span tts:textEmphasis="filled circle before">た</span><span tts:textEmphasis="filled circle before">い</span><span tts:textEmphasis="filled circle before">時</span><span tts:textEmphasis="filled circle before">に</span><span tts:textEmphasis="filled circle before">使</span><br/><span> </span><span tts:textEmphasis="filled circle after">強</span><span tts:textEmphasis="filled circle after">調</span><span tts:textEmphasis="filled circle after">し</span><span tts:textEmphasis="filled circle after">た</span><span tts:textEmphasis="filled circle after">い</span><span tts:textEmphasis="filled circle after">時</span><span tts:textEmphasis="filled circle after">に</span><span tts:textEmphasis="filled circle after">使</span>〞</p>

withBoutnes+character_before_textEmphasis_style

Test file:
w3c/imsc-tests#94

@palemieux
Copy link
Contributor

It looks like the core issue is that imscJS assumed that a span to which tts:textEmphasis was applied would never cross a line boundary. WIP fix at #189.

@jbaden
Copy link
Author

jbaden commented Jun 26, 2020

Hi @palemieux,

Thank you for looking into this!

I just want to highlight that even if I apply tts:textEmphasis within a <span> both before and after the line break, I am still seeing a baseline shift.

textEmphasis_rubyReserveTest_002.xml.zip

<p begin="100000000t" dur="20000000t" region="top-center-justified">No Boutens<br/>horizontal</p>
<p begin="100000000t" dur="20000000t" region="bottom-left-justified" ebutts:multiRowAlign="start">強調したい時に使<br/>強調したい時に使</p>
<p begin="120000000t" dur="20000000t" region="top-center-justified">With Boutens(傍点)<br/>horizontal</p>
<p begin="120000000t" dur="20000000t" region="bottom-left-justified" ebutts:multiRowAlign="start"><span style="bouten-filled-circle-outside">強調したい時に使</span><br/><span style="bouten-filled-circle-outside">強調したい時に使</span></p>

noBoutens+rubyReserve
boutens+rubyReserve

The only time I don't see a baseline shift is when I have some character/punctuation preceding the first tts:textEmphasis <span> in the event.

@palemieux
Copy link
Contributor

@jbaden As a WIP, I had not deployed this branch to http://sandflow.com/imsc1_1/index.html . I have done so now.

@jbaden
Copy link
Author

jbaden commented Jun 26, 2020

Thank you, @palemieux.

I have re-reviewed my test files and I'm no longer seeing any baseline shifts.

Thanks again for your help.

Much Appreciated,
Justin

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

Successfully merging a pull request may close this issue.

2 participants