diff --git a/legacy/evas/src/lib/canvas/evas_font_dir.c b/legacy/evas/src/lib/canvas/evas_font_dir.c index 1ae6cc8a8e..499ee9bd74 100644 --- a/legacy/evas/src/lib/canvas/evas_font_dir.c +++ b/legacy/evas/src/lib/canvas/evas_font_dir.c @@ -88,7 +88,7 @@ evas_font_load(Evas *evas, char *name, char *source, int size) char *nm; nm = l->data; - if (l == fonts) + if ((l == fonts) || (!font)) { #ifdef BUILD_FONT_LOADER_EET if (source) @@ -148,7 +148,7 @@ evas_font_load(Evas *evas, char *name, char *source, int size) } else { - int ok = 0; + void *ok = NULL; #ifdef BUILD_FONT_LOADER_EET if (source) @@ -160,7 +160,7 @@ evas_font_load(Evas *evas, char *name, char *source, int size) if (fake_name) { /* FIXME: make an engine func */ - if (!evas_common_font_add(font, fake_name, size)) + if (!evas->engine.func->font_add(evas->engine.data.output, font, fake_name, size)) { /* read original!!! */ ef = eet_open(source, EET_FILE_MODE_READ); @@ -172,14 +172,14 @@ evas_font_load(Evas *evas, char *name, char *source, int size) fdata = eet_read(ef, nm, &fsize); if ((fdata) && (fsize > 0)) { - ok = evas_common_font_memory_add(font, fake_name, size, fdata, fsize); + ok = evas->engine.func->font_memory_add(evas->engine.data.output, font, fake_name, size, fdata, fsize); free(fdata); } eet_close(ef); } } else - ok = 1; + ok = (void *)1; free(fake_name); } } @@ -187,7 +187,7 @@ evas_font_load(Evas *evas, char *name, char *source, int size) { #endif if (evas_file_path_is_full_path((char *)nm)) - evas_common_font_add(font, (char *)nm, size); + evas->engine.func->font_add(evas->engine.data.output, font, (char *)nm, size); else { Evas_List *l; @@ -199,7 +199,7 @@ evas_font_load(Evas *evas, char *name, char *source, int size) f_file = evas_font_dir_cache_find(l->data, (char *)nm); if (f_file) { - if (evas_common_font_add(font, f_file, size)) + if (evas->engine.func->font_add(evas->engine.data.output, font, f_file, size)) break; } } diff --git a/legacy/evas/src/lib/engines/common/evas_font_load.c b/legacy/evas/src/lib/engines/common/evas_font_load.c index 72df0da0f1..1451dd7ce7 100644 --- a/legacy/evas/src/lib/engines/common/evas_font_load.c +++ b/legacy/evas/src/lib/engines/common/evas_font_load.c @@ -321,7 +321,7 @@ evas_common_font_load(const char *name, int size) return fn; } -int +RGBA_Font * evas_common_font_add(RGBA_Font *fn, const char *name, int size) { RGBA_Font_Int *fi; @@ -330,12 +330,12 @@ evas_common_font_add(RGBA_Font *fn, const char *name, int size) if (fi) { fn->fonts = evas_list_append(fn->fonts, fi); - return 1; + return fn; } - return 0; + return NULL; } -int +RGBA_Font * evas_common_font_memory_add(RGBA_Font *fn, const char *name, int size, const void *data, int data_size) { RGBA_Font_Int *fi; @@ -344,9 +344,9 @@ evas_common_font_memory_add(RGBA_Font *fn, const char *name, int size, const voi if (fi) { fn->fonts = evas_list_append(fn->fonts, fi); - return 1; + return fn; } - return 0; + return NULL; } void diff --git a/legacy/evas/src/lib/include/evas_common.h b/legacy/evas/src/lib/include/evas_common.h index e52ea1e9a1..3fa35cf584 100644 --- a/legacy/evas/src/lib/include/evas_common.h +++ b/legacy/evas/src/lib/include/evas_common.h @@ -888,8 +888,8 @@ void evas_common_font_source_free (RGBA_Font_Source *fs); void evas_common_font_size_use (RGBA_Font *fn); RGBA_Font *evas_common_font_memory_load (const char *name, int size, const void *data, int data_size); RGBA_Font *evas_common_font_load (const char *name, int size); -int evas_common_font_add (RGBA_Font *fn, const char *name, int size); -int evas_common_font_memory_add (RGBA_Font *fn, const char *name, int size, const void *data, int data_size); +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); void evas_common_font_free (RGBA_Font *fn); void evas_common_font_int_modify_cache_by(RGBA_Font_Int *fi, int dir); diff --git a/legacy/evas/src/lib/include/evas_private.h b/legacy/evas/src/lib/include/evas_private.h index 8af494a24a..6a9d4382e0 100644 --- a/legacy/evas/src/lib/include/evas_private.h +++ b/legacy/evas/src/lib/include/evas_private.h @@ -593,8 +593,8 @@ struct _Evas_Func void *(*font_load) (void *data, char *name, int size); void *(*font_memory_load) (void *data, char *name, int size, const void *fdata, int fdata_size); - void *(*font_add) (void *data, char *name, int size); - void *(*font_memory_add) (void *data, char *name, int size, const void *fdata, int fdata_size); + void *(*font_add) (void *data, void *font, char *name, int size); + void *(*font_memory_add) (void *data, void *font, char *name, int size, const void *fdata, int fdata_size); void (*font_free) (void *data, void *font); int (*font_ascent_get) (void *data, void *font); int (*font_descent_get) (void *data, void *font);