]> git.sesse.net Git - vlc/commitdiff
libass: ass_set_fonts_dir() is for a "private" storage place for fonts in case any...
authorDerk-Jan Hartman <hartman@videolan.org>
Fri, 8 Aug 2008 21:17:30 +0000 (23:17 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Fri, 8 Aug 2008 21:17:30 +0000 (23:17 +0200)
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.

modules/codec/libass.c

index c2b39c457486c4ea5b343bf0d4a0e01db71ce249..f8102957fa1781d7bd64db4f47ed27247f8b8c69 100644 (file)
@@ -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 );