No need for path in font_directory, and use the right key to store/find them
authorsachiel <sachiel@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 11 Aug 2010 14:24:03 +0000 (14:24 +0000)
committersachiel <sachiel@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 11 Aug 2010 14:24:03 +0000 (14:24 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@50999 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/edje_convert.c
src/lib/edje_calc.c
src/lib/edje_edit.c
src/lib/edje_private.h
src/lib/edje_text.c

index c3a25da..459c1f1 100644 (file)
@@ -141,21 +141,7 @@ _edje_file_convert(Eet_File *ef, Old_Edje_File *oedf)
 
    if (oedf->font_dir)
      EINA_LIST_FOREACH(oedf->font_dir->entries, l, fnt)
-       {
-         char *tmp;
-         int length;
-
-         length = strlen(fnt->entry) + 7;
-         tmp = alloca(length);
-
-         snprintf(tmp, length, "fonts/%s", fnt->entry);
-         fnt->path = eina_stringshare_add(tmp);
-         if (edf->free_strings)
-           eina_stringshare_del(fnt->entry);
-         fnt->entry = fnt->path + 6;
-
-         eina_hash_direct_add(edf->fonts, fnt->entry, fnt);
-       }
+        eina_hash_direct_add(edf->fonts, fnt->entry, fnt);
 
    if (!_edje_file_convert_images(edf, oedf))
      goto on_error;
index c559787..fb94962 100644 (file)
@@ -856,7 +856,9 @@ _edje_part_recalc_single_text(FLOAT_T sc,
 
             if (fnt)
               {
-                 font = fnt->path;
+                  int len = strlen(fnt->entry) + sizeof("edje/fonts/") + 1;
+                  font = alloca(len);
+                  sprintf((char *)font, "edje/fonts/%s", fnt->entry);
                  inlined_font = 1;
               }
          }
index 999e94c..68d317e 100644 (file)
@@ -3922,7 +3922,7 @@ edje_edit_font_add(Evas_Object *obj, const char* path, const char* alias)
        if ((alias = strrchr(path, '/'))) alias ++;
        else alias = (char *)path;
      }
-   snprintf(entry, sizeof(entry), "fonts/%s", alias);
+   snprintf(entry, sizeof(entry), "edje/fonts/%s", alias);
 
    /* Check if exists */
    fnt = eina_hash_find(ed->file->fonts, alias);
@@ -3937,7 +3937,6 @@ edje_edit_font_add(Evas_Object *obj, const char* path, const char* alias)
        return EINA_FALSE;
      }
    fnt->entry = eina_stringshare_add(alias);
-   fnt->path = eina_stringshare_add(entry);
 
    eina_hash_direct_add(ed->file->fonts, fnt->entry, fnt);
 
index 4f72754..225924d 100644 (file)
@@ -374,7 +374,6 @@ struct _Edje_Style_Tag
 struct _Edje_Font_Directory_Entry
 {
    const char *entry; /* the name of the font */
-   const char *path;
    const char *file; /* the name of the file */
 };
 
index f45436c..c662871 100644 (file)
@@ -344,7 +344,9 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
 
        if (fnt)
          {
-            font = fnt->path;
+             int len = strlen(fnt->entry) + sizeof("edje/fonts/") + 1;
+             font = alloca(len);
+             sprintf((char *)font, "edje/fonts/%s", fnt->entry);
             inlined_font = 1;
          }
      }