[vlc-commits] Freetype: rework fontconfig selectors names

Jean-Baptiste Kempf git at videolan.org
Sun Oct 25 18:20:35 CET 2015


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Oct 25 18:07:01 2015 +0100| [e3fe060eda90a11c51bdcfdc4ec06da7125fe300] | committer: Jean-Baptiste Kempf

Freetype: rework fontconfig selectors names

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

 modules/text_renderer/freetype.c       |    2 +-
 modules/text_renderer/platform_fonts.c |    7 +++++--
 modules/text_renderer/platform_fonts.h |    7 +++----
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index ac33c6a..a7d0f45 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -1263,7 +1263,7 @@ static int Create( vlc_object_t *p_this )
     p_sys->pf_select = Generic_Select;
     p_sys->pf_get_family = FontConfig_GetFamily;
     p_sys->pf_get_fallbacks = FontConfig_GetFallbacks;
-    FontConfig_BuildCache( p_filter );
+    FontConfig_Prepare( p_filter );
 #elif defined( __APPLE__ )
 #if !TARGET_OS_IPHONE
     p_sys->pf_select = MacLegacy_Select;
diff --git a/modules/text_renderer/platform_fonts.c b/modules/text_renderer/platform_fonts.c
index 67ba784..a22a657 100644
--- a/modules/text_renderer/platform_fonts.c
+++ b/modules/text_renderer/platform_fonts.c
@@ -569,7 +569,7 @@ char* Generic_Select( filter_t *p_filter, const char* psz_family,
 }
 
 #ifdef HAVE_FONTCONFIG
-void FontConfig_BuildCache( filter_t *p_filter )
+int FontConfig_Prepare( filter_t *p_filter )
 {
     /* */
     msg_Dbg( p_filter, "Building font databases.");
@@ -592,7 +592,9 @@ void FontConfig_BuildCache( filter_t *p_filter )
 /*    if( p_dialog )
         dialog_ProgressSet( p_dialog, NULL, 0.5 ); */
 
-    FcConfigBuildFonts( fcConfig );
+    if( FcConfigBuildFonts( fcConfig ) == FcFalse )
+        return VLC_ENOMEM;
+
 #if defined( __APPLE__ )
     // By default, scan only the directory /System/Library/Fonts.
     // So build the set of available fonts under another directories,
@@ -611,6 +613,7 @@ void FontConfig_BuildCache( filter_t *p_filter )
 #endif
     t2 = mdate();
     msg_Dbg( p_filter, "Took %ld microseconds", (long)((t2 - t1)) );
+    return VLC_SUCCESS;
 }
 
 const vlc_family_t *FontConfig_GetFamily( filter_t *p_filter, const char *psz_family )
diff --git a/modules/text_renderer/platform_fonts.h b/modules/text_renderer/platform_fonts.h
index 5709cfb..5d14ad2 100644
--- a/modules/text_renderer/platform_fonts.h
+++ b/modules/text_renderer/platform_fonts.h
@@ -123,10 +123,10 @@ struct vlc_family_t
  * PLATFORM SPECIFIC SELECTORS
  **/
 #ifdef HAVE_FONTCONFIG
-const vlc_family_t *FontConfig_GetFamily( filter_t *p_filter, const char *psz_family );
 vlc_family_t *FontConfig_GetFallbacks( filter_t *p_filter, const char *psz_family,
                                        uni_char_t codepoint );
-void FontConfig_BuildCache( filter_t *p_filter );
+const vlc_family_t *FontConfig_GetFamily( filter_t *p_filter, const char *psz_family );
+int FontConfig_Prepare( filter_t *p_filter );
 #endif
 
 #if defined( _WIN32 ) && !VLC_WINSTORE_APP
@@ -211,6 +211,7 @@ vlc_font_t *NewFont( char *psz_fontfile, int i_index,
  * \param p_family the family to free [IN]
  */
 void FreeFamiliesAndFonts( vlc_family_t *p_family );
+
 /**
  * Free families, but not the fonts associated.
  *
@@ -218,7 +219,6 @@ void FreeFamiliesAndFonts( vlc_family_t *p_family );
  */
 void FreeFamilies( void *p_families, void *p_obj );
 
-
 /**
  * Construct the default family list
  *
@@ -245,5 +245,4 @@ char* ToLower( const char *psz_src );
 
 int ConvertToLiveSize( filter_t *p_filter, const text_style_t *p_style );
 
-
 #endif //PLATFORM_FONTS_H



More information about the vlc-commits mailing list