Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/canvas


Modified Files:
        evas_font_dir.c 


Log Message:


fontconfig mem reduction patch (only load what is needed)

===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_font_dir.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- evas_font_dir.c     28 Mar 2006 16:28:54 -0000      1.18
+++ evas_font_dir.c     5 Apr 2006 23:23:16 -0000       1.19
@@ -312,31 +312,19 @@
    if (!font) /* Search using fontconfig */
      {   
        FcPattern *p_nm = NULL;
-       FcFontSet *set;
+       FcChar8 *s;
        FcResult res;
-       int i;
-
+       
        p_nm = FcNameParse(name);
        FcConfigSubstitute(NULL, p_nm, FcMatchPattern);
        FcDefaultSubstitute(p_nm);
-
+       
        /* do matching */
-       set = FcFontSort(NULL, p_nm, FcTrue, NULL, &res);
-                 
-       /* Do loading for all in family */
-       for (i = 0; i < set->nfont; i++)
-         {
-            FcValue filename;
-                              
-            FcPatternGet(set->fonts[i], FC_FILE, 0, &filename);        
-                      
-            if (font)
-              evas->engine.func->font_add(evas->engine.data.output, font, 
filename.u.s, size);
-            else 
-              font = evas->engine.func->font_load(evas->engine.data.output, 
filename.u.s, size);                           
-         }
-         
-       FcFontSetDestroy(set); 
+       p_nm = FcFontMatch(NULL, p_nm, &res);
+       res = FcPatternGetString(p_nm, FC_FILE, 0, &s);
+       if (res == FcResultMatch)
+         font = evas->engine.func->font_load(evas->engine.data.output, s,
+                                             size);
        FcPatternDestroy(p_nm);
      }
 #endif




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to