summaryrefslogtreecommitdiffstats
path: root/libass/ass_fontselect.c
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@chown.ath.cx>2011-08-18 06:19:33 +0200
committerGrigori Goronzy <greg@chown.ath.cx>2015-07-10 10:42:40 +0200
commit3b72ae063fe2f4d7adb7c59587155e0a45c692d0 (patch)
tree152ef37547601f32509ff552c7d15ee80388f506 /libass/ass_fontselect.c
parentcce454eac1f3bee89cb7cdb8d35032917f430142 (diff)
downloadlibass-3b72ae063fe2f4d7adb7c59587155e0a45c692d0.tar.bz2
libass-3b72ae063fe2f4d7adb7c59587155e0a45c692d0.tar.xz
Restore fontconfig runtime configuration
Pass the fontconfig configuration file option and enable switch through into the font selector. This restores some of the old functionality related to fontconfig. However, the functionality to delay the fontconfig database update will not come back. This is not a big problem. Later it will be possible to manually add the fontconfig provider, which will delay the update in a comparable way.
Diffstat (limited to 'libass/ass_fontselect.c')
-rw-r--r--libass/ass_fontselect.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libass/ass_fontselect.c b/libass/ass_fontselect.c
index 1de18905..04a6cb4d 100644
--- a/libass/ass_fontselect.c
+++ b/libass/ass_fontselect.c
@@ -210,7 +210,7 @@ void ass_font_provider_free(ASS_FontProvider *provider)
// TODO: this should probably remove all fonts that belong
// to this provider from the list
- if (provider->funcs.destroy_provider)
+ if (provider && provider->funcs.destroy_provider)
provider->funcs.destroy_provider(provider->priv);
free(provider);
}
@@ -617,7 +617,7 @@ ass_embedded_fonts_add_provider(ASS_Library *lib, ASS_FontSelector *selector,
ASS_FontSelector *
ass_fontselect_init(ASS_Library *library,
FT_Library ftlibrary, const char *family,
- const char *path)
+ const char *path, const char *config, int fc)
{
ASS_FontSelector *priv = calloc(1, sizeof(ASS_FontSelector));
@@ -630,8 +630,9 @@ ass_fontselect_init(ASS_Library *library,
ftlibrary);
#ifdef CONFIG_FONTCONFIG
- // XXX: for now, always add the fontconfig provider
- priv->default_provider = ass_fontconfig_add_provider(library, priv, NULL);
+ if (fc != 0)
+ priv->default_provider = ass_fontconfig_add_provider(library,
+ priv, config);
#endif
return priv;
@@ -665,9 +666,7 @@ void ass_fontselect_free(ASS_FontSelector *priv)
// TODO: we should track all child font providers and
// free them here
-#ifdef CONFIG_FONTCONFIG
ass_font_provider_free(priv->default_provider);
-#endif
ass_font_provider_free(priv->embedded_provider);
free(priv);