You are not logged in.

#1 2013-04-13 21:04:01

rkreis
Member
Registered: 2011-06-14
Posts: 5

mplayer2 and fontconfig-2.10.92-4

Hi!

Installing mplayer2-20130126-1 and testing/fontconfig-2.10.92-4 breaks special characters (seeking bar, play/pause icon, ...) in the OSD.  They are replaced by squares and I get a lot of those in the console:

[ass] Glyph 0xE013 not found, selecting one more font for (OSD, 80, 0)

Installing either mplayer-35920-1 or fontconfig-2.10.2-1 (the version currently in extra) makes the OSD work as expected.  This is x86_64, and any -vo I tried gives the same results.  Can anyone confirm this or even guess what is going wrong?

Offline

#2 2013-04-13 21:11:07

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: mplayer2 and fontconfig-2.10.92-4

Yep, there's bug somewhere. I'm guessing libass will need to be updated to support fontconfig-2.10.92

mplayer2 bug report (though like I said, I suspect libass is the problem, not mplayer2): http://devel.mplayer2.org/ticket/230

Edit: Do you have any files that contain ASS/SSA subtitles? I don't think I do. If you do, check if you get the same issue as here: http://code.google.com/p/libass/issues/detail?id=92

Last edited by Gusar (2013-04-13 21:22:02)

Offline

#3 2013-04-13 21:39:42

opt1mus
Member
From: UK
Registered: 2011-12-31
Posts: 212
Website

Re: mplayer2 and fontconfig-2.10.92-4

I've been trouble shooting this problem with mpv-git. This is a bug with fontconfig 2.10.92-4 -- rolling back to version 2.10.2-1 results in glyphs being properly rendered.

Offline

#4 2013-04-13 22:33:19

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: mplayer2 and fontconfig-2.10.92-4

Nope. The font used for OSD in mplayer2 is badly mapped to appropriate Unicode array (should start somewhere at E101, while it does at E000). I've been playing with it for a while and once the symbols are mapped correctly, everything is fine.

Therefore I'm not sure if this is fontconfig's bug, or if the new version of fontconfig simply revealed the error in osd_font.pfb.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#5 2013-04-14 00:53:56

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: mplayer2 and fontconfig-2.10.92-4

OK, here is an easy, temporary workaround. Download mplayer2 source code, as used for the Arch package, and copy mplayer2-20130126/sub/osd_font.pfb somewhere to you /usr/share/fonts (I think it's wise to create a separate directory, say, OSD, just to remember where the creature lives and remove it when its time comes). Then do the usual:

mkfontdir /usr/share/fonts/OSD
mkfontscale /usr/share/fonts/OSD
fc-cache -f -v

Your mplayer2's OSD should work just as it did last week, till the arrival of a proper fix. At least, mine does.

Edit: Just for the record: the mapping of the font inherits characters present in the fonts you have in your system. It should use the ones from osd_font.pfb, but unfortunately it doesn't. I suspect that the fix for mplayer2 may require something like forcing the use of the array in osd_font.pfb for given symbols and ignoring those available in the external fonts. What's happening now is quite the opposite.

Last edited by bohoomil (2013-04-14 01:00:28)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#6 2013-04-14 12:18:44

rkreis
Member
Registered: 2011-06-14
Posts: 5

Re: mplayer2 and fontconfig-2.10.92-4

Thank you all for your quick and helpful responses!

This probably affects everyone running mplayer2 and fontconfig from [testing] - at least I could just reproduce it on yet another installation.

As I wrote, downgrading fontconfig makes the problem disappear.  What bohoomil suggested also makes the problem disappear.  I also came up with a simpler fix:  Extract the osd_font.pfb from the mplayer2 source and copy it to .mplayer/subfont.ttf (or /etc/mplayer/subfont.ttf).

Offline

#7 2013-04-14 15:27:21

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: mplayer2 and fontconfig-2.10.92-4

rkreis wrote:

Extract the osd_font.pfb from the mplayer2 source and copy it to .mplayer/subfont.ttf (or /etc/mplayer/subfont.ttf).

this not working

Last edited by sl1pkn07 (2013-04-14 22:53:50)

Offline

#8 2013-04-14 16:25:01

SneakySnake
Member
Registered: 2012-03-30
Posts: 21

Re: mplayer2 and fontconfig-2.10.92-4

Just some info:
This same fontconfig upgrade broke firefox web font rendering (as well as mplayer2) for me.
I googled around (for firefox), and I found this: https://bugzilla.mozilla.org/show_bug.cgi?id=857922

Basically, this is the commit that breaks things: http://cgit.freedesktop.org/fontconfig/ … a6500e8f32

I did a git bisect, and I can confirm this exact same commit breaks both firefox and mplayer2.
It seems like an API breaking change that the programs using fontconfig will have to adapt to. Read the bugzilla discussion for details.

Last edited by SneakySnake (2013-04-14 16:27:44)

Offline

#9 2013-04-14 17:39:59

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: mplayer2 and fontconfig-2.10.92-4

SneakySnake wrote:

It seems like an API breaking change that the programs using fontconfig will have to adapt to.

Not necessarily. From here:

that said I'm working on supporting such case in fontconfig now.

Patch is here: http://pkgs.fedoraproject.org/cgit/font … 81ec2276de

I haven't tested yet if it fixes only Firefox or mplayer2 too. I'll re-compile fontconfig with the patch later today.

Edit: Silly me, the patch is already applied in Arch's fontconfig-2.10.92-4. And it does not fix mplayer2. bohoomil's suggestion works for the OSD, but fonts embedded in MKVs are highly likely still broken. So libass will indeed need to adapt to the new fontconfig.

Last edited by Gusar (2013-04-14 17:56:33)

Offline

#10 2013-04-14 18:11:05

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: mplayer2 and fontconfig-2.10.92-4

Gusar wrote:

bohoomil's suggestion works for the OSD, but fonts embedded in MKVs are highly likely still broken. So libass will indeed need to adapt to the new fontconfig.

for me bohoomil's method not work, how you made make it work?

Last edited by sl1pkn07 (2013-04-14 22:52:31)

Offline

#11 2013-04-14 19:58:38

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: mplayer2 and fontconfig-2.10.92-4

Gusar wrote:

fonts embedded in MKVs are highly likely still broken.

I've just checked a Matroska file with embedded subs and it seems to be working just fine. If possible, could anyone check how it works for you?

sl1pkn07 wrote:

for me bohoomil's method not work, how you made make it work?

Did you issue the commands as root?

Last edited by bohoomil (2013-04-14 20:00:20)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#12 2013-04-14 20:08:27

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: mplayer2 and fontconfig-2.10.92-4

bohoomil wrote:

I've just checked a Matroska file with embedded subs and it seems to be working just fine.

Not embedded subs. Embedded fonts. What I think is that the embedded font won't load (considering the same mechanism is used to load them as for the OSD), but fontconfig will find a substitute and display the subs with one of the system fonts.

Edit: Hmm, the libass dev considers the issue resolved: http://code.google.com/p/libass/issues/detail?id=92#c2. I'm recompiling mplayer right now to see if it'll help, this will take a while (damn those crappy Atom CPUs smile).

Edit2: Nope, didn't help. And I get this playing a MKV with embedded subs (no embedded fonts, just srt subs):

[ass] FcFreeTypeQueryFace failed

Last edited by Gusar (2013-04-14 20:45:54)

Offline

#13 2013-04-14 20:11:00

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: mplayer2 and fontconfig-2.10.92-4

yes.

sudo mkdir /usr/share/fonts/OSD
sudo makefont /usr/share/fonts/OSD
sudo mkfontscale /usr/share/fonts/OSD
sudo cp /home/sl1pkn07/aplicaciones/mplayer2-build-git/src/mplayer2-build/mplayer/sub/osd_font.pfb  /usr/share/fonts/osd_font.pfb
sudo fc-cache -f -v

no?

with

sudo cp /home/sl1pkn07/aplicaciones/mplayer2-build-git/src/mplayer2-build/mplayer/sub/osd_font.pfb  /usr/share/fonts/OSD/osd_font.pfb
sudo fc-cache -f -v

same result

Last edited by sl1pkn07 (2013-04-14 22:52:03)

Offline

#14 2013-04-14 21:10:10

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: mplayer2 and fontconfig-2.10.92-4

Gusar wrote:
bohoomil wrote:

I've just checked a Matroska file with embedded subs and it seems to be working just fine.

Not embedded subs. Embedded fonts. What I think is that the embedded font won't load (considering the same mechanism is used to load them as for the OSD), but fontconfig will find a substitute and display the subs with one of the system fonts.

Right: embedded subtitles & fonts, of course. I tested just this sort of configuration. Sorry for not stating that clear.

Edit: I can provide screenshots if they can help in any way.

Last edited by bohoomil (2013-04-14 21:12:49)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#15 2013-04-14 22:25:11

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: mplayer2 and fontconfig-2.10.92-4

Does the OSD work for you without the workaround of copying the font into /usr/share/fonts? If embedded fonts work for you, the OSD should too. And do you get any [ass] messages in mplayer's output, like the one I mention above?

Offline

#16 2013-04-14 22:48:33

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: mplayer2 and fontconfig-2.10.92-4

No, the OSD doesn't work without the workaround. The [ass] messages are different for OSD and subs, too: without the workaround, the OSD messages were exactly like the one mentioned by the OP (the whole range of numbers passed through the screen depending on an activated function), while for subs I get

[ass] PlayResX undefined, setting to 384

However, both embedded and srt subtitles still are displayed correctly. The srt ones are rendered as well as any other TTF/OTF/T1 font in my system.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#17 2013-04-14 22:49:06

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: mplayer2 and fontconfig-2.10.92-4

shit. yes. working ><

fail to make install link in pkgbuild

Offline

#18 2013-04-17 11:37:23

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: mplayer2 and fontconfig-2.10.92-4

little question: howto undo "makefont /usr/share/fonts/OSD" and "mkfontscale /usr/share/fonts/OSD"? only remove these directories works? no keep these entries when execute fc-cache -f -v?

Offline

#19 2013-04-17 13:09:53

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: mplayer2 and fontconfig-2.10.92-4

sl1pkn07 wrote:

little question: howto undo "makefont /usr/share/fonts/OSD" and "mkfontscale /usr/share/fonts/OSD"? only remove these directories works? no keep these entries when execute fc-cache -f -v?

sudo rm -r /usr/share/fonts/OSD
sudo fc-cache -f -v

:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#20 2013-04-17 14:58:37

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: mplayer2 and fontconfig-2.10.92-4

ok, only remover dir...

thanks

Offline

#21 2013-04-22 20:40:47

gordoleon
Member
Registered: 2012-02-22
Posts: 12

Re: mplayer2 and fontconfig-2.10.92-4

rkreis wrote:

Extract the osd_font.pfb from the mplayer2 source and copy it to .mplayer/subfont.ttf (or /etc/mplayer/subfont.ttf).

This worked for me and its less intrusive. Thanks

Last edited by gordoleon (2013-04-22 20:41:04)

Offline

#22 2013-04-22 20:56:01

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: mplayer2 and fontconfig-2.10.92-4


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#23 2013-04-22 23:48:29

oceans11
Member
Registered: 2010-06-24
Posts: 15

Re: mplayer2 and fontconfig-2.10.92-4

Rasi wrote:

then

mv osd_font.pfb ~/.mplayer/subfont.ttf

worked for me too.
Thank you, guys!

Offline

#24 2013-04-24 11:36:16

Javafant
Member
Registered: 2012-04-02
Posts: 19

Re: mplayer2 and fontconfig-2.10.92-4

oceans11 wrote:
Rasi wrote:

then

mv osd_font.pfb ~/.mplayer/subfont.ttf

worked for me too.
Thank you, guys!

Are you talking about subtitles or the osd? I don't have subtitels to test, but the osd is still broken. This is what the output looks like:

[ass] FcFreeTypeQueryFace failed

Offline

#25 2013-04-24 12:18:13

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: mplayer2 and fontconfig-2.10.92-4

It's most definitely related to this bug: https://bugzil.la/857922
(And fwiw, it is not fixed in fontconfig-git, webfonts are, not mpv/mplayer/libass)

So here's a bit of an update. The offending line in libass which produces "[ass] FcFreeTypeQueryFace failed" is located in `libass/libass/ass_fontconfig.c:384'

        const char *name = library->fontdata[idx].name;
        …
        pattern =
            FcFreeTypeQueryFace(face, (unsigned char *) name, face_index,
                                FcConfigGetBlanks(priv->config));
        if (!pattern) {
            ass_msg(library, MSGL_WARN, "%s failed", "FcFreeTypeQueryFace");
            FT_Done_Face(face);
            return;
        }

The "(unsigned char *) name" looks like the culprit when reading the official documentation: http://www.freedesktop.org/software/fon … yface.html

FcPattern * FcFreeTypeQueryFace(const FT_Face face, const FcChar8 *file, int id, FcBlanks *blanks);

But beyond that I have no idea how to fix anything.

Last edited by Earnestly (2013-04-24 13:02:10)

Offline

Board footer

Powered by FluxBB