[vlc-commits] Freetype: Scan fonts from not only /System/Library/ Fonts but also other system-wide directories on OS X

Naohiro KORIYAMA git at videolan.org
Thu Nov 17 03:27:35 CET 2011


vlc | branch: master | Naohiro KORIYAMA <nkoriyama at gmail.com> | Thu Nov  3 05:17:30 2011 +0900| [b698c1c3de9cb572d96cd9c820ce631a29ca1098] | committer: Jean-Baptiste Kempf

Freetype: Scan fonts from not only /System/Library/Fonts but also other system-wide directories on OS X

Close #5491

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/text_renderer/freetype.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index b60b186..a9858c7 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -434,7 +434,7 @@ static void FontConfig_BuildCache( filter_t *p_filter )
     mtime_t t1, t2;
     t1 = mdate();
 
-#ifdef WIN32
+#if defined( WIN32 ) || defined( __APPLE__ )
     dialog_progress_bar_t *p_dialog = NULL;
     FcConfig *fcConfig = FcInitLoadConfig();
 
@@ -447,6 +447,15 @@ static void FontConfig_BuildCache( filter_t *p_filter )
         dialog_ProgressSet( p_dialog, NULL, 0.5 ); */
 
     FcConfigBuildFonts( fcConfig );
+#if defined( __APPLE__ )
+    // By default, scan only the directory /System/Library/Fonts.
+    // So build the set of available fonts under another directories,
+    // and add the set to the current configuration.
+    FcConfigAppFontAddDir( NULL, "~/Library/Fonts" );
+    FcConfigAppFontAddDir( NULL, "/Library/Fonts" );
+    FcConfigAppFontAddDir( NULL, "/Network/Library/Fonts" );
+    //FcConfigAppFontAddDir( NULL, "/System/Library/Fonts" );
+#endif
     if( p_dialog )
     {
 //        dialog_ProgressSet( p_dialog, NULL, 1.0 );



More information about the vlc-commits mailing list