summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-08-10 13:36:14 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-08-10 13:36:14 +0000
commit1b53b99b75f6e4047222dcf24c6641dce26d930e (patch)
treeff907210ba311bb9b83af2f5b50e64c4ece79bd4 /apps/gui
parentd1a392a0e95b10fe9603fbd379a70b4cc0ddf22f (diff)
Accept FS#11523 by Fred Bauer - fix a bug where the skin fonts dont check the correct path so it would load the same font twice when it shouldnt.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27766 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/skin_engine/skin_fonts.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/gui/skin_engine/skin_fonts.c b/apps/gui/skin_engine/skin_fonts.c
index b3b4df2c92..2510c8c68c 100644
--- a/apps/gui/skin_engine/skin_fonts.c
+++ b/apps/gui/skin_engine/skin_fonts.c
@@ -63,6 +63,7 @@ int skin_font_load(char* font_name)
struct font *pf;
struct skin_font_info *font = NULL;
char filename[MAX_PATH];
+ char tmp[MAX_PATH];
if (!strcmp(font_name, global_settings.font_file))
return FONT_UI;
@@ -70,9 +71,12 @@ int skin_font_load(char* font_name)
if (!strcmp(font_name, global_settings.remote_font_file))
return FONT_UI_REMOTE;
#endif
+ snprintf(tmp, MAX_PATH, FONT_DIR "/%s.fnt", font_name);
+ get_user_file_path(tmp, FORCE_BUFFER_COPY, filename, sizeof(filename));
+
for(i=0;i<MAXUSERFONTS;i++)
{
- if (font_table[i].font_id >= 0 && !strcmp(font_table[i].name, font_name))
+ if (font_table[i].font_id >= 0 && !strcmp(font_table[i].name, filename))
{
font_table[i].ref_count++;
return font_table[i].font_id;
@@ -99,9 +103,6 @@ int skin_font_load(char* font_name)
}
pf->buffer_size = SKIN_FONT_SIZE;
- snprintf(filename, MAX_PATH, FONT_DIR "/%s.fnt", font_name);
- get_user_file_path(filename, FORCE_BUFFER_COPY, font->name, sizeof(font->name));
-
pf->fd = -1;
font->font_id = font_load(pf, filename);