[vlc-devel] commit: libass: ass_set_fonts_dir() is for a "private" storage place for fonts in case any of them need to be extracted. ( Derk-Jan Hartman )

git version control git at videolan.org
Sat Aug 9 00:13:36 CEST 2008


vlc | branch: 0.9.0-libass | Derk-Jan Hartman <hartman at videolan.org> | Fri Aug  8 23:17:30 2008 +0200| [ebbfe66d4deceacc1dcd0c0fdb617655671bdc49] | committer: Derk-Jan Hartman 

libass: ass_set_fonts_dir() is for a "private" storage place for fonts in case any of them need to be extracted.

Since we support fontconfig fontlookup on windows/mac/*nix there should be no real need to actually use this directory, but we still need to set one.

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

 modules/codec/libass.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/modules/codec/libass.c b/modules/codec/libass.c
index c2b39c4..f810295 100644
--- a/modules/codec/libass.c
+++ b/modules/codec/libass.c
@@ -698,15 +698,12 @@ static ass_handle_t *AssHandleYield( decoder_t *p_dec )
     }
     free( pp_attachments );
 
-#ifdef __APPLE__
-    char * psz_font_dir;
-    if( asprintf( &psz_font_dir, "%s/Library/Fonts", config_GetHomeDir() ) != -1 ) {
-        ass_set_fonts_dir( p_library, psz_font_dir );
-        free( psz_font_dir );
-    }
-#else
-    ass_set_fonts_dir( p_library, "/usr/share/fonts" ); // FIXME
-#endif
+    char *psz_font_dir = config_GetCacheDir();
+    if( !psz_font_dir )
+        goto error;
+    ass_set_fonts_dir( p_library, psz_font_dir );
+    free( psz_font_dir );
+
     ass_set_extract_fonts( p_library, true );
     ass_set_style_overrides( p_library, NULL );
 




More information about the vlc-devel mailing list