[vlc-commits] fontconfig: use double as FC_SIZE

Ilkka Ollakka git at videolan.org
Wed Feb 26 15:00:46 CET 2014


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Wed Feb 26 14:02:33 2014 +0200| [90b73bf55a9ce9cc16a55af31c09317d3d8a9bb9] | committer: Ilkka Ollakka

fontconfig: use double as FC_SIZE

Also set size only if it's > 0 (assume 0 is non-usable font-size).

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

 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..3e0c3f1 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 );
-        }
+        FcPatternAddDouble( pat, FC_SIZE, (double)i_size );
     }
 
     /* */



More information about the vlc-commits mailing list