Closed bitingsock closed 9 years ago
Huh? No such thing happens ("prevent the line from going beyond half the window length"). Every appended property prints a new line right before it's actual text (https://github.com/Argon-/mpv-stats/blob/master/stats.lua#L200). Or am I misunderstanding your question?
As you can see, the first line doesn't write as far as the others.
Interesting but this is most certainly not done by the script, it's not inserting new lines anywhere except before properties and after sections (File/Video/Audio). Could it be the file name contains strange (invisible) characters?
No, it's done this with every file I've tried that's long enough. The exception seems to be if there are no spaces it will not break. _ - or other fillers let it work as intended.
Ya...definitely the spaces. Still weird that it breaks at that spot.
Could you send me a little sample or something where it happens for you?
Well, this did not preserve your file name and I can't reproduce this problem. Mind sharing your stats config, this does certainly not look like default.
And you don't happen to use \q0
somewhere, do you?
i edited the lua directly, no config. try setting the font_size to like 30 https://filetea.me/t1szuUpmpBySAeEe0GAtsnusA
There is indeed a bit of margin to the right, as you can see in my screenshot. There would've been enough space to leave the line untouched. However, this isn't (shouldn't be?) related to line breaks inserted by the script but rather to ASS line wrapping. When you disable wrapping (add {\\q2}
to the header):
But of course this would break lines which are really too long so you probably shouldn't do it.
Your version looks a bit like you would've used \q0
:
Smart wrapping, make each line approximately equally long
https://filetea.me/t1siQYg5W9WRXGgyWBaLwVpRA my version i didn't use \q0 also i tried with yours and added font_size=30 to stats.conf still problem
Well, as I said, this is wrapping done by the ASS renderer. You can turn it off or slightly tweak it (q0, q1, q3) but otherwise you have to live with it. Wrapping is not done by the script, nothing I can fix/"turn off". As for why the ASS renderer's wrapping is done so early in the first line... I don't know. Asked in #mpv-devel but nobody else had a good idea either (yet).
well thanks for looking into it
do you know if the renderer's option is exposed in mpv? or would i have to compile it so? edit: i guess you said you can't so...dang
I take that back, this actually is fixable (https://github.com/Argon-/mpv-stats/commit/76ae38a2d5bea6ee64b1c91f2bfc2ac484f6f53e). There were a lot of spaces before "File" and I knew that. Since they were not displayed I assumed they don't have any other side effects, however it seems like these (not visible) spaces are taken into account for wrapping calculations by libass (so it assumed there were more characters on screen than we actually saw, therefore breaking the line earlier). The above commit fixed this (by removing the spaces). Imo this is a bug in libass.
Thanks for reporting! I might have never caught that one.
neat
It appears to be inserting a carriage return to prevent the line from going beyond half the window length. I'm trying to learn; do you know where this behavior is located in the code?