cyl0 / ModernX

A modern OSC UI replacement for MPV that retains the functionality of the default OSC.
545 stars 28 forks source link

Default font size for titles #34

Closed Keith94 closed 1 year ago

Keith94 commented 1 year ago

If you have a really long title, it gets cut off kind of abruptly at the end. Is there a way we can reduce the default font size to mitigate the issue?

Or other solutions to display them.. i.e. Add "..." ellipses at the end, or a fade effect (i.e. browser tab titles), or dynamically reduce the font size so the full title fits the screen. Maybe even horizontally scrolling text if that's not too hard to implement.

image

Keith94 commented 1 year ago

Fixed by 9ba012b

Enivex commented 1 year ago

Fixed by 9ba012b

My titles are now cut off by ellipses only halfway through my window. I had to change the 23 to a smaller number.

Keith94 commented 1 year ago

Good point. I hope someone could address that.

Enivex commented 1 year ago

I realized that the font size can be adjusted by changing the number after on line 158 in the lua file

Title = '{\\blur1\\bord0.5\\1c&HFFFFFF&\\3c&H0\\fs24\\q2\\fn' .. user_opts.font .. '}',

The original number was 38

(Not exactly user friendly though)

zydezu commented 1 year ago

Good point. I hope someone could address that.

go to lo.button.maxchars = geo.w / 23 (line 1349) and change '23' to a lower value like '13'... the '...' cutoff will be closer to the edge of the screen.

zydezu commented 1 year ago

mpv_JHhzyoowr7

Here is a script with those changed and the ability for text scrolling applied: modernx.zip

I've also added the changes to my own fork of ModernX : https://github.com/zydezu/ModernX

Keith94 commented 1 year ago

@zydezu Why was the titlecutoff removed in the latest version? Any way to get it back?

EDIT: Oh it's still implemented but sometimes it doesn't activate properly at certain window sizes I think.

image

image

zydezu commented 1 year ago

Some code about titles was changed and it caused it to be buggy with CJK characters. An alternative as of now is clicking the title will show a OSD message in the top left of the screen with the title (and right clicking the file name).

If I can get it working properly, scrolling may return in a future update.

Keith94 commented 1 year ago

Ok i see. Will watch for updates

vidscale=yes is another possible workaround, it also fixes the windowtitle overflowing because it does not have ellipses either :(

zydezu commented 1 year ago

Ok i see. Will watch for updates

vidscale=yes is another possible workaround, it also fixes the windowtitle overflowing because it does not have ellipses either :(

So far I've fixed the window title's cutting off (or not) at wrong places.

mpv_LZVMPNyQki

Keith94 commented 1 year ago

Wow great job! It's working perfectly on my end now. :)

I actually prefer that to the scrolling behavior, which can be a little distracting at times

Keith94 commented 1 year ago

Closing in favor of @zydezu's fork 👍