-
Notifications
You must be signed in to change notification settings - Fork 46
MPV OSD parses fontconfig incorrectly and loads Emojione Color by default #37
Comments
What is your default font?
I've re-enabled the 0-9 glyphs required to make the numpad emoji function, which will be a problem if you are using the original fontconfig. |
This is my output:
|
Yes, I just noticed this on Skype: http://i.imgur.com/urmPD37.png $ cat ~/.config/fontconfig/fonts.conf
$ tree ~/.config/fontconfig/
|
How do i use nototools? |
@supgaf Are you having this same issue? Are you on Arch? Do you have Bitstream Vera installed? |
@eosrei Yes, is the exactly same issue. |
Can you tell me the command line (or GUI?) you are using? I want to reproduce this. |
I'm just running MPV without any option. |
I've installed the current Launchpad repo version from: https://launchpad.net/~mc3man/+archive/ubuntu/mpv-tests
But I'm not having this issue: Are you compiling mpv? Do you have any custom font configs? This issue is clearly caused by mpv loading the incorrect font. Edit: I doubt this has anything to do with the specific Linux distribution |
No, I'm using the package from the Opesuse repositories.(0.17.0-1.2)
Yes, infinality-ultimate. |
IDK for sure, but this may be the issue. I don't have infinality on any of my test machines. Is it possible to test w/o it? I'm not able to support all these advanced fontconfigs some people have, but I'm happy to add additional details to the readme if there is anything to fix this. Hopefully we can work out a Quick Temporary Workaround: Install the font manually without the provided fontconfig. It'll be overridden in a number of places, but shouldn't be the primary number font for mpv any longer. |
I've tested without infinality, but it not solved the problem. |
I recommend going with the "Quick temporary workaround" for now then. I'll try OpenSUSE in a VM as as soon as I can, but I'm not sure what other solutions there are for you at this point since I cannot reproduce the problem. |
Maybe, I always run the MPV problem persist though.
I tried some more advanced options and verbose with MPV and I may be getting close:
Somehow, it looks like the way to specify fonts have changed in MPV. It ends up selecting EmojiOneColor when it shouldn't? Note: MPV will behave exactly the same way no matter what font name I give it, whether it actually exists or not doesn't seem to be relevant. |
I'm quite surprised how many programs incorrectly use the Linux fontconfig system. Running Per the debug log, this is an issue with: https://github.com/libass/libass It isn't loading fonts in the order specified in the fontconfig. |
I'm certain I only have the release version but could you please confirm that we do have the same font file?
|
Ah ha! I was using the PPA version, which hasn't been updated with the 0-9 digits yet. Oops! No problem though, I believed the problem existed. Either way, this is an issue with libass. It is not sorting the fonts correctly according to the fontconfig settings. The exact issue is caused by this section of <match>
<!-- If the requested font is serif -->
<test qual="any" name="family">
<string>serif</string>
</test>
<!-- Make Bitstream Vera Serif the first result -->
<edit name="family" mode="prepend_first">
<string>Bitstream Vera Serif</string>
</edit>
<!-- Followed by Emoji One Color -->
<edit name="family" mode="prepend_first">
<string>Emoji One Color</string>
</edit>
</match> I tested and retested the provided fontconfig for hours when I first wrote it. Fontconfig documentation is here: https://www.freedesktop.org/software/fontconfig/fontconfig-user.html If I flip them, <match>
<!-- If the requested font is serif -->
<test qual="any" name="family">
<string>serif</string>
</test>
<!-- Followed by Emoji One Color -->
<edit name="family" mode="prepend_first">
<string>Emoji One Color</string>
</edit>
<!-- Make Bitstream Vera Serif the first result -->
<edit name="family" mode="prepend_first">
<string>Bitstream Vera Serif</string>
</edit>
</match> $ fc-match sans -s | head -n 3
Vera.ttf: "Bitstream Vera Sans" "Roman"
DejaVuSans.ttf: "DejaVu Sans" "Book"
DejaVuSans-Bold.ttf: "DejaVu Sans" "Bold" Any ideas? Seems like a libass bug at this point... although definitely arguable that the fontconfig config is unclear about how it should work. You'd expect the second "prepend_first" to override the first, but it doesn't work that way. This why I wrote the "unit tests" to confirm the configuration. I really would rather not disable the 0-9 ligatures to workaround a bug in libass. Any other ideas? |
I think there's no way but disabling the digits glyphs as a hot patch for people that have this problem and submitting a bug against libass. I tried using nototools's subset script with this CLI but it failed it seems:
But the resulting font looked like it included those characters instead... ? |
I think that's what does the trick. Can you try an |
@DistantThunder |
@DistantThunder and @supgaf The "unit tests" I created for this can check to make sure the config works as designed. May be of use in testing options. The command to test the font list for "sans-serif":
Clear the cache manually after changing any files in
I think the issue is the |
@DistantThunder Sorry, I don't understand your question. Can you rephrase? |
@DistantThunder |
@eosrei Oh, Sorry, I was talking to @supgaf. But I haven't find a way to remove the numeric glyphs from EmojiOneColor. Like I wrote earlier, the Nototools script doesn't work as intended... @supgaf Thanks! I'll try that font and see what gives, although I suspect like @eosrei said this just modify fontconfig's file to give priority the prefered font in all situation without considering any of the However I suspect that maybe MPV's |
@DistantThunder If you just want it to work, use v1.0-beta3. It doesn't have the 0-9 ligatures. I wouldn't be surprised if there is a better solution for the provided |
@eosrei Haha, yeah, I'll just use the pre-release font, they worked without a hitch before. Are you going to file a bug against libass? I could try but I don't have much knowledge in fonts and font-config. |
@DistantThunder I don't have time right now to make a detailed bug report. I'll leave this open until there is a solution. Hopefully someone else can do it in the meantime. |
Multiple Linux programs are parsing the provided fontconfig incorrectly or the fontconfig is incorrect. The problem is, probably, related to the definition of the fontconfig edit mode "prepend_first". Either way, until a solution can be found these characters and therefore associated ligatures will be disabled. Fixes #35, #37, #39. Creates #40.
One can specify a font they want for MPV's media player in MPV's config file ($XDG_CONFIG_HOME/mpv/mpv.conf) with the "osd-font=" parameter.
Be it without specifying a custom font or using one, the digits rendering in MPV is broken:
http://i.imgur.com/946j8lQ.jpg
![946j8lq](https://cloud.githubusercontent.com/assets/195061/15275542/8a4c9a2c-1a83-11e6-8229-23840f97dde2.jpg)
It works as intended when deleting the Emoji One font. I do not recall such a problem with the v1.0.0beta pre-releases.
The text was updated successfully, but these errors were encountered: