[vlc-commits] codec: libass: add additional fonts dir option

Francois Cartegnie git at videolan.org
Fri Jan 22 22:11:16 UTC 2021


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan 20 22:52:33 2021 +0100| [4298d6310c840e56b4b4b590bc727aff608cfab3] | committer: Francois Cartegnie

codec: libass: add additional fonts dir option

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4298d6310c840e56b4b4b590bc727aff608cfab3
---

 modules/codec/libass.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/codec/libass.c b/modules/codec/libass.c
index 9d3ce5c1d2..4f96264402 100644
--- a/modules/codec/libass.c
+++ b/modules/codec/libass.c
@@ -55,6 +55,8 @@
 static int  Create ( vlc_object_t * );
 static void Destroy( vlc_object_t * );
 
+#define TEXT_SSA_FONTSDIR   N_("Additional fonts directory")
+
 vlc_module_begin ()
     set_shortname( N_("Subtitles (advanced)"))
     set_description( N_("Subtitle renderers using libass") )
@@ -62,6 +64,7 @@ vlc_module_begin ()
     set_category( CAT_INPUT )
     set_subcategory( SUBCAT_INPUT_SCODEC )
     set_callbacks( Create, Destroy )
+    add_string("ssa-fontsdir", NULL, TEXT_SSA_FONTSDIR, NULL, false)
 vlc_module_end ()
 
 /*****************************************************************************
@@ -196,6 +199,13 @@ static int Create( vlc_object_t *p_this )
     }
     free( pp_attachments );
 
+    char *psz_fontsdir = var_InheritString( p_dec, "ssa-fontsdir" );
+    if( psz_fontsdir )
+    {
+        ass_set_fonts_dir( p_library, psz_fontsdir );
+        free( psz_fontsdir );
+    }
+
     ass_set_extract_fonts( p_library, true );
     ass_set_style_overrides( p_library, NULL );
 



More information about the vlc-commits mailing list