E CVS: libs/evas shorne

2007-05-05 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : shorne
Project : e17
Module  : libs/evas

Dir : e17/libs/evas/src/lib/engines/common


Modified Files:
evas_font_load.c 


Log Message:
Fix problem with fonts that cant load completely
 * fix reference counting for font_int(s)
 * properly backout if face doesnt load correctly, this way we dont end up
   using the face again
 * put some comments about fudged font cache

===
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_font_load.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- evas_font_load.c13 Nov 2006 23:23:43 -  1.40
+++ evas_font_load.c5 May 2007 10:30:11 -   1.41
@@ -69,11 +69,20 @@
int error;
  
error = FT_New_Face(evas_ft_lib, fs-file, 0, (fs-ft.face));  
-   if (error) return error;
+   if (error) 
+ {
+   fs-ft.face = NULL;
+   return error;
+ }

error = FT_Select_Charmap(fs-ft.face, ft_encoding_unicode);
-   if (error) return error;
-   
+   if (error) 
+ {
+   FT_Done_Face(fs-ft.face);
+   fs-ft.face = NULL;
+   return error;
+ }
+
fs-ft.orig_upem = fs-ft.face-units_per_EM;
return error;
 }
@@ -123,6 +132,7 @@
RGBA_Font_Int *fi;
 
fi = l-data;
+   
if (fi-src-current_size != fi-size)
  {
 FT_Activate_Size(fi-ft.size);
@@ -278,6 +288,7 @@
 
fi = evas_common_font_int_load(name, size);
if (!fi) return NULL;
+  
/* First font, complete load */ 
if (!fi-ft.size)
  {
@@ -285,9 +296,12 @@
  {
 if (evas_common_font_source_load_complete(fi-src))
   {
- fonts = evas_object_list_remove(fonts, fi);
- evas_common_font_source_free(fi-src);
- free(fi);
+ fi-references--;
+ if (fi-references == 0)
+   {
+  evas_common_font_int_modify_cache_by(fi, 1);
+  evas_common_font_flush();
+   }
  return NULL;
   }
  }
@@ -297,7 +311,12 @@
fn = calloc(1, sizeof(RGBA_Font));
if (!fn)
  {
-   free(fi);
+   fi-references--; 
+   if (fi-references == 0)
+ {
+evas_common_font_int_modify_cache_by(fi, 1);
+evas_common_font_flush();
+ }
return NULL;
  }
fn-fonts = evas_list_append(fn-fonts, fi);
@@ -472,6 +491,10 @@
key = 0;
 }
 
+/* when the fi-references == 0 we increase this instead of really deleting
+ * we then check if the cache_useage size is larger than allowed 
+ * !If the cache is NOT too large we dont delete font_int 
+ * !If the cache is too large we really delete font_int */
 EAPI void
 evas_common_font_int_modify_cache_by(RGBA_Font_Int *fi, int dir)
 {
@@ -519,6 +542,9 @@
fdata = 0;
 }
 
+/* We run this when the cache gets larger than allowed size
+ * We check cache size each time a fi-references goes to 0
+ * PERFORMS: Find font_int(s) with references == 0 and delete them */
 EAPI void
 evas_common_font_flush_last(void)
 {



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: libs/evas shorne

2007-05-05 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : shorne
Project : e17
Module  : libs/evas

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


Modified Files:
evas_font_dir.c 


Log Message:
Fix problem with fonts that cant load completely
 * fix reference counting for font_int(s)
 * properly backout if face doesnt load correctly, this way we dont end up
   using the face again
 * put some comments about fudged font cache

===
RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_font_dir.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- evas_font_dir.c 1 May 2007 13:05:24 -   1.26
+++ evas_font_dir.c 5 May 2007 10:30:11 -   1.27
@@ -158,6 +158,7 @@
   }
  }
  }
+
for (l = fonts_zero; l; l = l-next)
  {
fd = l-data;
@@ -330,8 +331,8 @@
 FcPatternGet(set-fonts[i], FC_FILE, 0, filename);
 
 if (font)
-  evas-engine.func-font_add(evas-engine.data.output, font, 
(char *)filename.u.s, size);
-else
+  evas-engine.func-font_add(evas-engine.data.output, font, 
(char *)filename.u.s, size);   
+else 
   font = evas-engine.func-font_load(evas-engine.data.output, 
(char *)filename.u.s, size);
  }
 
@@ -350,6 +351,7 @@
fd-ref = 1;
fonts_cache = evas_list_prepend(fonts_cache, fd);
  }
+
if (font)
  evas-engine.func-font_hinting_set(evas-engine.data.output, font,
 evas-hinting);



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: libs/evas shorne

2006-04-30 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : shorne
Project : e17
Module  : libs/evas

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


Modified Files:
evas_private.h 


Log Message:
Add API for getting the available fonts

===
RCS file: /cvs/e/e17/libs/evas/src/lib/include/evas_private.h,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -3 -r1.67 -r1.68
--- evas_private.h  2 Mar 2006 12:48:11 -   1.67
+++ evas_private.h  30 Apr 2006 11:39:44 -  1.68
@@ -597,6 +597,7 @@

void (*font_hinting_set)(void *data, void *font, int 
hinting);
int  (*font_hinting_can_hint)   (void *data, int hinting);
+   
 /*void (*image_rotation_set)  (void *data, void *image); */
 
 };
@@ -690,6 +691,8 @@
 void evas_key_grab_free(Evas_Object *obj, const char *keyname, 
Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers);
 void evas_font_dir_cache_free(void);
 char *evas_font_dir_cache_find(char *dir, char *font);
+Evas_List *evas_font_dir_available_list(Evas* evas);
+void evas_font_dir_available_list_free(Evas_List *available);
 void evas_font_free(Evas *evas, void *font);
 void *evas_font_load(Evas *evas, const char *name, const char *source, int 
size);
 void evas_font_load_hinting_set(Evas *evas, void *font, int hinting);   




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: libs/evas shorne

2006-04-30 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : shorne
Project : e17
Module  : libs/evas

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


Modified Files:
evas_font_dir.c evas_object_text.c 


Log Message:
Add API for getting the available fonts

===
RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_font_dir.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- evas_font_dir.c 22 Apr 2006 11:08:01 -  1.21
+++ evas_font_dir.c 30 Apr 2006 11:39:44 -  1.22
@@ -364,6 +364,78 @@
   hinting);
 }
 
+Evas_List *
+evas_font_dir_available_list(Evas *evas)
+{
+   Evas_List *l;
+   Evas_List *ll;
+   Evas_List *available = NULL;
+
+#ifdef HAVE_FONTCONFIG
+   /* Add font config fonts */
+   FcPattern *p;
+   FcFontSet *set;
+   FcObjectSet *os;
+   int i;
+  
+   p = FcPatternCreate();
+   os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, NULL);
+   
+   if (p  os) set = FcFontList(NULL, p, os);
+   
+   if (p) FcPatternDestroy(p);
+   if (os) FcObjectSetDestroy(os);
+
+   if (set)
+ {   
+   for (i = 0; i  set-nfont; i++)
+ {
+char * font;
+
+font = FcNameUnparse(set-fonts[i]);
+available = evas_list_append(available, 
evas_stringshare_add(font));
+free(font);   
+ }
+ 
+   FcFontSetDestroy(set); 
+ }
+#endif
+
+   /* Add fonts in evas font_path*/
+   if (!evas-font_path) 
+ return available;
+   
+   for (l = evas-font_path; l; l = l-next)
+ {
+   Evas_Font_Dir *fd;
+   
+   fd = evas_hash_find(font_dirs, (char *)l-data);
+   fd = object_text_font_cache_dir_update((char *)l-data, fd);
+   if (fd  fd-aliases)
+ {
+for (ll = fd-aliases; ll; ll = ll-next)
+  {
+ Evas_Font_Alias *fa;
+ 
+ fa = ll-data;
+ available = evas_list_append(available, 
evas_stringshare_add((char *)fa-alias)); 
+  }
+ }
+ }
+
+   return available;
+}
+
+void 
+evas_font_dir_available_list_free(Evas_List *available)
+{
+   while (available)
+ {
+   evas_stringshare_del(available-data);
+   available = evas_list_remove(available, available-data);
+ }
+}
+
 /* private stuff */
 static Evas_Bool
 font_cache_dir_free(Evas_Hash *hash, const char *key, void *data, void *fdata)
===
RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_object_text.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- evas_object_text.c  19 Mar 2006 04:29:57 -  1.55
+++ evas_object_text.c  30 Apr 2006 11:39:44 -  1.56
@@ -1101,6 +1101,38 @@
  * FIXME: To be fixed.
  *
  */
+EAPI Evas_List *
+evas_font_available_list(Evas *e)
+{
+   MAGIC_CHECK(e, Evas, MAGIC_EVAS);
+   return NULL;
+   MAGIC_CHECK_END();
+
+   return evas_font_dir_available_list(e);
+}
+   
+/**
+ * To be documented.
+ *
+ * FIXME: To be fixed.
+ *
+ */
+EAPI void
+evas_font_available_list_free(Evas *e, Evas_List *available)
+{ 
+   MAGIC_CHECK(e, Evas, MAGIC_EVAS);
+   return;
+   MAGIC_CHECK_END();
+
+   return evas_font_dir_available_list_free(available); 
+}
+
+/**
+ * To be documented.
+ *
+ * FIXME: To be fixed.
+ *
+ */
 EAPI int
 evas_string_char_next_get(const char *str, int pos, int *decoded)
 {




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: libs/evas shorne

2006-04-30 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : shorne
Project : e17
Module  : libs/evas

Dir : e17/libs/evas/src/lib


Modified Files:
Evas.h 


Log Message:
Add API for getting the available fonts

===
RCS file: /cvs/e/e17/libs/evas/src/lib/Evas.h,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -3 -r1.82 -r1.83
--- Evas.h  28 Feb 2006 04:07:47 -  1.82
+++ Evas.h  30 Apr 2006 11:39:44 -  1.83
@@ -487,6 +487,9 @@
EAPI void  evas_font_cache_set   (Evas *e, int 
size);
EAPI int   evas_font_cache_get   (Evas *e);
 
+   EAPI Evas_List   *evas_font_available_list  (Evas *e);
+   EAPI void evas_font_available_list_free (Evas *e, Evas_List 
*available);
+   
typedef struct _Evas_Textblock_Style Evas_Textblock_Style;
typedef struct _Evas_Textblock_CursorEvas_Textblock_Cursor;
typedef struct _Evas_Textblock_Rectangle Evas_Textblock_Rectangle;




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: libs/evas shorne

2006-04-22 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : shorne
Project : e17
Module  : libs/evas

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


Modified Files:
evas_common.h 


Log Message:
Add font charmap caching
 * TODO: store cache on disc, for faster cache loading (this requires EET to 
support arrays)

===
RCS file: /cvs/e/e17/libs/evas/src/lib/include/evas_common.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -3 -r1.57 -r1.58
--- evas_common.h   9 Apr 2006 00:02:47 -   1.57
+++ evas_common.h   22 Apr 2006 11:08:01 -  1.58
@@ -109,6 +109,9 @@
 typedef struct _Tilebuf   Tilebuf;
 typedef struct _Tilebuf_Tile  Tilebuf_Tile;
 typedef struct _Tilebuf_Rect  Tilebuf_Rect;
+
+typedef struct _Evas_Array_Hash  Evas_Array_Hash;
+
 /*
 typedef struct _Regionbuf Regionbuf;
 typedef struct _RegionspanRegionspan;
@@ -341,7 +344,8 @@
int   data_size;
 
int   current_size;
-
+   Evas_Array_Hash  *charmap;
+   
struct {
   int   orig_upem;
   FT_Face   face;
@@ -964,6 +968,11 @@
 Gfx_Func_Blend_Src_Dst   evas_common_draw_func_copy_get(int 
pixels, int reverse);
 
 void  evas_font_dir_cache_free(void);
+
+Evas_Array_Hash*evas_common_array_hash_new (void);
+voidevas_common_array_hash_free(Evas_Array_Hash *hash);
+voidevas_common_array_hash_add (Evas_Array_Hash *hash, int 
key, int data);
+int evas_common_array_hash_search  (Evas_Array_Hash *hash, int 
key);
 
 /*/
 




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: libs/evas shorne

2006-04-22 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : shorne
Project : e17
Module  : libs/evas

Dir : e17/libs/evas/src/lib/engines/common


Modified Files:
Makefile.am evas_font_draw.c evas_font_load.c 
Added Files:
evas_array_hash.c 


Log Message:
Add font charmap caching
 * TODO: store cache on disc, for faster cache loading (this requires EET to 
support arrays)

===
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/Makefile.am,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- Makefile.am 17 Jan 2006 03:47:35 -  1.16
+++ Makefile.am 22 Apr 2006 11:08:01 -  1.17
@@ -53,6 +53,7 @@
 evas_scale_smooth.c \
 evas_tiler.c \
 evas_regionbuf.c \
+evas_array_hash.c \
 evas_blend_ops.h
 
 EXTRA_DIST = \
===
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_font_draw.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- evas_font_draw.c17 Apr 2006 01:57:11 -  1.24
+++ evas_font_draw.c22 Apr 2006 11:08:01 -  1.25
@@ -62,20 +62,67 @@
  {
RGBA_Font_Int *fi;
int index;
-
+   
fi = l-data;
-   if (!fi-ft.size)
+
+   if (fi-src-charmap) /* Charmap loaded, FI/FS blank */
  {
-if (!fi-src-ft.face)
-  evas_common_font_source_load_complete(fi-src);
-evas_common_font_int_load_complete(fi);
+index = evas_common_array_hash_search(fi-src-charmap, gl);
+if (index != 0)
+  {
+ evas_common_font_source_load_complete(fi-src);
+ evas_common_font_int_load_complete(fi);
+
+ evas_common_array_hash_free(fi-src-charmap);
+ fi-src-charmap = NULL;
+
+ *fi_ret = fi;
+ return index;   
+  }
+ }
+   else if (!fi-src-ft.face) /* Charmap not loaded, FI/FS blank */
+ {
+if (evas_common_font_source_load_complete(fi-src));
+  return 0;
+
+index = FT_Get_Char_Index(fi-src-ft.face, gl);
+if (index == 0)
+  {
+ /* Load Hash */
+ FT_ULong  charcode;
+ FT_UInt   gindex;
+
+ fi-src-charmap = evas_common_array_hash_new();
+ charcode = FT_Get_First_Char(fi-src-ft.face, gindex );
+ while ( gindex != 0 )
+   {
+  evas_common_array_hash_add(fi-src-charmap, charcode, 
gindex);
+  charcode = FT_Get_Next_Char(fi-src-ft.face, charcode, 
gindex );
+   }
+ 
+ /* Free face */
+ FT_Done_Face(fi-src-ft.face);
+ fi-src-ft.face = NULL;
+  }
+else
+  {
+ evas_common_font_int_load_complete(fi);
+ 
+ *fi_ret = fi;
+ return index;
+  }
  }
- 
-index = FT_Get_Char_Index(fi-src-ft.face, gl);
-   if (index != 0)
+   else /* Charmap not loaded, FS loaded */
  {
-*fi_ret = fi;
-return index;
+index = FT_Get_Char_Index(fi-src-ft.face, gl);
+if (index != 0)
+  {
+ if (!fi-ft.size) 
+   evas_common_font_int_load_complete(fi); 
+ 
+ *fi_ret = fi;
+ return index;
+  }
  }
  }
return 0;
===
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_font_load.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- evas_font_load.c9 Apr 2006 02:36:03 -   1.34
+++ evas_font_load.c22 Apr 2006 11:08:01 -  1.35
@@ -64,8 +64,8 @@
 evas_common_font_source_load_complete(RGBA_Font_Source *fs)
 {
int error;
-  
-   error = FT_New_Face(evas_ft_lib, fs-name, 0, (fs-ft.face));
+ 
+   error = FT_New_Face(evas_ft_lib, fs-file, 0, (fs-ft.face));  
if (error) return error;

error = FT_Select_Charmap(fs-ft.face, ft_encoding_unicode);
@@ -105,6 +105,7 @@
 
fonts_src = evas_object_list_remove(fonts_src, fs);
FT_Done_Face(fs-ft.face);
+   if (fs-charmap) evas_common_array_hash_free(fs-charmap);
if (fs-name) evas_stringshare_del(fs-name);
free(fs);
 }
@@ -546,3 +547,4 @@
  }
return NULL;
 }
+




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642

E CVS: libs/evas shorne

2006-04-22 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : shorne
Project : e17
Module  : libs/evas

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


Modified Files:
evas_hash.c 


Log Message:
Add font charmap caching
 * TODO: store cache on disc, for faster cache loading (this requires EET to 
support arrays)

===
RCS file: /cvs/e/e17/libs/evas/src/lib/data/evas_hash.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- evas_hash.c 16 Jan 2006 03:37:33 -  1.19
+++ evas_hash.c 22 Apr 2006 11:08:01 -  1.20
@@ -403,7 +403,7 @@
  *
  * This function goes through every entry in the hash table @p hash and calls
  * the function @p func on each member. The function should NOT modify the
- * hash table contents if it reeturns 1. IF the hash table contents are
+ * hash table contents if it returns 1. IF the hash table contents are
  * modified by this function or the function wishes to stop processing it must
  * return 0, otherwise return 1 to keep processing.
  *




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: libs/evas shorne

2006-04-22 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : shorne
Project : e17
Module  : libs/evas

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


Modified Files:
evas_font_dir.c 


Log Message:
Add font charmap caching
 * TODO: store cache on disc, for faster cache loading (this requires EET to 
support arrays)

===
RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_font_dir.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- evas_font_dir.c 9 Apr 2006 02:42:21 -   1.20
+++ evas_font_dir.c 22 Apr 2006 11:08:01 -  1.21
@@ -616,7 +616,7 @@
  Evas_Font_Alias *fa;
 
  /* skip comments */
- if ((fdef[0] == '!') || (fdef[0] == '#')) continue;
+ if ((fname[0] == '!') || (fname[0] == '#')) continue;
  fa = calloc(1, sizeof(Evas_Font_Alias));
  if (fa)
{




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: libs/evas shorne

2006-04-08 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : shorne
Project : e17
Module  : libs/evas

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


Modified Files:
evas_common.h 


Log Message:
Evas on-demand font loading
 * When fonts are added from files we will only load the details
 * The first font is always loaded
 * I know there is a patch for this on the list but this way seems better to me


===
RCS file: /cvs/e/e17/libs/evas/src/lib/include/evas_common.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -3 -r1.56 -r1.57
--- evas_common.h   7 Mar 2006 02:44:15 -   1.56
+++ evas_common.h   9 Apr 2006 00:02:47 -   1.57
@@ -334,8 +334,8 @@
 {
Evas_Object_List  _list_data;
 
-   char *name;
-   char *file;
+   const char   *name;
+   const char   *file;
 
void *data;
int   data_size;
@@ -865,6 +865,7 @@
 void evas_common_font_shutdown  (void);
 RGBA_Font_Source *evas_common_font_source_memory_load(const char *name, const 
void *data, int data_size);
 RGBA_Font_Source *evas_common_font_source_load   (const char *name);
+int evas_common_font_source_load_complete(RGBA_Font_Source *fs);
 RGBA_Font_Source *evas_common_font_source_find   (const char *name);
 void  evas_common_font_source_free   (RGBA_Font_Source *fs);
 void  evas_common_font_size_use (RGBA_Font *fn);
@@ -873,6 +874,7 @@
 RGBA_Font   *evas_common_font_add   (RGBA_Font *fn, const char 
*name, int size);
 RGBA_Font   *evas_common_font_memory_add(RGBA_Font *fn, const char 
*name, int size, const void *data, int data_size);
 RGBA_Font_Int   *evas_common_font_int_load_init (RGBA_Font_Int *fn);
+RGBA_Font_Int  *evas_common_font_int_load_complete (RGBA_Font_Int *fi);
 void evas_common_font_free  (RGBA_Font *fn);
 void evas_common_font_hinting_set   (RGBA_Font *fn, 
Font_Hint_Flags hinting);
 Evas_Boolevas_common_hinting_available  (Font_Hint_Flags hinting);




---
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=lnkkid=110944bid=241720dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: libs/evas shorne

2006-04-08 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : shorne
Project : e17
Module  : libs/evas

Dir : e17/libs/evas/src/lib/engines/common


Modified Files:
evas_font_draw.c evas_font_load.c 


Log Message:
Evas on-demand font loading
 * When fonts are added from files we will only load the details
 * The first font is always loaded
 * I know there is a patch for this on the list but this way seems better to me


===
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_font_draw.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- evas_font_draw.c1 Mar 2006 03:48:02 -   1.22
+++ evas_font_draw.c9 Apr 2006 00:02:47 -   1.23
@@ -64,6 +64,13 @@
int index;
 
fi = l-data;
+   if (!fi-ft.size)
+ {
+if (!fi-src-ft.face)
+  evas_common_font_source_load_complete(fi-src);
+evas_common_font_int_load_complete(fi);
+ }
+ 
 index = FT_Get_Char_Index(fi-src-ft.face, gl);
if (index != 0)
  {
@@ -90,7 +97,7 @@
FT_Face pface = NULL;
 
fi = fn-fonts-data;
-
+   
im = dst-image-data;
im_w = dst-image-w;
im_h = dst-image-h;
===
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_font_load.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- evas_font_load.c19 Mar 2006 04:29:57 -  1.32
+++ evas_font_load.c9 Apr 2006 00:02:47 -   1.33
@@ -48,21 +48,33 @@
fs-data = NULL;
fs-data_size = 0;
fs-current_size = 0;
-   error = FT_New_Face(evas_ft_lib, name, 0, (fs-ft.face));
-   if (error)
- {
-   free(fs);
-   return NULL;
- }
+   fs-ft.face = NULL;
+   
fs-name = evas_stringshare_add(name);
fs-file = fs-name;
-   error = FT_Select_Charmap(fs-ft.face, ft_encoding_unicode);
-   fs-ft.orig_upem = fs-ft.face-units_per_EM;
+   
+   fs-ft.orig_upem = 0;
+   
fs-references = 1;
fonts_src = evas_object_list_prepend(fonts_src, fs);
return fs;
 }
 
+int
+evas_common_font_source_load_complete(RGBA_Font_Source *fs)
+{
+   int error;
+  
+   error = FT_New_Face(evas_ft_lib, fs-name, 0, (fs-ft.face));
+   if (error) return error;
+   
+   error = FT_Select_Charmap(fs-ft.face, ft_encoding_unicode);
+   if (error) return error;
+   
+   fs-ft.orig_upem = fs-ft.face-units_per_EM;
+   return error;
+}
+
 RGBA_Font_Source *
 evas_common_font_source_find(const char *name)
 {
@@ -127,7 +139,8 @@
if (!fi) return NULL;
 
fi-src = evas_common_font_source_find(name);
-   if (!fi-src) fi-src = evas_common_font_source_memory_load(name, data, 
data_size);
+   if (!fi-src) 
+ fi-src = evas_common_font_source_memory_load(name, data, data_size);
 
if (!fi-src)
  {
@@ -148,6 +161,8 @@
fi = evas_common_font_int_find(name, size);
if (fi) return fi;
 
+   if (!evas_file_path_is_file(name)) return NULL;
+   
fi = calloc(1, sizeof(RGBA_Font_Int));
if (!fi) return NULL;
 
@@ -169,6 +184,16 @@
 RGBA_Font_Int *
 evas_common_font_int_load_init(RGBA_Font_Int *fi)
 {
+   fi-glyphs = NULL;
+   fi-usage = 0;
+   fi-references = 1;
+   fonts = evas_object_list_prepend(fonts, fi);
+   return fi;
+}
+
+RGBA_Font_Int *
+evas_common_font_int_load_complete(RGBA_Font_Int *fi)
+{
int error;
 
error = FT_New_Size(fi-src-ft.face, (fi-ft.size));
@@ -214,14 +239,9 @@
  }
  }
fi-src-current_size = fi-size;
-
-   fi-glyphs = NULL;
-   fi-usage = 0;
-   fi-references = 1;
-   fonts = evas_object_list_prepend(fonts, fi);
+   
return fi;
 }
-
 RGBA_Font *
 evas_common_font_memory_load(const char *name, int size, const void *data, int 
data_size)
 {
@@ -250,6 +270,22 @@
 
fi = evas_common_font_int_load(name, size);
if (!fi) return NULL;
+   /* First font, complete load */ 
+   if (!fi-ft.size)
+ {
+   if (!fi-src-ft.face)
+ {
+if (evas_common_font_source_load_complete(fi-src))
+  {
+ fonts = evas_object_list_remove(fonts, fi);
+ evas_common_font_source_free(fi-src);
+ free(fi);
+ return NULL;
+  }
+ }
+   evas_common_font_int_load_complete(fi);
+ }
+   
fn = calloc(1, sizeof(RGBA_Font));
if (!fn)
  {
@@ -259,6 +295,7 @@
fn-fonts = evas_list_append(fn-fonts, fi);
fn-hinting = FONT_BYTECODE_HINT;
fi-hinting = fn-hinting;
+
return fn;
 }
 




---
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=lnkkid=110944bid=241720dat=121642
___
enlightenment-cvs 

E CVS: libs/evas shorne

2006-04-08 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : shorne
Project : e17
Module  : libs/evas

Dir : e17/libs/evas/src/lib/engines/common


Modified Files:
evas_font_load.c 


Log Message:
Make sure to finish initializing sourced fonts

===
RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common/evas_font_load.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- evas_font_load.c9 Apr 2006 00:02:47 -   1.33
+++ evas_font_load.c9 Apr 2006 02:36:03 -   1.34
@@ -1,4 +1,5 @@
 #include evas_common.h
+#include evas_private.h
 
 extern FT_Library evas_ft_lib;
 
@@ -40,7 +41,6 @@
 RGBA_Font_Source *
 evas_common_font_source_load(const char *name)
 {
-   int error;
RGBA_Font_Source *fs;
 
fs = calloc(1, sizeof(RGBA_Font_Source));
@@ -150,7 +150,10 @@
 
fi-size = size;
 
-   return evas_common_font_int_load_init(fi);
+   fi = evas_common_font_int_load_init(fi);
+   evas_common_font_int_load_complete(fi);
+
+   return fi;
 }
 
 RGBA_Font_Int *
@@ -160,14 +163,12 @@
 
fi = evas_common_font_int_find(name, size);
if (fi) return fi;
-
-   if (!evas_file_path_is_file(name)) return NULL;

fi = calloc(1, sizeof(RGBA_Font_Int));
if (!fi) return NULL;
 
fi-src = evas_common_font_source_find(name);
-   if (!fi-src)
+   if (!fi-src  evas_file_path_is_file(name))
  fi-src = evas_common_font_source_load(name);
 
if (!fi-src)
@@ -184,6 +185,7 @@
 RGBA_Font_Int *
 evas_common_font_int_load_init(RGBA_Font_Int *fi)
 {
+   fi-ft.size = NULL;
fi-glyphs = NULL;
fi-usage = 0;
fi-references = 1;




---
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=lnkkid=110944bid=241720dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: libs/evas shorne

2006-04-08 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : shorne
Project : e17
Module  : libs/evas

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


Modified Files:
evas_font_dir.c 


Log Message:
Revert to old fontconfig searching

===
RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_font_dir.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- evas_font_dir.c 5 Apr 2006 23:23:16 -   1.19
+++ evas_font_dir.c 9 Apr 2006 02:42:21 -   1.20
@@ -312,19 +312,31 @@
if (!font) /* Search using fontconfig */
  {   
FcPattern *p_nm = NULL;
-   FcChar8 *s;
+   FcFontSet *set;
FcResult res;
-   
+   int i;
+
p_nm = FcNameParse(name);
FcConfigSubstitute(NULL, p_nm, FcMatchPattern);
FcDefaultSubstitute(p_nm);
-   
+
/* do matching */
-   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);
+   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); 
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=lnkkid=110944bid=241720dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs


E CVS: libs/evas shorne

2006-03-28 Thread Enlightenment CVS
Enlightenment CVS committal

Author  : shorne
Project : e17
Module  : libs/evas

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


Modified Files:
evas_font_dir.c 


Log Message:
Refuse zero length fonts.

===
RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_font_dir.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- evas_font_dir.c 19 Mar 2006 11:17:43 -  1.17
+++ evas_font_dir.c 28 Mar 2006 16:28:54 -  1.18
@@ -139,6 +139,7 @@
Fndat *fd;
 
if (!name) return NULL;
+   if (name[0] == 0) return NULL;

for (l = fonts_cache; l; l = l-next)
  {




---
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=lnkkid=110944bid=241720dat=121642
___
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs