forked from old/legacy-imlib2
parent
aa3d5e61dd
commit
de446b41a3
|
@ -2605,8 +2605,8 @@ imlib_add_path_to_font_path(const char *path)
|
|||
{
|
||||
if (!ctx) ctx = imlib_context_new();
|
||||
CHECK_PARAM_POINTER("imlib_add_path_to_font_path", "path", path);
|
||||
__imlib_del_font_path(path);
|
||||
__imlib_add_font_path(path);
|
||||
if (!__imlib_font_path_exists(path))
|
||||
__imlib_add_font_path(path);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
13
src/font.c
13
src/font.c
|
@ -194,6 +194,7 @@ __imlib_del_font_path(const char *path)
|
|||
{
|
||||
if (!strcmp(path, fpath[i]))
|
||||
{
|
||||
if (fpath[i]) free(fpath[i]);
|
||||
fpath_num--;
|
||||
for (j = i; j < fpath_num; j++)
|
||||
fpath[j] = fpath[j + 1];
|
||||
|
@ -208,6 +209,18 @@ __imlib_del_font_path(const char *path)
|
|||
}
|
||||
}
|
||||
|
||||
int
|
||||
__imlib_font_path_exists(const char *path)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < fpath_num; i++)
|
||||
{
|
||||
if (!strcmp(path, fpath[i])) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
char **
|
||||
__imlib_list_font_path(int *num_ret)
|
||||
{
|
||||
|
|
|
@ -158,6 +158,7 @@ TT_Raster_Map *__imlib_create_font_raster(int width, int height);
|
|||
void __imlib_destroy_font_raster(TT_Raster_Map * rmap);
|
||||
void __imlib_add_font_path(const char *path);
|
||||
void __imlib_del_font_path(const char *path);
|
||||
int __imlib_font_path_exists(const char *path);
|
||||
char **__imlib_list_font_path(int *num_ret);
|
||||
ImlibFont *__imlib_find_cached_font(const char *ttffontname, const char *xfontname, int mode);
|
||||
ImlibFont *__imlib_load_font(const char *fontname);
|
||||
|
|
Loading…
Reference in New Issue