forked from enlightenment/efl
parent
d8988d3200
commit
2bc0592a68
|
@ -64,24 +64,28 @@ _edje_file_coll_open(Edje_File *edf, Eet_File *ef, const char *coll)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_edje_font_hash (Edje_File *edf)
|
_edje_font_hash(Edje_File *edf)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
if (edf->font_dir)
|
if (edf->font_dir)
|
||||||
{
|
{
|
||||||
Evas_List *l;
|
Evas_List *l;
|
||||||
for (l = edf->font_dir->entries; l; l = evas_list_next (l))
|
for (l = edf->font_dir->entries; l; l = evas_list_next(l))
|
||||||
{
|
{
|
||||||
Edje_Font_Directory_Entry *fnt = l->data;
|
Edje_Font_Directory_Entry *fnt;
|
||||||
int length = strlen (fnt->entry) + 7;
|
int length;
|
||||||
char *tmp = alloca (length);
|
char *tmp;
|
||||||
|
|
||||||
snprintf (tmp, length, "fonts/%s", fnt->entry);
|
fnt = l->data;
|
||||||
fnt->path = evas_stringshare_add (tmp);
|
length = strlen(fnt->entry) + 7;
|
||||||
evas_stringshare_del (fnt->entry);
|
tmp = alloca(length);
|
||||||
|
|
||||||
|
snprintf(tmp, length, "fonts/%s", fnt->entry);
|
||||||
|
fnt->path = evas_stringshare_add(tmp);
|
||||||
|
evas_stringshare_del(fnt->entry);
|
||||||
fnt->entry = fnt->path + 6;
|
fnt->entry = fnt->path + 6;
|
||||||
edf->font_hash = evas_hash_direct_add (edf->font_hash, fnt->entry, fnt);
|
edf->font_hash = evas_hash_direct_add(edf->font_hash, fnt->entry, fnt);
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
@ -150,7 +154,7 @@ _edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Co
|
||||||
|
|
||||||
edf->font_hash = NULL;
|
edf->font_hash = NULL;
|
||||||
|
|
||||||
_edje_font_hash (edf);
|
_edje_font_hash(edf);
|
||||||
|
|
||||||
eet_close(ef);
|
eet_close(ef);
|
||||||
|
|
||||||
|
|
|
@ -682,9 +682,11 @@ _edje_part_recalc_single(Edje *ed,
|
||||||
if (!text) text = "";
|
if (!text) text = "";
|
||||||
|
|
||||||
/* check if the font is embedded in the .eet */
|
/* check if the font is embedded in the .eet */
|
||||||
if (ed->file->font_hash)
|
if (ed->file->font_hash)
|
||||||
{
|
{
|
||||||
Edje_Font_Directory_Entry *fnt = evas_hash_find (ed->file->font_hash, font);
|
Edje_Font_Directory_Entry *fnt;
|
||||||
|
|
||||||
|
fnt = evas_hash_find(ed->file->font_hash, font);
|
||||||
|
|
||||||
if (fnt)
|
if (fnt)
|
||||||
{
|
{
|
||||||
|
|
|
@ -353,7 +353,7 @@ _edje_embryo_fn_count(Embryo_Program *ep, Embryo_Cell *params)
|
||||||
|
|
||||||
CHKPARAM(1);
|
CHKPARAM(1);
|
||||||
|
|
||||||
return (Embryo_Cell) _edje_var_list_count_get(ed, (int) params[1]);
|
return (Embryo_Cell)_edje_var_list_count_get(ed, (int) params[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove(id, n) */
|
/* remove(id, n) */
|
||||||
|
|
|
@ -267,7 +267,7 @@ struct _Edje_Font_Directory
|
||||||
struct _Edje_Font_Directory_Entry
|
struct _Edje_Font_Directory_Entry
|
||||||
{
|
{
|
||||||
const char *entry; /* the name of the font */
|
const char *entry; /* the name of the font */
|
||||||
char *path;
|
const char *path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,34 +8,10 @@
|
||||||
static int
|
static int
|
||||||
_edje_font_is_embedded(Edje_File *edf, char *font)
|
_edje_font_is_embedded(Edje_File *edf, char *font)
|
||||||
{
|
{
|
||||||
Edje_Font_Directory_Entry *fnt = NULL;
|
|
||||||
|
|
||||||
if (!edf->font_dir) return 0;
|
if (!edf->font_dir) return 0;
|
||||||
/* fnt = evas_hash_find (edf->font_hash, font); */
|
return 1;
|
||||||
/* if (fnt) */
|
|
||||||
/* if (fnt->entry && (!strcmp(fnt->entry, font))) */
|
|
||||||
/* return 1; */
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
static char *
|
|
||||||
_edje_str_deescape(char *str)
|
|
||||||
{
|
|
||||||
char *s2, *s, *d;
|
|
||||||
|
|
||||||
s2 = malloc(strlen(str) + 1);
|
|
||||||
if (!s2) return NULL;
|
|
||||||
for (s = str, d = s2; *s != 0; s++, d++)
|
|
||||||
{
|
|
||||||
if ((*s == '\\') && (s[1] != 0)) s++;
|
|
||||||
*d = *s;
|
|
||||||
}
|
|
||||||
*d = 0;
|
|
||||||
return s2;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Put a \ before and Space( ), \ or ' in a string.
|
/* Put a \ before and Space( ), \ or ' in a string.
|
||||||
* A newly allocated string is returned.
|
* A newly allocated string is returned.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue