forked from len0rd/rockbox
Revert skin font allocation size to the behavior prior to r30589. i.e. Default to 256 glyphs rather than trying to load MAX_FONT_SIZE. This matches the manual and saves a lot of ram if a theme uses multiple fonts.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30804 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
67a1db437f
commit
8d74458744
1 changed files with 6 additions and 13 deletions
|
|
@ -76,11 +76,6 @@
|
||||||
|
|
||||||
#define WPS_ERROR_INVALID_PARAM -1
|
#define WPS_ERROR_INVALID_PARAM -1
|
||||||
|
|
||||||
#if LCD_HEIGHT > 160
|
|
||||||
#define SKIN_FONT_SIZE (1024*10)
|
|
||||||
#else
|
|
||||||
#define SKIN_FONT_SIZE (1024*3)
|
|
||||||
#endif
|
|
||||||
#define GLYPHS_TO_CACHE 256
|
#define GLYPHS_TO_CACHE 256
|
||||||
|
|
||||||
static bool isdefault(struct skin_tag_parameter *param)
|
static bool isdefault(struct skin_tag_parameter *param)
|
||||||
|
|
@ -419,7 +414,7 @@ static int parse_font_load(struct skin_element *element,
|
||||||
if(element->params_count > 2)
|
if(element->params_count > 2)
|
||||||
glyphs = element->params[2].data.number;
|
glyphs = element->params[2].data.number;
|
||||||
else
|
else
|
||||||
glyphs = 0;
|
glyphs = GLYPHS_TO_CACHE;
|
||||||
if (id < 2)
|
if (id < 2)
|
||||||
{
|
{
|
||||||
DEBUGF("font id must be >= 2\n");
|
DEBUGF("font id must be >= 2\n");
|
||||||
|
|
@ -1678,14 +1673,12 @@ static bool skin_load_fonts(struct wps_data *data)
|
||||||
char path[MAX_PATH];
|
char path[MAX_PATH];
|
||||||
snprintf(path, sizeof path, FONT_DIR "/%s", font->name);
|
snprintf(path, sizeof path, FONT_DIR "/%s", font->name);
|
||||||
#ifndef __PCTOOL__
|
#ifndef __PCTOOL__
|
||||||
if (skinfonts[font_id-2].glyphs > 0)
|
font->id = font_load_ex(path,
|
||||||
{
|
font_glyphs_to_bufsize(path, skinfonts[font_id-2].glyphs));
|
||||||
font->id = font_load_ex(path,
|
|
||||||
font_glyphs_to_bufsize(path, skinfonts[font_id-2].glyphs));
|
#else
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
font->id = font_load(path);
|
font->id = font_load(path);
|
||||||
|
#endif
|
||||||
//printf("[%d] %s -> %d\n",font_id, font->name, font->id);
|
//printf("[%d] %s -> %d\n",font_id, font->name, font->id);
|
||||||
id_array[font_count++] = font->id;
|
id_array[font_count++] = font->id;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue