summaryrefslogtreecommitdiffstats
path: root/libass/ass_fontconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'libass/ass_fontconfig.c')
-rw-r--r--libass/ass_fontconfig.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libass/ass_fontconfig.c b/libass/ass_fontconfig.c
index 63e62f0074..addcc82646 100644
--- a/libass/ass_fontconfig.c
+++ b/libass/ass_fontconfig.c
@@ -40,6 +40,8 @@
#include <fontconfig/fcfreetype.h>
#endif
+extern int font_fontconfig;
+
struct fc_instance_s {
#ifdef HAVE_FONTCONFIG
FcConfig* config;
@@ -153,6 +155,10 @@ char* fontconfig_select(fc_instance_t* priv, const char* family, unsigned bold,
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) {
@@ -320,6 +326,14 @@ fc_instance_t* fontconfig_init(ass_library_t* library, FT_Library ftlibrary, con
const char* dir = library->fonts_dir;
int i;
+ if (font_fontconfig < 0) {
+ mp_msg(MSGT_ASS, MSGL_WARN,
+ MSGTR_LIBASS_FontconfigDisabledDefaultFontWillBeUsed);
+ priv->path_default = strdup(path);
+ priv->index_default = 0;
+ return priv;
+ }
+
rc = FcInit();
assert(rc);