Commit e3fe060e authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Freetype: rework fontconfig selectors names

parent 6a91698d
...@@ -1263,7 +1263,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -1263,7 +1263,7 @@ static int Create( vlc_object_t *p_this )
p_sys->pf_select = Generic_Select; p_sys->pf_select = Generic_Select;
p_sys->pf_get_family = FontConfig_GetFamily; p_sys->pf_get_family = FontConfig_GetFamily;
p_sys->pf_get_fallbacks = FontConfig_GetFallbacks; p_sys->pf_get_fallbacks = FontConfig_GetFallbacks;
FontConfig_BuildCache( p_filter ); FontConfig_Prepare( p_filter );
#elif defined( __APPLE__ ) #elif defined( __APPLE__ )
#if !TARGET_OS_IPHONE #if !TARGET_OS_IPHONE
p_sys->pf_select = MacLegacy_Select; p_sys->pf_select = MacLegacy_Select;
......
...@@ -569,7 +569,7 @@ char* Generic_Select( filter_t *p_filter, const char* psz_family, ...@@ -569,7 +569,7 @@ char* Generic_Select( filter_t *p_filter, const char* psz_family,
} }
#ifdef HAVE_FONTCONFIG #ifdef HAVE_FONTCONFIG
void FontConfig_BuildCache( filter_t *p_filter ) int FontConfig_Prepare( filter_t *p_filter )
{ {
/* */ /* */
msg_Dbg( p_filter, "Building font databases."); msg_Dbg( p_filter, "Building font databases.");
...@@ -592,7 +592,9 @@ void FontConfig_BuildCache( filter_t *p_filter ) ...@@ -592,7 +592,9 @@ void FontConfig_BuildCache( filter_t *p_filter )
/* if( p_dialog ) /* if( p_dialog )
dialog_ProgressSet( p_dialog, NULL, 0.5 ); */ dialog_ProgressSet( p_dialog, NULL, 0.5 ); */
FcConfigBuildFonts( fcConfig ); if( FcConfigBuildFonts( fcConfig ) == FcFalse )
return VLC_ENOMEM;
#if defined( __APPLE__ ) #if defined( __APPLE__ )
// By default, scan only the directory /System/Library/Fonts. // By default, scan only the directory /System/Library/Fonts.
// So build the set of available fonts under another directories, // So build the set of available fonts under another directories,
...@@ -611,6 +613,7 @@ void FontConfig_BuildCache( filter_t *p_filter ) ...@@ -611,6 +613,7 @@ void FontConfig_BuildCache( filter_t *p_filter )
#endif #endif
t2 = mdate(); t2 = mdate();
msg_Dbg( p_filter, "Took %ld microseconds", (long)((t2 - t1)) ); 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 ) const vlc_family_t *FontConfig_GetFamily( filter_t *p_filter, const char *psz_family )
......
...@@ -123,10 +123,10 @@ struct vlc_family_t ...@@ -123,10 +123,10 @@ struct vlc_family_t
* PLATFORM SPECIFIC SELECTORS * PLATFORM SPECIFIC SELECTORS
**/ **/
#ifdef HAVE_FONTCONFIG #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, vlc_family_t *FontConfig_GetFallbacks( filter_t *p_filter, const char *psz_family,
uni_char_t codepoint ); 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 #endif
#if defined( _WIN32 ) && !VLC_WINSTORE_APP #if defined( _WIN32 ) && !VLC_WINSTORE_APP
...@@ -211,6 +211,7 @@ vlc_font_t *NewFont( char *psz_fontfile, int i_index, ...@@ -211,6 +211,7 @@ vlc_font_t *NewFont( char *psz_fontfile, int i_index,
* \param p_family the family to free [IN] * \param p_family the family to free [IN]
*/ */
void FreeFamiliesAndFonts( vlc_family_t *p_family ); void FreeFamiliesAndFonts( vlc_family_t *p_family );
/** /**
* Free families, but not the fonts associated. * Free families, but not the fonts associated.
* *
...@@ -218,7 +219,6 @@ void FreeFamiliesAndFonts( vlc_family_t *p_family ); ...@@ -218,7 +219,6 @@ void FreeFamiliesAndFonts( vlc_family_t *p_family );
*/ */
void FreeFamilies( void *p_families, void *p_obj ); void FreeFamilies( void *p_families, void *p_obj );
/** /**
* Construct the default family list * Construct the default family list
* *
...@@ -245,5 +245,4 @@ char* ToLower( const char *psz_src ); ...@@ -245,5 +245,4 @@ char* ToLower( const char *psz_src );
int ConvertToLiveSize( filter_t *p_filter, const text_style_t *p_style ); int ConvertToLiveSize( filter_t *p_filter, const text_style_t *p_style );
#endif //PLATFORM_FONTS_H #endif //PLATFORM_FONTS_H
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment