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

Freetype: rework Android selectors names

parent e3fe060e
......@@ -1281,12 +1281,7 @@ static int Create( vlc_object_t *p_this )
p_sys->pf_get_fallbacks = Android_GetFallbacks;
p_sys->pf_select = Generic_Select;
if( Android_ParseSystemFonts( p_filter, ANDROID_SYSTEM_FONTS ) == VLC_ENOMEM )
goto error;
if( Android_ParseSystemFonts( p_filter, ANDROID_FALLBACK_FONTS ) == VLC_ENOMEM )
goto error;
if( Android_ParseSystemFonts( p_filter, ANDROID_VENDOR_FONTS ) == VLC_ENOMEM )
goto error;
Android_Prepare( p_filter );
#else
p_sys->pf_select = Dummy_Select;
#endif
......
......@@ -1250,6 +1250,12 @@ char* Dummy_Select( filter_t *p_filter, const char* psz_font,
}
#ifdef __ANDROID__
# define ANDROID_SYSTEM_FONTS "file:///system/etc/system_fonts.xml"
# define ANDROID_FALLBACK_FONTS "file:///system/etc/fallback_fonts.xml"
# define ANDROID_VENDOR_FONTS "file:///vendor/etc/fallback_fonts.xml"
# define ANDROID_FONT_PATH "/system/fonts"
static int Android_ParseFamily( filter_t *p_filter, xml_reader_t *p_xml )
{
filter_sys_t *p_sys = p_filter->p_sys;
......@@ -1397,7 +1403,19 @@ static int Android_ParseFamily( filter_t *p_filter, xml_reader_t *p_xml )
return VLC_EGENERIC;
}
int Android_ParseSystemFonts( filter_t *p_filter, const char *psz_path )
int Android_Prepare( filter_t *p_filter )
{
if( Android_ParseSystemFonts( p_filter, ANDROID_SYSTEM_FONTS ) == VLC_ENOMEM )
return VLC_EGENERIC;
if( Android_ParseSystemFonts( p_filter, ANDROID_FALLBACK_FONTS ) == VLC_ENOMEM )
return VLC_EGENERIC;
if( Android_ParseSystemFonts( p_filter, ANDROID_VENDOR_FONTS ) == VLC_ENOMEM )
return VLC_EGENERIC;
return VLC_SUCCESS;
}
static int Android_ParseSystemFonts( filter_t *p_filter, const char *psz_path )
{
int i_ret = VLC_SUCCESS;
stream_t *p_stream = stream_UrlNew( p_filter, psz_path );
......
......@@ -145,15 +145,10 @@ char* MacLegacy_Select( filter_t *p_filter, const char* psz_fontname,
#endif
#ifdef __ANDROID__
# define ANDROID_SYSTEM_FONTS "file:///system/etc/system_fonts.xml"
# define ANDROID_FALLBACK_FONTS "file:///system/etc/fallback_fonts.xml"
# define ANDROID_VENDOR_FONTS "file:///vendor/etc/fallback_fonts.xml"
# define ANDROID_FONT_PATH "/system/fonts"
int Android_ParseSystemFonts( filter_t *p_filter, const char *psz_path );
const vlc_family_t *Android_GetFamily( filter_t *p_filter, const char *psz_family );
vlc_family_t *Android_GetFallbacks( filter_t *p_filter, const char *psz_family,
uni_char_t codepoint );
int Android_Prepare( filter_t *p_filter );
#endif
char* Dummy_Select( filter_t *p_filter, const char* family,
......
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