[MPlayer-dev-eng] [PATCH] Fontconfig -font support for font_face selection / libass -font Fontconfig patterns

Evgeniy Stepanov eugeni.stepanov at gmail.com
Tue Jan 6 17:58:00 CET 2009

On Tuesday 06 January 2009 18:27:02 Adrian Stutz wrote:
> ping.
> Any news on this patch? It's been a month now.
> Also, this doesn't work together with libass. ASS treats -font as font name
> by passing it as FC_FAMILY to Fontconfig, making font selection with
> Fontconfig patterns unreliable. The above patch only fixes style selection
> for the OSD font and subtitles not rendered by libass.
> I've taken a look at libass to see if there could be an easy way around and
> came up with the attached patch. It first tries to parse the family string
> as a pattern before creating an empty one, as it does currently. I don't
> know if that's a good idea since that means libass will try to parse any
> font name as a Fontconfig pattern, even the font names from ass subtitles.

That's the problem. A font name Arial-2 will be parsed as Arial 2pt. It 
happened in the past.

If you want to pass fontconfig patterns to libass, you should
- add a field in ass_style_t (either a char* FontPattern, or a boolean 
- set it from ass_mp.c, where plaintext subs are converted to ass_track_t
- pass it to fontconfig_select as an additional function parameter

> I tested both selecting a subtitle font style with -font and playing movies
> with ass subtitles and both worked as expected, though.

More information about the MPlayer-dev-eng mailing list