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

OSC font varies randomly(?) if filename contains a character not in osd-font #15831

Open
6 tasks done
rivke41levp656 opened this issue Feb 8, 2025 · 2 comments
Open
6 tasks done
Labels

Comments

@rivke41levp656
Copy link

mpv Information

mpv v0.39.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Nov 27 2024 18:31:26
libplacebo version: v7.349.0
FFmpeg version: n7.1
FFmpeg library versions:
   libavcodec      61.19.100
   libavdevice     61.3.100
   libavfilter     10.4.100
   libavformat     61.7.100
   libavutil       59.39.100
   libswresample   5.3.100
   libswscale      8.3.100

Other Information

.

Reproduction Steps

Run mpv via e.g. mpv --no-config --include=mpv.conf --input-conf=input.conf -- あ.mkv. Repeatedly cycle the OSC, and the OSD font will change from what is set in mpv.conf (Liberation Mono, which probably contains only ASCII characters) to a fallback font (in my case Noto Sans CJK). If I rename あ.mkv to a.mkv, the problem does not seem to occur.

Example video of the bug where I repeatedly cycle the OSC, notice the OSD font changing:

bug.mp4

Expected Behavior

The OSD font should never change from what is set in mpv.conf.

Actual Behavior

The OSD font varies.

Log File

mpv.log

Sample Files

mpv_conf.txt

input_conf.txt

I carefully read all instruction and confirm that I did the following:

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
@TheOneric
Copy link
Contributor

Logs show Liberation Mono is first resolving to usr/share/fonts/OTF/PowerlineSymbols.otf, 0, PowerlineSymbols for you. sans-serif is also queried and resolves to DejaVu Sans, while actual LiberationMono (postscript name) and NotoSansCJKjp-Regular only get select later on as fallbacks for the initial PowerlineSymbols choice. Do you have any overrides or similar in your fontconfig config?

At some point NotoSansCJK gets selected as the first fallback instead of LiberationMono and since it already provides everything no further fonts are looked up. I’m not sure what causes the fallback order to change and this might also depend on what libass handles mpv retains between OSD cycles.
But either way, the main issue here is Liberation Mono not directly resolving to your desired font (works for me) which most likely is due to your local configuration. If you fix your setup the fallback order becomes irrelevant and this won't happen anymore.

@rivke41levp656
Copy link
Author

rivke41levp656 commented Feb 9, 2025

I guess the problem is this file then?

/usr/share/fontconfig/conf.avail/10-powerline-symbols.conf

which contains an override for Liberation Mono.

It is created by the powerline-fonts package. I could just delete it, but it would reappear whenever that package updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants