forked from len0rd/rockbox
make %Fl (font load) more consistant with bmp loading and require the whole filename, i.e require the .fnt.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25001 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
fad70c1086
commit
25d9771ebc
1 changed files with 7 additions and 2 deletions
|
|
@ -726,6 +726,11 @@ static int parse_font_load(const char *wps_bufptr,
|
||||||
DEBUGF("font id %d already being used\n", id);
|
DEBUGF("font id %d already being used\n", id);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* make sure the filename contains .fnt,
|
||||||
|
* we dont actually use it, but require it anyway */
|
||||||
|
ptr = strchr(filename, '.');
|
||||||
|
if (!ptr || strncmp(ptr, ".fnt|", 5))
|
||||||
|
return WPS_ERROR_INVALID_PARAM;
|
||||||
skinfonts[id-FONT_FIRSTUSERFONT].id = -1;
|
skinfonts[id-FONT_FIRSTUSERFONT].id = -1;
|
||||||
skinfonts[id-FONT_FIRSTUSERFONT].name = filename;
|
skinfonts[id-FONT_FIRSTUSERFONT].name = filename;
|
||||||
|
|
||||||
|
|
@ -2113,8 +2118,8 @@ static bool skin_load_fonts(struct wps_data *data)
|
||||||
* multiple viewports use the same */
|
* multiple viewports use the same */
|
||||||
if (font->id < 0)
|
if (font->id < 0)
|
||||||
{
|
{
|
||||||
char *bar = strchr(font->name, '|');
|
char *dot = strchr(font->name, '.');
|
||||||
*bar = '\0';
|
*dot = '\0';
|
||||||
font->id = skin_font_load(font->name);
|
font->id = skin_font_load(font->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue