[vlc-devel] [PATCH 1/2] fontconfig: use interger as FC_SIZE

ileoo at videolan.org ileoo at videolan.org
Wed Feb 26 13:07:27 CET 2014


From: Ilkka Ollakka <ileoo at videolan.org>

---
 modules/text_renderer/platform_fonts.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/modules/text_renderer/platform_fonts.c b/modules/text_renderer/platform_fonts.c
index 28d4437..88ba9eb 100644
--- a/modules/text_renderer/platform_fonts.c
+++ b/modules/text_renderer/platform_fonts.c
@@ -129,14 +129,9 @@ char* FontConfig_Select( filter_t *p_filter, const char* family,
     FcPatternAddBool( pat, FC_OUTLINE, FcTrue );
     FcPatternAddInteger( pat, FC_SLANT, b_italic ? FC_SLANT_ITALIC : FC_SLANT_ROMAN );
     FcPatternAddInteger( pat, FC_WEIGHT, b_bold ? FC_WEIGHT_EXTRABOLD : FC_WEIGHT_NORMAL );
-    if( i_size != -1 )
+    if( i_size > 0 )
     {
-        char *psz_fontsize;
-        if( asprintf( &psz_fontsize, "%d", i_size ) != -1 )
-        {
-            FcPatternAddString( pat, FC_SIZE, (const FcChar8 *)psz_fontsize );
-            free( psz_fontsize );
-        }
+        FcPatternAddInteger( pat, FC_SIZE, i_size );
     }
 
     /* */
-- 
1.9.0




More information about the vlc-devel mailing list