-
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
Match VSFilter behavior by introducing rounding error for position at glyph run boundaries #21
Comments
I see you edited this issue. But the pictures in this issue will not be fixed by adding the rounding: the “border” is a single run, and each karaoke syllable has its own \pos. These \poses don’t match the positions of those syllables in the “border” layer, and adding rounding won’t change this. |
Oh, heh, you're right. Maybe I should actually read the script before assuming it demonstrates an issue… Lemme clean this mess up. |
Started for vertical rounding in astiob@rounding. Vertical rounding at video resolution should match now; other resolutions need a little bit more work but should be easy enough. Horizontal rounding is harder, because (as mentioned above) we detect glyph runs too late. |
Turns out vertical rounding is tricky, too: it depends on font size and involves a peculiar sequence of rounding steps. Using “d6” and “d3” to mean “6/3 bits in the fractional part”, VSFilter does the following:
For vector drawings, steps 1–4 are replaced by:
All in all, multiple rounding steps are involved, and multiple of them may even involve d3 truncation. For example, I almost published a file with a long scrolling event that contains multiple paragraphs separated by full blank lines ( |
VSFilter rounds off position values to either pixels or ⅛-pixels (not sure which?) at glyph run boundaries. We don't, which creates some incompatibilities when scripts try to make up for the difference by adding \fscx or similar to other layers. In some cases (like heavy kara), it can result in a shift by multiple px due to the (lack of) accumulated error. We may be able to replicate this behavior by detecting glyph runs slightly earlier, then converting positions to storage pixels, simulating the rounding, then converting back.
The text was updated successfully, but these errors were encountered: