[vlc-commits] Freetype: rework Android 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:09:52 2015 +0100| [fae6bc21bf6881ac6469ddd276e98a0b1fd3d6e4] | committer: Jean-Baptiste Kempf

Freetype: rework Android selectors names

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

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

diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
index a7d0f45..2f7d5d7 100644
--- a/modules/text_renderer/freetype.c
+++ b/modules/text_renderer/freetype.c
@@ -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
diff --git a/modules/text_renderer/platform_fonts.c b/modules/text_renderer/platform_fonts.c
index a22a657..b30374c 100644
--- a/modules/text_renderer/platform_fonts.c
+++ b/modules/text_renderer/platform_fonts.c
@@ -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 );
diff --git a/modules/text_renderer/platform_fonts.h b/modules/text_renderer/platform_fonts.h
index 5d14ad2..5c6c0ca 100644
--- a/modules/text_renderer/platform_fonts.h
+++ b/modules/text_renderer/platform_fonts.h
@@ -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,



More information about the vlc-commits mailing list