-
Notifications
You must be signed in to change notification settings - Fork 208
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
VSFilter has kerning & ligatures sometimes #237
Comments
@Seeder101 Could you please post the relevant lines from the ASS stream/file? We’ll need the two @wm4 I don’t think this is related to the shaper. The shaping seems to be the same; just the positioning is different. I’m guessing the grey line contains just the grey text and has a I’m not sure if these coordinates are supposed to be well-defined at all. It seems like they should be: just add up the glyph advances as specified in the font. The advances don’t depend on the font renderer implementation, so that’s well-defined. Oh wait… hinting? Is this affected by hinting? Assuming this is supposed to be well-defined, it follows that we somehow screw it up (or VSFilter somehow screws it up in a hopefully predictable manner and we fail to account for that). Could this be a known issue? We have #32 with a similar case where two lines had the same text and appeared slightly out of sync, so to say, but I think (the screenshots are gone) it had one of the lines appear stretched relative to the other, which doesn’t seem to be the case here. We also have #21, which is about ⅛-pixel rounding for each glyph run’s position and size, but the screenshots here seem to show a larger difference of several whole pixels. |
@astiob hi sir, yes...I can...this is the Dialogue from the ass file `Dialogue: 0,0:07:16.70,0:07:21.99,Main,,0,0,0,,.نامي- سينباي كانت لصّة تسرق الكنوز من القراصنة Weird thing, sometimes it works fine in some lines this is the Dialogue the sync is inconsistent, while it is perfectly fine in VSfilter |
Does vlc set any margins? |
@wm4 same thing in both players, mpv and vlc |
can you send SUB file ? |
Thanks! So my guess was right: the grey text has its own event and a Huh, that last one looks particularly curious. So there’s multiple word overlays at the same time, and out of the four, one is positioned almost correctly and the others appear as if they’re stretched horizontally centred around the correct one. I’mma download that file and play around with it for a bit. Edit: Now that I think about it, this method of using |
GDI has a lot of special case handling, so it wouldn't surprise me... |
Okay, so, for starters, while not directly relevant to this issue, it seems GDI keeps a per-process cache of kerning values indexed by some sort of font name. When I removed the kerning data from the font, reattached it to the MKV, closed and reopened the MKV in MPC-HC, the kerning was still present. To see the change, I had to either rename the font or close and relaunch the whole MPC-HC. Here are my findings so far:
|
By the way, when |
Ah, I’ve figured it out. |
Meanwhile, the way Of course, the Uniscribe path probably only exists on Windows 2000 and newer. And ScriptIsComplex learns to recognize new complex scripts in each version of Windows, so ASS files using newly added complex scripts presumably look different on different versions of Windows. But then again, if Uniscribe doesn’t even recognize the script, then it probably looks like garbage anyway, so I think we can safely ignore this and focus on compatibility with the newest versions of Windows and Uniscribe. |
So what the conclusion, is there a HarfBuzz/Uniscribe incompatibility here or just VSFilter bugs? cc @behdad. |
It's just GDI being GDI, i.e. piles and piles of hacks on top of hacks. Nothing to see here, move along. |
Mostly that as far as ASS is concerned, but there are also a couple HarfBuzz/Uniscribe incompatibilities: see my first and second bullet points in the list above. But I’m not sure which way is right and whether HarfBuzz wants to change its behaviour. For what it’s worth, I’ve just checked what (my old) OS X does (specifically TextEdit.app), and it seems to agree with Uniscribe on both matters, not with HarfBuzz. But when the base direction is right-to-left, then it doesn’t apply the |
Some test strings for the HarfBuzz/Uniscribe/CoreText discrepancies, in C string format to make the overrides visible:
|
Oh, you also need the font. I couldn’t find any licensing information, so here’s the file. |
I don't think these are HarfBuzz issues. HarfBuzz is concerned with shaping runs of a single script and single direction at a time. Text with mixed scripts or direction is handled by some layout system at a higher level. So whether and how we want to e.g. apply kerning at script run boundaries is up to us. |
Oh, right! That probably explains why libass doesn’t kern The other issue still remains though, where libass-with-HarfBuzz matches kerning pairs in visual order while Uniscribe and CoreText both match them in logical order. Is this intentional? (It sure seems sensible, but it seems to contradict the OpenType spec—as much as I haven’t read the actual spec, just some documentation on the Web.) |
For reference, I played my sample file in VSFilter in Windows XP out of curiosity, and: the Arabic text is kerned, |
is there are a way to do |
No. The |
let say that 1 font need Kerning in libass but another font don't need it in order to make the subtitle work same on both VSFilter and libass, the Current Kerning option in this case will fix one font compatibility for libass but will case another! or there will be another new solution later? |
Apparently, Uniscribe doesn’t apply TrueType (It’s not clear to me when Windows applies TrueType |
Hi =D
how are you ?
Recently I have been using MPV/VLC as my daily players, and I downloaded an Episode which has 2 subtitle lines at the same time, one which is supposed to go over the other, to highlight some words. in VSFilter it is correct, but Libass the positioning for the colored word is messed up. Examples:
LIBASS
VSFILTER
as you can see the position in vsfilter is correct and libass is a big-mess =D
The text was updated successfully, but these errors were encountered: