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:
Fred Bauer 2011-10-19 16:33:33 +00:00
parent 67a1db437f
commit 8d74458744

View file

@ -76,11 +76,6 @@
#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
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)
glyphs = element->params[2].data.number;
else
glyphs = 0;
glyphs = GLYPHS_TO_CACHE;
if (id < 2)
{
DEBUGF("font id must be >= 2\n");
@ -1678,14 +1673,12 @@ static bool skin_load_fonts(struct wps_data *data)
char path[MAX_PATH];
snprintf(path, sizeof path, FONT_DIR "/%s", font->name);
#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));
}
else
#endif
font->id = font_load_ex(path,
font_glyphs_to_bufsize(path, skinfonts[font_id-2].glyphs));
#else
font->id = font_load(path);
#endif
//printf("[%d] %s -> %d\n",font_id, font->name, font->id);
id_array[font_count++] = font->id;
}