Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/evas

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


Modified Files:
        evas_font_draw.c evas_font_load.c evas_font_main.c 
        evas_font_query.c 


Log Message:


werd to my homies... this had to happen sooner or later.... evas supports
FONTSETS!

so u can do
Vera,Kochi,Blah ... etc.
as the font name
it will fall back font by font until it finds a char or finally fails.

this is for internationalisation support...

WHERD!

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_font_draw.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- evas_font_draw.c    23 Jan 2004 11:02:16 -0000      1.10
+++ evas_font_draw.c    20 Mar 2005 15:57:55 -0000      1.11
@@ -1,7 +1,7 @@
 #include "evas_common.h"
 
 RGBA_Font_Glyph *
-evas_common_font_cache_glyph_get(RGBA_Font *fn, FT_UInt index)
+evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt index)
 {
    RGBA_Font_Glyph *fg;
    char key[6];   
@@ -14,17 +14,17 @@
    key[4] = ((index >> 28 ) & 0x0f) + 1;
    key[5] = 0;
 
-   fg = evas_hash_find(fn->glyphs, key);
+   fg = evas_hash_find(fi->glyphs, key);
    if (fg) return fg;
    
-   error = FT_Load_Glyph(fn->src->ft.face, index, FT_LOAD_NO_BITMAP);
+   error = FT_Load_Glyph(fi->src->ft.face, index, FT_LOAD_NO_BITMAP);
    if (error) return NULL;
    
    fg = malloc(sizeof(struct _RGBA_Font_Glyph));
    if (!fg) return NULL;
    memset(fg, 0, (sizeof(struct _RGBA_Font_Glyph)));
    
-   error = FT_Get_Glyph(fn->src->ft.face->glyph, &(fg->glyph));
+   error = FT_Get_Glyph(fi->src->ft.face->glyph, &(fg->glyph));
    if (error) 
      {
        free(fg);
@@ -42,10 +42,31 @@
      }
    fg->glyph_out = (FT_BitmapGlyph)fg->glyph;
    
-   fn->glyphs = evas_hash_add(fn->glyphs, key, fg);
+   fi->glyphs = evas_hash_add(fi->glyphs, key, fg);
    return fg;
 }
 
+int
+evas_common_font_glyph_search(RGBA_Font *fn, RGBA_Font_Int **fi_ret, int gl)
+{
+   Evas_List *l;
+   
+   for (l = fn->fonts; l; l = l->next)
+     {
+       RGBA_Font_Int *fi;
+       int index;
+       
+       fi = l->data;
+        index = FT_Get_Char_Index(fi->src->ft.face, gl);
+       if (index != 0)
+         {
+            *fi_ret = fi;
+            return index;
+         }
+     }
+   return 0;
+}
+
 void
 evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, 
int x, int y, const char *text)
 {
@@ -58,6 +79,9 @@
    DATA32 *im;
    int im_w, im_h;
    int c;
+   RGBA_Font_Int *fi;
+
+   fi = fn->fonts->data;
    
    im = dst->image->data;
    im_w = dst->image->w;
@@ -91,7 +115,7 @@
    pen_x = x << 8;
    pen_y = y << 8;
    evas_common_font_size_use(fn);
-   use_kerning = FT_HAS_KERNING(fn->src->ft.face);
+   use_kerning = FT_HAS_KERNING(fi->src->ft.face);
    prev_index = 0;
    func = evas_common_draw_func_blend_alpha_get(dst);
    for (c = 0, chr = 0; text[chr];)
@@ -103,7 +127,7 @@
        
        gl = evas_common_font_utf8_get_next((unsigned char *)text, &chr);
        if (gl == 0) break;
-       index = FT_Get_Char_Index(fn->src->ft.face, gl);
+       index = evas_common_font_glyph_search(fn, &fi, gl);
        /* hmmm kerning means i can't sanely do my own cached metric tables! */
        /* grrr - this means font face sharing is kinda... not an option if */
        /* you want performance */
@@ -111,11 +135,11 @@
          {
             FT_Vector delta;
             
-            FT_Get_Kerning(fn->src->ft.face, prev_index, index,
+            FT_Get_Kerning(fi->src->ft.face, prev_index, index,
                            ft_kerning_default, &delta);
             pen_x += delta.x << 2;
          }
-       fg = evas_common_font_cache_glyph_get(fn, index);
+       fg = evas_common_font_int_cache_glyph_get(fi, index);
        if (!fg) continue;
        
        if ((dc->font_ext.func.gl_new) && (!fg->ext_dat))
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_font_load.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- evas_font_load.c    31 Jan 2005 09:32:31 -0000      1.15
+++ evas_font_load.c    20 Mar 2005 15:57:55 -0000      1.16
@@ -168,83 +168,91 @@
 void
 evas_common_font_size_use(RGBA_Font *fn)
 {
-   if (fn->src->current_size == fn->size) return;
-   FT_Activate_Size(fn->ft.size);
-   fn->src->current_size = fn->size;
+   Evas_List *l;
+   
+   for (l = fn->fonts; l; l = l->next)
+     {
+       RGBA_Font_Int *fi;
+       
+       fi = l->data;
+       if (fi->src->current_size == fi->size) return;
+       FT_Activate_Size(fi->ft.size);
+       fi->src->current_size = fi->size;
+     }
 }
 
-RGBA_Font *
-evas_common_font_memory_load(const char *name, int size, const void *data, int 
data_size)
+RGBA_Font_Int *
+evas_common_font_int_memory_load(const char *name, int size, const void *data, 
int data_size)
 {
-   RGBA_Font *fn;
+   RGBA_Font_Int *fi;
 
-   fn = evas_common_font_find(name, size);
-   if (fn) return fn;
+   fi = evas_common_font_int_find(name, size);
+   if (fi) return fi;
    
-   fn = calloc(1, sizeof(RGBA_Font));   
-   if (!fn) return NULL;
+   fi = calloc(1, sizeof(RGBA_Font_Int));   
+   if (!fi) return NULL;
    
-   fn->src = evas_common_font_source_find(name);
-   if (!fn->src) fn->src = evas_common_font_source_memory_load(name, data, 
data_size);
+   fi->src = evas_common_font_source_find(name);
+   if (!fi->src) fi->src = evas_common_font_source_memory_load(name, data, 
data_size);
 
-   if (!fn->src)
+   if (!fi->src)
      {
-       free(fn);
+       free(fi);
        return NULL;
      }
    
-   fn->size = size;
+   fi->size = size;
 
-   return evas_common_font_load_init(fn);
+   return evas_common_font_int_load_init(fi);
 }
 
-RGBA_Font *
-evas_common_font_load(const char *name, int size)
+RGBA_Font_Int *
+evas_common_font_int_load(const char *name, int size)
 {
-   RGBA_Font *fn;
+   RGBA_Font_Int *fi;
 
-   fn = evas_common_font_find(name, size);
-   if (fn) return fn;
+   fi = evas_common_font_int_find(name, size);
+   if (fi) return fi;
    
-   fn = calloc(1, sizeof(RGBA_Font));   
-   if (!fn) return NULL;
+   fi = calloc(1, sizeof(RGBA_Font_Int));   
+   if (!fi) return NULL;
 
-   fn->src = evas_common_font_source_find(name);
-   if (!fn->src)
+   fi->src = evas_common_font_source_find(name);
+   if (!fi->src)
      {
 /*     printf("REAL LOAD FILE %s %i\n", name, size);*/
-       fn->src = evas_common_font_source_load(name);
+       fi->src = evas_common_font_source_load(name);
      }
 /*   else*/
 /*     printf("REAL LOAD SIZE %s %i\n", name, size);*/
 
-   if (!fn->src)
+   if (!fi->src)
      {
-       free(fn);
+       free(fi);
        return NULL;
      }
    
-   fn->size = size;
+   fi->size = size;
 
-   return evas_common_font_load_init(fn);
+   return evas_common_font_int_load_init(fi);
 }
 
-RGBA_Font *
-evas_common_font_load_init(RGBA_Font *fn)
+RGBA_Font_Int *
+evas_common_font_int_load_init(RGBA_Font_Int *fi)
 {
    int error;
    
-   error = FT_New_Size(fn->src->ft.face, &(fn->ft.size));
+   error = FT_New_Size(fi->src->ft.face, &(fi->ft.size));
    if (!error)
      {
-       FT_Activate_Size(fn->ft.size);
+       FT_Activate_Size(fi->ft.size);
      }
-   fn->real_size = fn->size * 64;
-   error = FT_Set_Char_Size(fn->src->ft.face, 0, fn->real_size, 75, 75);
+   fi->real_size = fi->size * 64;
+   error = FT_Set_Char_Size(fi->src->ft.face, 0, fi->real_size, 75, 75);
    if (error)
      {
-       fn->real_size = fn->size;
-       error = FT_Set_Pixel_Sizes(fn->src->ft.face, 0, fn->real_size);
+       fi->real_size = fi->size;
+       error = FT_Set_Pixel_Sizes(fi->src->ft.face, 0, fi->real_size);
      }
    if (error)
      {
@@ -252,48 +260,114 @@
        int chosen_size = 0;
        int chosen_width = 0;
 
-       for (i = 0; i < fn->src->ft.face->num_fixed_sizes; i++)
+       for (i = 0; i < fi->src->ft.face->num_fixed_sizes; i++)
          {
             int s;
             int d, cd;
             
-            s = fn->src->ft.face->available_sizes[i].height;
-            cd = chosen_size - fn->size;
+            s = fi->src->ft.face->available_sizes[i].height;
+            cd = chosen_size - fi->size;
             if (cd < 0) cd = -cd;
-            d = s - fn->size;
+            d = s - fi->size;
             if (d < 0) d = -d;
             if (d < cd)
               {
-                 chosen_width = fn->src->ft.face->available_sizes[i].width;
+                 chosen_width = fi->src->ft.face->available_sizes[i].width;
                  chosen_size = s;
               }
             if (d == 0) break;
          }
-       fn->real_size = chosen_size;
-       error = FT_Set_Pixel_Sizes(fn->src->ft.face, chosen_width, 
fn->real_size);
+       fi->real_size = chosen_size;
+       error = FT_Set_Pixel_Sizes(fi->src->ft.face, chosen_width, 
fi->real_size);
        if (error)
          {
             /* couldn't choose the size anyway... what now? */
          }
      }
-   fn->src->current_size = fn->size;
+   fi->src->current_size = fi->size;
 
-   fn->glyphs = NULL;
-   fn->usage = 0;
-   fn->references = 1;
-   fonts = evas_object_list_prepend(fonts, fn);
+   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)
+{
+   RGBA_Font *fn;
+   RGBA_Font_Int *fi;
+   
+   fi = evas_common_font_int_memory_load(name, size, data, data_size);
+   if (!fi) return NULL;
+   fn = calloc(1, sizeof(RGBA_Font));
+   if (!fn) return NULL;
+   fn->fonts = evas_list_append(fn->fonts, fi);
    return fn;
 }
 
+RGBA_Font *
+evas_common_font_load(const char *name, int size)
+{
+   RGBA_Font *fn;
+   RGBA_Font_Int *fi;
+   
+   fi = evas_common_font_int_load(name, size);
+   if (!fi) return NULL;
+   fn = calloc(1, sizeof(RGBA_Font));
+   if (!fn) return NULL;
+   fn->fonts = evas_list_append(fn->fonts, fi);
+   return fn;
+}
+
+int
+evas_common_font_add(RGBA_Font *fn, const char *name, int size)
+{
+   RGBA_Font_Int *fi;
+   
+   fi = evas_common_font_int_load(name, size);
+   if (fi)
+     {
+       fn->fonts = evas_list_append(fn->fonts, fi);
+       return 1;
+     }
+   return 0;
+}
+
+int
+evas_common_font_memory_add(RGBA_Font *fn, const char *name, int size, const 
void *data, int data_size)
+{
+   RGBA_Font_Int *fi;
+   
+   fi = evas_common_font_int_memory_load(name, size, data, data_size);
+   if (fi)
+     {
+       fn->fonts = evas_list_append(fn->fonts, fi);
+       return 1;
+     }
+   return 0;
+}
+
 void
 evas_common_font_free(RGBA_Font *fn)
 {
-   fn->references--;
-   if (fn->references == 0)
+   Evas_List *l;
+   
+   for (l = fn->fonts; l; l = l->next)
      {
-       evas_common_font_modify_cache_by(fn, 1);
-       evas_common_font_flush();
+       RGBA_Font_Int *fi;
+       
+       fi = l->data;
+       fi->references--;
+       if (fi->references == 0)
+         {
+            evas_common_font_int_modify_cache_by(fi, 1);
+            evas_common_font_flush();
+         }
      }
+   evas_list_free(fn->fonts);
+   free(fn);
 }
 
 static int
@@ -313,12 +387,12 @@
 }
 
 void
-evas_common_font_modify_cache_by(RGBA_Font *fn, int dir)
+evas_common_font_int_modify_cache_by(RGBA_Font_Int *fi, int dir)
 {
    int sz_hash = 0;
    
-   if (fn->glyphs) sz_hash = sizeof(Evas_Hash);
-   evas_hash_foreach(fn->glyphs, font_modify_cache_cb, &dir);
+   if (fi->glyphs) sz_hash = sizeof(Evas_Hash);
+   evas_hash_foreach(fi->glyphs, font_modify_cache_cb, &dir);
    font_cache_usage += dir * (sizeof(RGBA_Font) + sz_hash +
                              sizeof(FT_FaceRec) + 16384); /* fudge values */
 }
@@ -363,49 +437,49 @@
 evas_common_font_flush_last(void)
 {
    Evas_Object_List *l;
-   RGBA_Font *fn = NULL;
+   RGBA_Font_Int *fi = NULL;
    
    for (l = fonts; l; l = l->next)
      {
-       RGBA_Font *fn_tmp;
+       RGBA_Font_Int *fi_tmp;
        
-       fn_tmp = (RGBA_Font *)l;
-       if (fn_tmp->references == 0) fn = fn_tmp;
+       fi_tmp = (RGBA_Font_Int *)l;
+       if (fi_tmp->references == 0) fi = fi_tmp;
      }
-   if (!fn) return;
+   if (!fi) return;
    
-   FT_Done_Size(fn->ft.size);
+   FT_Done_Size(fi->ft.size);
    
-   fonts = evas_object_list_remove(fonts, fn);
-   evas_common_font_modify_cache_by(fn, -1);
+   fonts = evas_object_list_remove(fonts, fi);
+   evas_common_font_int_modify_cache_by(fi, -1);
 
-   evas_hash_foreach(fn->glyphs, font_flush_free_glyph_cb, NULL);
-   evas_hash_free(fn->glyphs);
+   evas_hash_foreach(fi->glyphs, font_flush_free_glyph_cb, NULL);
+   evas_hash_free(fi->glyphs);
    
-   evas_common_font_source_free(fn->src);
+   evas_common_font_source_free(fi->src);
    
-   free(fn);
+   free(fi);
 }
 
-RGBA_Font *
-evas_common_font_find(const char *name, int size)
+RGBA_Font_Int *
+evas_common_font_int_find(const char *name, int size)
 {
    Evas_Object_List *l;
    
 //   printf("SEARCH!\n");
    for (l = fonts; l; l = l->next)
      {
-       RGBA_Font *fn;
+       RGBA_Font_Int *fi;
        
-       fn = (RGBA_Font *)l;
-//     printf("%s == %s, %i == %i\n", name, fn->src->name, size, fn->size);
-       if ((fn->size == size) && (!strcmp(name, fn->src->name)))
+       fi = (RGBA_Font_Int *)l;
+//     printf("%s == %s, %i == %i\n", name, fi->src->name, size, fi->size);
+       if ((fi->size == size) && (!strcmp(name, fi->src->name)))
          {
-            if (fn->references == 0) evas_common_font_modify_cache_by(fn, -1);
-            fn->references++;
-            fonts = evas_object_list_remove(fonts, fn);
-            fonts = evas_object_list_prepend(fonts, fn);
-            return fn;
+            if (fi->references == 0) evas_common_font_int_modify_cache_by(fi, 
-1);
+            fi->references++;
+            fonts = evas_object_list_remove(fonts, fi);
+            fonts = evas_object_list_prepend(fonts, fi);
+            return fi;
          }
      }
    return NULL;
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_font_main.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- evas_font_main.c    23 Feb 2005 20:32:07 -0000      1.19
+++ evas_font_main.c    20 Mar 2005 15:57:55 -0000      1.20
@@ -33,11 +33,13 @@
 {
    int val, dv;
    int ret;
+   RGBA_Font_Int *fi;
    
    evas_common_font_size_use(fn);
-   val = (int)fn->src->ft.face->size->metrics.ascender;
-   dv = (fn->src->ft.orig_upem * 2048) / fn->src->ft.face->units_per_EM; 
-   ret = (val * fn->src->ft.face->size->metrics.y_scale) / (dv * dv);
+   fi = fn->fonts->data;
+   val = (int)fi->src->ft.face->size->metrics.ascender;
+   dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; 
+   ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
    return ret;
 }
 
@@ -46,11 +48,13 @@
 {
    int val, dv;
    int ret;
+   RGBA_Font_Int *fi;
    
    evas_common_font_size_use(fn);
-   val = -(int)fn->src->ft.face->size->metrics.descender;
-   dv = (fn->src->ft.orig_upem * 2048) / fn->src->ft.face->units_per_EM; 
-   ret = (val * fn->src->ft.face->size->metrics.y_scale) / (dv * dv);
+   fi = fn->fonts->data;
+   val = -(int)fi->src->ft.face->size->metrics.descender;
+   dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; 
+   ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
    return ret;
 }
 
@@ -59,11 +63,13 @@
 {
    int val, dv;
    int ret;
+   RGBA_Font_Int *fi;
    
    evas_common_font_size_use(fn);
-   val = (int)fn->src->ft.face->bbox.yMax;
-   dv = (fn->src->ft.orig_upem * 2048) / fn->src->ft.face->units_per_EM; 
-   ret = (val * fn->src->ft.face->size->metrics.y_scale) / (dv * dv);
+   fi = fn->fonts->data;
+   val = (int)fi->src->ft.face->bbox.yMax;
+   dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM; 
+   ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
    return ret;
 }
 
@@ -72,11 +78,13 @@
 {
    int val, dv;
    int ret;
+   RGBA_Font_Int *fi;
    
    evas_common_font_size_use(fn);
-   val = -(int)fn->src->ft.face->bbox.yMin;
-   dv = (fn->src->ft.orig_upem * 2048) / fn->src->ft.face->units_per_EM;   
-   ret = (val * fn->src->ft.face->size->metrics.y_scale) / (dv * dv);
+   fi = fn->fonts->data;
+   val = -(int)fi->src->ft.face->bbox.yMin;
+   dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;   
+   ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
    return ret;
 }
 
@@ -85,11 +93,13 @@
 {
    int val, dv;
    int ret;
+   RGBA_Font_Int *fi;
    
    evas_common_font_size_use(fn);
-   val = (int)fn->src->ft.face->size->metrics.height;
-   dv = (fn->src->ft.orig_upem * 2048) / fn->src->ft.face->units_per_EM;   
-   ret = (val * fn->src->ft.face->size->metrics.y_scale) / (dv * dv);
+   fi = fn->fonts->data;
+   val = (int)fi->src->ft.face->size->metrics.height;
+   dv = (fi->src->ft.orig_upem * 2048) / fi->src->ft.face->units_per_EM;   
+   ret = (val * fi->src->ft.face->size->metrics.y_scale) / (dv * dv);
    return ret;
 }
 
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_font_query.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- evas_font_query.c   9 Feb 2005 16:10:56 -0000       1.14
+++ evas_font_query.c   20 Mar 2005 15:57:55 -0000      1.15
@@ -9,13 +9,16 @@
    int start_x, end_x;
    int chr;
    FT_UInt prev_index;
-
+   RGBA_Font_Int *fi;
+   
+   fi = fn->fonts->data;
+   
    start_x = 0;
    end_x = 0;
    pen_x = 0;
    pen_y = 0;
    evas_common_font_size_use(fn);
-   use_kerning = FT_HAS_KERNING(fn->src->ft.face);
+   use_kerning = FT_HAS_KERNING(fi->src->ft.face);
    prev_index = 0;
    for (chr = 0; text[chr];)
      {
@@ -26,16 +29,16 @@
        
        gl = evas_common_font_utf8_get_next((unsigned char *)text, &chr);
        if (gl == 0) break;
-       index = FT_Get_Char_Index(fn->src->ft.face, gl);
+       index = evas_common_font_glyph_search(fn, &fi, gl);
        if ((use_kerning) && (prev_index) && (index))
          {
             FT_Vector delta;
             
-            FT_Get_Kerning(fn->src->ft.face, prev_index, index,
+            FT_Get_Kerning(fi->src->ft.face, prev_index, index,
                            ft_kerning_default, &delta);
             pen_x += delta.x << 2;
          }
-       fg = evas_common_font_cache_glyph_get(fn, index);
+       fg = evas_common_font_int_cache_glyph_get(fi, index);
        if (!fg) continue;
 
        chr_x = (pen_x >> 8) + fg->glyph_out->left;
@@ -60,14 +63,17 @@
    RGBA_Font_Glyph *fg;
    int chr;
    int gl;
+   RGBA_Font_Int *fi;
+   
+   fi = fn->fonts->data;
    
    chr = 0;
    if (!text[0]) return 0;
    gl = evas_common_font_utf8_get_next((unsigned char *)text, &chr);   
    if (gl == 0) return 0;
    evas_common_font_size_use(fn);
-   index = FT_Get_Char_Index(fn->src->ft.face, gl);
-   fg = evas_common_font_cache_glyph_get(fn, index);
+   index = evas_common_font_glyph_search(fn, &fi, gl);
+   fg = evas_common_font_int_cache_glyph_get(fi, index);
    if (!fg) return 0;
    return fg->glyph_out->left;
 }
@@ -81,12 +87,15 @@
    int start_x;
    int chr;
    FT_UInt prev_index;
+   RGBA_Font_Int *fi;
+   
+   fi = fn->fonts->data;
    
    start_x = 0;
    pen_x = 0;
    pen_y = 0;
    evas_common_font_size_use(fn);
-   use_kerning = FT_HAS_KERNING(fn->src->ft.face);
+   use_kerning = FT_HAS_KERNING(fi->src->ft.face);
    prev_index = 0;
    for (chr = 0; text[chr];)     
      {
@@ -97,16 +106,16 @@
        
        gl = evas_common_font_utf8_get_next((unsigned char *)text, &chr);
        if (gl == 0) break;
-       index = FT_Get_Char_Index(fn->src->ft.face, gl);
+       index = evas_common_font_glyph_search(fn, &fi, gl);
        if ((use_kerning) && (prev_index) && (index))
          {
             FT_Vector delta;
             
-            FT_Get_Kerning(fn->src->ft.face, prev_index, index,
+            FT_Get_Kerning(fi->src->ft.face, prev_index, index,
                            ft_kerning_default, &delta);
             pen_x += delta.x << 2;
          }
-       fg = evas_common_font_cache_glyph_get(fn, index);
+       fg = evas_common_font_int_cache_glyph_get(fi, index);
        if (!fg) continue;
        
        chr_x = (pen_x >> 8) + fg->glyph_out->left;
@@ -130,11 +139,14 @@
    int chr;
    int asc, desc;
    FT_UInt prev_index;
+   RGBA_Font_Int *fi;
+   
+   fi = fn->fonts->data;
    
    pen_x = 0;
    pen_y = 0;
    evas_common_font_size_use(fn);
-   use_kerning = FT_HAS_KERNING(fn->src->ft.face);
+   use_kerning = FT_HAS_KERNING(fi->src->ft.face);
    prev_index = 0;
    prev_chr_end = 0;
    asc = evas_common_font_max_ascent_get(fn);
@@ -151,16 +163,16 @@
        pchr = chr;
        gl = evas_common_font_utf8_get_next((unsigned char *)text, &chr);
        if (gl == 0) break;
-       index = FT_Get_Char_Index(fn->src->ft.face, gl);
+       index = evas_common_font_glyph_search(fn, &fi, gl);
        kern = 0;
        if ((use_kerning) && (prev_index) && (index))
          {
-            FT_Get_Kerning(fn->src->ft.face, prev_index, index,
+            FT_Get_Kerning(fi->src->ft.face, prev_index, index,
                            ft_kerning_default, &delta);
             kern = delta.x << 2;
             pen_x += kern;
          }
-       fg = evas_common_font_cache_glyph_get(fn, index);
+       fg = evas_common_font_int_cache_glyph_get(fi, index);
        if (!fg) continue;
        
        if (kern < 0) kern = 0; 
@@ -204,11 +216,14 @@
    int chr;
    int asc, desc;
    FT_UInt prev_index;
+   RGBA_Font_Int *fi;
+   
+   fi = fn->fonts->data;
    
    pen_x = 0;
    pen_y = 0;
    evas_common_font_size_use(fn);
-   use_kerning = FT_HAS_KERNING(fn->src->ft.face);
+   use_kerning = FT_HAS_KERNING(fi->src->ft.face);
    prev_index = 0;
    prev_chr_end = 0;
    asc = evas_common_font_max_ascent_get(fn);
@@ -225,16 +240,16 @@
        pchr = chr;
        gl = evas_common_font_utf8_get_next((unsigned char *)text, &chr);
        if (gl == 0) break;
-       index = FT_Get_Char_Index(fn->src->ft.face, gl);
+       index = evas_common_font_glyph_search(fn, &fi, gl);
        kern = 0;
        if ((use_kerning) && (prev_index) && (index))
          {
-            FT_Get_Kerning(fn->src->ft.face, prev_index, index,
+            FT_Get_Kerning(fi->src->ft.face, prev_index, index,
                            ft_kerning_default, &delta);
             kern = delta.x << 2;
             pen_x += kern;
          }
-       fg = evas_common_font_cache_glyph_get(fn, index);
+       fg = evas_common_font_int_cache_glyph_get(fi, index);
        if (!fg) continue;
        
        if (kern < 0) kern = 0; 




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to