Index: cfg-common.h =================================================================== --- cfg-common.h (revision 25326) +++ cfg-common.h (working copy) @@ -329,8 +329,8 @@ {"ass-hinting", &ass_hinting, CONF_TYPE_INT, CONF_RANGE, 0, 7, NULL}, #endif #ifdef HAVE_FONTCONFIG - {"fontconfig", &font_fontconfig, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nofontconfig", &font_fontconfig, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"fontconfig", &font_fontconfig, CONF_TYPE_FLAG, 0, -1, 1, NULL}, + {"nofontconfig", &font_fontconfig, CONF_TYPE_FLAG, 0, 1, -1, NULL}, #else {"fontconfig", "MPlayer was compiled without fontconfig support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, {"nofontconfig", "MPlayer was compiled without fontconfig support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, Index: libass/ass_fontconfig.c =================================================================== --- libass/ass_fontconfig.c (revision 25326) +++ libass/ass_fontconfig.c (working copy) @@ -40,6 +40,8 @@ #include #endif +extern int font_fontconfig; + struct fc_instance_s { #ifdef HAVE_FONTCONFIG FcConfig* config; @@ -153,6 +155,10 @@ uint32_t code) { char* res = 0; + if (font_fontconfig < 0) { + *index = priv->index_default; + return priv->path_default; + } if (family && *family) res = _select_font(priv, family, bold, italic, index, code); if (!res && priv->family_default) { Index: libass/ass_mp.c =================================================================== --- libass/ass_mp.c (revision 25326) +++ libass/ass_mp.c (working copy) @@ -56,7 +56,7 @@ #ifdef HAVE_FONTCONFIG extern int font_fontconfig; #else -static int font_fontconfig = 0; +static int font_fontconfig = -1; #endif extern char* font_name; extern float text_font_scale_factor; @@ -90,7 +90,7 @@ sid = ass_alloc_style(track); style = track->styles + sid; style->Name = strdup("Default"); - style->FontName = (font_fontconfig && font_name) ? strdup(font_name) : strdup("Sans"); + style->FontName = (font_fontconfig >= 0 && font_name) ? strdup(font_name) : strdup("Sans"); fs = track->PlayResY * text_font_scale_factor / 100.; // approximate autoscale coefficients @@ -234,9 +234,9 @@ void ass_configure_fonts(ass_renderer_t* priv) { char *dir, *path, *family; dir = get_path("fonts"); - if (!font_fontconfig && font_name) path = strdup(font_name); + if (font_fontconfig < 0 && font_name) path = strdup(font_name); else path = get_path("subfont.ttf"); - if (font_fontconfig && font_name) family = strdup(font_name); + if (font_fontconfig >= 0 && font_name) family = strdup(font_name); else family = 0; ass_set_fonts(priv, path, family); Index: mencoder.c =================================================================== --- mencoder.c (revision 25326) +++ mencoder.c (working copy) @@ -533,7 +533,7 @@ init_freetype(); #endif #ifdef HAVE_FONTCONFIG - if(!font_fontconfig) + if(font_fontconfig <= 0) { #endif #ifdef HAVE_BITMAP_FONT Index: mplayer.c =================================================================== --- mplayer.c (revision 25326) +++ mplayer.c (working copy) @@ -2528,7 +2528,7 @@ init_freetype(); #endif #ifdef HAVE_FONTCONFIG - if(!font_fontconfig) + if(font_fontconfig <= 0) { #endif #ifdef HAVE_BITMAP_FONT