Skip to content
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

File name text overflows off window due to limited wrappable characters #4308

Closed
alystair opened this issue Apr 9, 2017 · 11 comments
Closed
Labels
down-upstream:libass down-upstream features and bugs that need to be implemented and fixed upstream meta:info-needed

Comments

@alystair
Copy link

alystair commented Apr 9, 2017

mpv version and platform

2017-02-12 Windows

Reproduction steps

Open video with a long file name with no spaces

Expected behavior

File info text fits/wraps width of window

Actual behavior

Name outsizes and overflows off screen

Log file

Not necessary for repro

Sample files

Not necessary for repro

@wiiaboo
Copy link
Member

wiiaboo commented Apr 9, 2017

What's a file info? What do you consider a portrait display? Log, sample, or screenshot would've answered these questions. Don't ignore the issue template.

@Hrxn
Copy link
Contributor

Hrxn commented Apr 9, 2017

Maybe add a screenshot?

@alystair alystair changed the title File info text overflows in full screen (portrait mode only!) File name text overflows off window due to limited wrappable characters Apr 10, 2017
@alystair
Copy link
Author

Ok looks like I was wrong - this isn't actually caused by portrait mode but due to filename not having spaces and lack of other allowed wrap characters. Here's a screenshot.
mpv shot

@alystair
Copy link
Author

alystair commented Apr 10, 2017

I think this is easily remedied by allowing all periods in filename other than the last one before the extension to wrap the text like the space character does. See concept below:
wrap solution

@wiiaboo
Copy link
Member

wiiaboo commented Apr 10, 2017

But the problem is libass doesn't support linebreaking with zero-width spaces. You'd have to replace every [.-_] by {\\fscx0.1} {\\fscx100}$1 which could lead to huge ASS strings.

@astiob
Copy link
Contributor

astiob commented Dec 26, 2017

Frankly, I don’t think long ASS strings would be a problem, not in the case of file names at least.

You can also shave off a few bytes by using {\fscx0}␣␣{\fsc} (with two spaces to work around libass/libass#185) (assuming libass/libass@fc13f53, libass 0.11.0 or newer) and even more by declaring a custom ASS style “X” that has ScaleX=0 and using {\rX}␣␣{\r} (if mpv has a separate libass pipeline for the OSD such that this won’t interfere with the rendering of any subtitles).

@Et0h
Copy link

Et0h commented Dec 27, 2017

I tested {\fscx0} {\fscx100} (with double space) through the Syncplay mpv lua script and it seemed to work okay, I just had to remember to ensure the character insertion was done in a Unicode-compatible way.

@Argon-
Copy link
Member

Argon- commented Dec 27, 2017

For proper wrapping, you also want to make sure that there are no superfluous space characters.
I've encountered this once. Default wrapping:
Default wrapping
With \q2:
Wrapping disabled
The culprit was a bunch of spaces in front of the wrapped line that were not rendered but somehow taken into account for line wrapping calculations, so this could be easily fixed: 76ae38a

@alystair
Copy link
Author

Just following up, was this ever added? Please close it if it was done.

@wiiaboo
Copy link
Member

wiiaboo commented Apr 29, 2018

It wasn't.

@Akemi Akemi added down-upstream:libass down-upstream features and bugs that need to be implemented and fixed upstream to-be-closed labels Sep 20, 2019
@Akemi
Copy link
Member

Akemi commented Sep 21, 2019

duplicate of #2203.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
down-upstream:libass down-upstream features and bugs that need to be implemented and fixed upstream meta:info-needed
Projects
None yet
Development

No branches or pull requests

7 participants