libass
libass copied to clipboard
Arabic with font spacing changed in version 0.16.0
Screenshots
This is how it looks in v0.16 with "sub-spacing=0.8"
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)
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
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.
For reference, what format/source are those subtitles, e. g. SRT or ASS?
ASS -- external and embedded soft-subs.
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?
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
This is with sub-spacing
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
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
This is with sub-spacing
that a known bug https://github.com/libass/libass/issues/148
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).
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
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
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.