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

There is a problem with subtitles jumping when using Arabic #163

Closed
chenyangxx opened this issue Nov 13, 2023 · 2 comments
Closed

There is a problem with subtitles jumping when using Arabic #163

chenyangxx opened this issue Nov 13, 2023 · 2 comments

Comments

@chenyangxx
Copy link

There is a problem with subtitles jumping when using Arabic,There is no problem when using other languages.
This is the test ass file,thanks...

Screen.Recording.2023-11-13.at.22.07.44.mov

test_ass.txt

@TheOneric
Copy link
Member

This is expected behaviour and comes from BiDi being run on each glyph run in ASS.

Glyph run split occur e.g. on colour changes.
Your file uses {\1c&HFFFFFF&} and {\1c&HFF0000&} override blocks after each sequence, even if the block just resets the current colour again — however such "noop" blocks do not induce run-splits.
Thus as the red colour moves, so does the way glyph runs are split change and thus the bidi positioning.

To get consistent results, you’ll need to ensure the bidi runs are the same for all variants. For this you can either

  1. insert a Left-to-right mark (Unicode Codepoint U+200E) after each override block. Explicit LTR and RTL marks will insert splits into the bidi layout (but won't cause general ASS glyph runs)
  2. if there is some prperty you do not actually use in the subtitles, here e.g. the secondary colour \2c, you can toggle this to a different value inside each override tag to cause ASS glyph run splits

The first approach works regardless of which style properties are used and can be easily automated (if the file is being generated). However, depending on your editor the LTR marks might be invisible which might be confusing when manually editing the file.

Here is your testfile with both of the approaches implemented:

  1. octo163_ltrAfterBlock.txt
  2. octo163_c2.txt

and a screenshot of how the LTR marks are placed from an editor which displays them (vim):
editor_showing_ltr-mark

@chenyangxx
Copy link
Author

chenyangxx commented Nov 27, 2023 via email

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