torque / mpv-progressbar

A simple progress bar for mpv.
ISC License
154 stars 8 forks source link

Scale font size with window size #32

Open Argon- opened 7 years ago

Argon- commented 7 years ago

I'm wondering why this isn't done, I assume it's on purpose? The font size will stay "the same" when resizing the window, therefore it looks like I have a really small font when e.g. in fullscreen and it all looks really big when I have a small, windowed window. For this reason, the OSC scales with your window size. Can this somehow be activated?

torque commented 7 years ago

The size of text in my browser window/terminal/text editor doesn't scale with window size. I find the idea of scaling the UI with window size to be insane and completely counterintuitive to how all other program UI works, and it's one of the reasons I really don't like the built-in OSC (though I understand it needs to do it to ensure the controls are always visible).

That said, I'm not completely opposed to having this as an option, but I don't think the way that the OSC does it will work for this script. It appears to do some math based on the fixed geometry size of the OSC and sets scale based on the proportion of that to the window size. This script has no fixed aspect ratio because it is designed to flex with the window size rather than the video size.

A possible solution would be to scale the text around the ratio of the window height to some virtual datum, which would result in a constant text size for a given height. I'm not sure how well this strategy would play with varying aspect ratios.

I'll think about it.

Keith94 commented 7 years ago

I'd also like to see this as an option; without scaling, the text is too big and covers up subtitles.

Argon- commented 7 years ago

That's what I was wondering about: all the other text scales. Subtitles, text drawn and ASS-styled with osd_message, they all scale automatically due to the way libass is used. This script is using regular ASS tags for font size as well but it doesn't scale? I guess that's a result of using mpv's assdraw?

torque commented 7 years ago

I'd also like to see this as an option; without scaling, the text is too big and covers up subtitles.

I find this to be an odd problem. The expected use is that the UI remains hidden except when it is requested to be displayed (or used to seek), so the UI shouldn't really be on the screen long enough to interfere with subtitle viewing. My immediate suggestion is to simply reduce the font size in your config.

e: an alternate solution in the case of very low resolution videos (which I'll admit mpv-progressbar does not handle gracefully) is to use mpv's autofit-smaller setting to enforce a default minimum window size.

That's what I was wondering about: all the other text scales. Subtitles, text drawn and ASS-styled with osd_message, they all scale automatically due to the way libass is used.

It's done explicitly (here, for reference) for the reasons I listed above. This script tries to be a basic user interface, and those almost never scale with window resolution (nor, I believe, should they). The way the UI is composed shouldn't matter.

While I don't agree with this issue on a philosophical level, I don't have a problem with implementing it provided I can find a satisfactory way to do so. Unfortunately, I am unlikely to have time to put much thought into this for the next few months.