diff options
author | ulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-12-12 10:00:34 +0000 |
---|---|---|
committer | ulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-12-12 10:00:34 +0000 |
commit | 4f4c08415ccea8def40d0c2192660ab01cb93be5 (patch) | |
tree | f470e27a3fda8f47da0f6c661093a5bbf39770d8 /libass/ass_mp.c | |
parent | df7795b63a4ea9008c9f208b3a9d584c7fe0bb00 (diff) | |
download | mpv-4f4c08415ccea8def40d0c2192660ab01cb93be5.tar.bz2 mpv-4f4c08415ccea8def40d0c2192660ab01cb93be5.tar.xz |
Fix libass to support -nofontconfig.
For history reason, fontconfig is auto-enabled when ass is enabled,
we keep this behavior and document it clearly.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25379 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libass/ass_mp.c')
-rw-r--r-- | libass/ass_mp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libass/ass_mp.c b/libass/ass_mp.c index e38fee4e2f..70e8e7a464 100644 --- a/libass/ass_mp.c +++ b/libass/ass_mp.c @@ -56,7 +56,7 @@ int ass_hinting = ASS_HINTING_NATIVE + 4; // native hinting for unscaled osd #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 @@ ass_track_t* ass_default_track(ass_library_t* library) { 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(ass_renderer_t* priv, int w, int h, int unscaled) { 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); |