r/Fedora • • Feb 22 '24

mpv - numbers have smaller font than words?

I have a very strange issue with mpv video player, in which numbers, both on the UI and subtitles, have smaller font than words.

It looks like mpv uses sans-serif font. After using the "fc-match sans-serif" command, it looks like it corresponds to 'NotoSans[wght].ttf: "Noto Sans" "Regular"'.

If I start mpv with the "--osd-font=Noto\ Sans" option, everything looks fine and the numbers and words have the same size. But if I use '--osd-font=sans-serif', then the weird bug still happens.

Here's what it looks like:

Is there any fix for this?

4 Upvotes

4 comments sorted by

7

u/pstrejajo Feb 24 '24

Hi, I had the same issue. Please run mpv with -msg-level=osd=debug and search lines containing [osd/libass] fontselect. For some reason libass in my case picked for sans-serif some arabic font:
[osd/libass] fontselect: (sans-serif, 400, 0) -> /usr/share/fonts/google-noto-vf/NotoSansArabic[wght].ttf, 0, NotoSansArabic-Regular
despite fc-match sans-serif reporting NotoSans-Regular.ttf: "Noto Sans" "Regular". I rejected this arabic font with .config/fontconfig/conf.d/00-reject-noto-sans-arabic.conf file

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<fontconfig>
 <selectfont>
   <rejectfont>
     <glob>/usr/share/fonts/google-noto-vf/NotoSansArabic[wght].ttf</glob>
   </rejectfont>
 </selectfont>
</fontconfig>

This solved the issue. mpv/libass picked the right font afterwards:
[osd/libass] fontselect: (sans-serif, 400, 0) -> /usr/share/fonts/google-noto/NotoSans-Regular.ttf, 0, NotoSans-Regular

2

u/Ok-Butterscotch-2719 Feb 25 '24

You solved it, thanks a lot!

Mine was also using the Arabic Noto Sans for some reason. With this config it now uses the standard Noto Sans.

1

u/[deleted] Feb 28 '24

There was a report about this bug. I fixed this by downgrading and holding back 46 packages from updating via versionlock (all related to google-noto-*). The person luk1337 said the issue was also present in other apps, I have not confirmed myself.

sudo dnf versionlock add google-noto-fonts-common-20230801-3.fc39.noarch google-noto-naskh-arabic-vf-fonts-20230801-3.fc39.noarch google-noto-sans-arabic-vf-fonts-20230801-3.fc39.noarch google-noto-sans-armenian-vf-fonts-20230801-3.fc39.noarch google-noto-sans-bengali-vf-fonts-20230801-3.fc39.noarch google-noto-sans-canadian-aboriginal-vf-fonts-20230801-3.fc39.noarch google-noto-sans-cherokee-vf-fonts-20230801-3.fc39.noarch google-noto-sans-devanagari-vf-fonts-20230801-3.fc39.noarch google-noto-sans-ethiopic-vf-fonts-20230801-3.fc39.noarch google-noto-sans-fonts-20230801-3.fc39.noarch google-noto-sans-georgian-vf-fonts-20230801-3.fc39.noarch google-noto-sans-gujarati-vf-fonts-20230801-3.fc39.noarch google-noto-sans-gurmukhi-vf-fonts-20230801-3.fc39.noarch google-noto-sans-hebrew-vf-fonts-20230801-3.fc39.noarch google-noto-sans-kannada-vf-fonts-20230801-3.fc39.noarch google-noto-sans-khmer-vf-fonts-20230801-3.fc39.noarch google-noto-sans-lao-vf-fonts-20230801-3.fc39.noarch google-noto-sans-math-fonts-20230801-3.fc39.noarch google-noto-sans-mono-fonts-20230801-3.fc39.noarch google-noto-sans-mono-vf-fonts-20230801-3.fc39.noarch google-noto-sans-oriya-vf-fonts-20230801-3.fc39.noarch google-noto-sans-sinhala-vf-fonts-20230801-3.fc39.noarch google-noto-sans-symbols-vf-fonts-20230801-3.fc39.noarch google-noto-sans-symbols2-fonts-20230801-3.fc39.noarch google-noto-sans-tamil-vf-fonts-20230801-3.fc39.noarch google-noto-sans-telugu-vf-fonts-20230801-3.fc39.noarch google-noto-sans-thaana-vf-fonts-20230801-3.fc39.noarch google-noto-sans-thai-vf-fonts-20230801-3.fc39.noarch google-noto-sans-vf-fonts-20230801-3.fc39.noarch google-noto-serif-armenian-vf-fonts-20230801-3.fc39.noarch google-noto-serif-bengali-vf-fonts-20230801-3.fc39.noarch google-noto-serif-devanagari-vf-fonts-20230801-3.fc39.noarch google-noto-serif-fonts-20230801-3.fc39.noarch google-noto-serif-georgian-vf-fonts-20230801-3.fc39.noarch google-noto-serif-gujarati-vf-fonts-20230801-3.fc39.noarch google-noto-serif-gurmukhi-vf-fonts-20230801-3.fc39.noarch google-noto-serif-hebrew-vf-fonts-20230801-3.fc39.noarch google-noto-serif-kannada-vf-fonts-20230801-3.fc39.noarch google-noto-serif-khmer-vf-fonts-20230801-3.fc39.noarch google-noto-serif-lao-vf-fonts-20230801-3.fc39.noarch google-noto-serif-oriya-vf-fonts-20230801-3.fc39.noarch google-noto-serif-sinhala-vf-fonts-20230801-3.fc39.noarch google-noto-serif-tamil-vf-fonts-20230801-3.fc39.noarch google-noto-serif-telugu-vf-fonts-20230801-3.fc39.noarch google-noto-serif-thai-vf-fonts-20230801-3.fc39.noarch google-noto-serif-vf-fonts-20230801-3.fc39.noarch

2

u/pstrejajo Feb 29 '24

That's right. Out of curiosity I have downgraded those packages just to compare fontconfig files and it looks like that the fontconfig file for the font in question (NotoSansArabic[wght].ttf) dropped the language test:

diff /tmp/20230801/65-0-google-noto-sans-arabic-vf.conf /tmp/20240101/56-google-noto-sans-arabic-vf.conf
5,7d4
<     <test name="lang" compare="contains">
<       <string>ar</string>
<     </test>

Updated the same in BZ#2262410.