libass icon indicating copy to clipboard operation
libass copied to clipboard

Arabic with font spacing changed in version 0.16.0

Open Yasand123 opened this issue 2 years ago • 9 comments

Screenshots

This is how it looks in v0.16 with "sub-spacing=0.8" arabic-spacing

This is how it looks in v0.16 without "sub-spacing=0.8" (This is how it should look, and it looks like this in previous versions like v0.15.2 with and without sub-spacing) arabic-no-spacing

Description of the issue

Arabic, could be all RTL languages, subtitles render incorrectly as of the latest update 0.16 if "sub-spacing" is used. Downgrading to the previous version 0.15.2 immediately fixed the issue.

The screenshots are taken from MPV.

libass version

0.16.0

Is it a regression?

Recent change, since 0.16.0

ASS Sample

No response

Special Fonts

The issue doesn't depend on a specific font

System Information

OS: (Arch Linux 5.18.3) CPU: (AMD 3600x) GPU: (NVIDIA RTX 2060)

Log

No response

Additional info

No response

Yasand123 avatar Jun 15 '22 10:06 Yasand123

For reference, what format/source are those subtitles, e. g. SRT or ASS?


Translation for developers: apparently mpv has an option that sets the style’s Spacing (\fsp), which, of course, now breaks glyph runs into individual glyphs to be more VSFilter-compatible. Arabic is affected the worst of all as it ruins both bidi and shaping, but this also affects anything else RTL and anything else with complex shaping.

astiob avatar Jun 15 '22 10:06 astiob

For reference, what format/source are those subtitles, e. g. SRT or ASS?

ASS -- external and embedded soft-subs.

Yasand123 avatar Jun 15 '22 10:06 Yasand123

In my understanding, --sub-spacing etc. shouldn’t affect ASS by default. Am I correct to assume you’re also using an option to force ASS style overrides?

astiob avatar Jun 15 '22 11:06 astiob

In my understanding, --sub-spacing etc. shouldn’t affect ASS by default. Am I correct to assume you’re also using an option to force ASS style overrides?

Yes, otherwise the setting wouldn't have any effect. I'm using the setting because the characters overlap a little without it, by how much is font dependent, so I increase the spacing between characters to compensate.

Some screenshots (both are rendering correctly). This is without sub-spacing subspacing-before

This is with sub-spacing subspacing-after

Yasand123 avatar Jun 15 '22 11:06 Yasand123

this is not a bug since vsfilter do the same as 0.16.0, and seems the sub you use is target libass only! and that a rare thing, anyway just set the Encoding to -1 and it will be like the old libass

realfinder avatar Jun 25 '22 22:06 realfinder

In my understanding, --sub-spacing etc. shouldn’t affect ASS by default. Am I correct to assume you’re also using an option to force ASS style overrides?

Yes, otherwise the setting wouldn't have any effect. I'm using the setting because the characters overlap a little without it, by how much is font dependent, so I increase the spacing between characters to compensate.

Some screenshots (both are rendering correctly). This is without sub-spacing subspacing-before

This is with sub-spacing subspacing-after

that a known bug https://github.com/libass/libass/issues/148

realfinder avatar Jun 25 '22 22:06 realfinder

this is not a bug since vsfilter do the same as 0.16.0, and seems the sub you use is target libass only! and that a rare thing, anyway just set the Encoding to -1 and it will be like the old libass

This was not about a specific subtitle file at all.

But overriding Encoding is indeed a viable workaround if you insist on keeping the sub-spacing, with an effect comparable to downgrading to 0.15.2 (but with the benefit of including other improvements made in 0.16.0). But of course, it will show VSFilter-targeting subtitles with embedded overrides in the wrong order (just as 0.15.2 did).

astiob avatar Jun 25 '22 23:06 astiob

But of course, it will show VSFilter-targeting subtitles with embedded overrides in the wrong order (just as 0.15.2 did).

also vsfilter and Arabic with any spacing will not work at all (it will be same as https://user-images.githubusercontent.com/14009700/173803855-0ba28aca-f3d7-4b74-9ead-6679372568bf.png) but still there are some Karaoke with Arabic exploit this to make RTL Arabic kara with any template like this https://web.archive.org/web/20180109072148/https://www.msoms-anime.net/t190430.html or my old mod of Tadween in 2016 https://github.com/libass/libass/issues/406#issuecomment-792944082

realfinder avatar Jun 25 '22 23:06 realfinder

For reference, what format/source are those subtitles, e. g. SRT or ASS?

Translation for developers: apparently mpv has an option that sets the style’s Spacing (\fsp), which, of course, now breaks glyph runs into individual glyphs to be more VSFilter-compatible. Arabic is affected the worst of all as it ruins both bidi and shaping, but this also affects anything else RTL and anything else with complex shaping.

I just note that sub-spacing is an option in mpv from your comment, I was think it is "Spacing" in the .ass Style but anyway seems sub-spacing just change that "Spacing" in the .ass Style

realfinder avatar Jun 26 '22 00:06 realfinder

Tentatively closing, as this is no bug and for use with converted subs Endcoding: -1 (as an override if the converted doesn't already set that) seems to resolve the issue iiuc.

TheOneric avatar Sep 15 '22 22:09 TheOneric