]> git.sesse.net Git - vlc/commitdiff
fontconfig: use double as FC_SIZE
authorIlkka Ollakka <ileoo@videolan.org>
Wed, 26 Feb 2014 12:02:33 +0000 (14:02 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Wed, 26 Feb 2014 13:59:01 +0000 (15:59 +0200)
Also set size only if it's > 0 (assume 0 is non-usable font-size).

modules/text_renderer/platform_fonts.c

index 28d4437c1e6806bb06e9a406e959d6a6762101fe..3e0c3f183524e58fc927d7deb32aa1a70f8c3654 100644 (file)
@@ -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 );
     }
 
     /* */