From b4e604380d8ec8fa5b991a1b028240fc4436eec7 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Fri, 17 Jul 2009 02:56:05 +0200 Subject: Improve fontconfig setup Add an argument to ass_set_fonts for controlling whether the fontconfig font cache should be built/updated. Add a new function ass_fonts_update to make it possible to update fonts later on. Additionally, stop using FcConfigSetDefault for thread safety. --- libass/ass.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'libass/ass.h') diff --git a/libass/ass.h b/libass/ass.h index 0a03ec2..b7eab3c 100644 --- a/libass/ass.h +++ b/libass/ass.h @@ -100,9 +100,16 @@ void ass_set_line_spacing(ass_renderer_t *priv, double line_spacing); * \param fc bool, use fontconfig? * \param config path to fontconfig configuration file, or NULL. Only matters * if fontconfig is used + * \param update whether fontconfig cache should be built/updated now. Make + * sure to call ass_fonts_update later if 0! Only matters if fontconfig + * is used. + * \return success */ -int ass_set_fonts(ass_renderer_t *priv, const char *default_font, - const char *default_family, int fc, const char *config); +void ass_set_fonts(ass_renderer_t *priv, const char *default_font, + const char *default_family, int fc, const char *config, + int update); + +int ass_fonts_update(ass_renderer_t *priv); /** * \brief render a frame, producing a list of ass_image_t -- cgit v1.2.3