summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFred Bauer <fred.w.bauer@gmail.com>2011-11-19 23:34:26 +0000
committerFred Bauer <fred.w.bauer@gmail.com>2011-11-19 23:34:26 +0000
commitea7a89606cfaffb2ae2c843ea9868bd8c8dd16c9 (patch)
tree5ff1f18c66be4c25f32e03ffadeb6bb3cb568656 /apps
parentd78e05c5722356fd8ce20cdb4c40df44cc2b4d33 (diff)
downloadrockbox-ea7a89606cfaffb2ae2c843ea9868bd8c8dd16c9.tar.gz
rockbox-ea7a89606cfaffb2ae2c843ea9868bd8c8dd16c9.tar.bz2
rockbox-ea7a89606cfaffb2ae2c843ea9868bd8c8dd16c9.zip
FS#12293 Global default glyph setting in System > Limits > Glyphs To Cache. Defaults to 250. This saves a lot of RAM while still allowing non-English users to have adequate glyph coverage.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31031 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/skin_engine/skin_parser.c6
-rw-r--r--apps/lang/english.lang14
-rw-r--r--apps/menus/settings_menu.c9
-rw-r--r--apps/settings.c2
-rw-r--r--apps/settings.h1
-rw-r--r--apps/settings_list.c6
6 files changed, 32 insertions, 6 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index ad10689107..c4a96d0e9b 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -78,7 +78,6 @@
#define WPS_ERROR_INVALID_PARAM -1
-#define GLYPHS_TO_CACHE 256
static char* skin_buffer = NULL;
void skinparser_set_buffer(char* pointer)
{
@@ -468,7 +467,7 @@ static int parse_font_load(struct skin_element *element,
if(element->params_count > 2)
glyphs = get_param(element, 2)->data.number;
else
- glyphs = GLYPHS_TO_CACHE;
+ glyphs = global_settings.glyphs;
if (id < 2)
{
DEBUGF("font id must be >= 2\n");
@@ -1742,8 +1741,7 @@ static bool skin_load_fonts(struct wps_data *data)
char path[MAX_PATH];
snprintf(path, sizeof path, FONT_DIR "/%s", font->name);
#ifndef __PCTOOL__
- font->id = font_load_ex(path,
- font_glyphs_to_bufsize(path, skinfonts[font_id-2].glyphs));
+ font->id = font_load_ex(path, 0, skinfonts[font_id-2].glyphs);
#else
font->id = font_load(path);
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index a228a78f7f..29e6205729 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -12951,3 +12951,17 @@
hardware_click: "Speaker Keyclick"
</voice>
</phrase>
+<phrase>
+ id: LANG_GLYPHS
+ desc: in settings_menu
+ user: core
+ <source>
+ *: "Glyphs To Cache"
+ </source>
+ <dest>
+ *: "Glyphs To Cache"
+ </dest>
+ <voice>
+ *: "Glyphs To Cache"
+ </voice>
+</phrase>
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 079e86616d..4ea98efd95 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -221,8 +221,15 @@ MENUITEM_SETTING(poweroff, &global_settings.poweroff, NULL);
/* Limits menu */
MENUITEM_SETTING(max_files_in_dir, &global_settings.max_files_in_dir, NULL);
MENUITEM_SETTING(max_files_in_playlist, &global_settings.max_files_in_playlist, NULL);
+#ifdef HAVE_LCD_BITMAP
+MENUITEM_SETTING(default_glyphs, &global_settings.glyphs, NULL);
+#endif
MAKE_MENU(limits_menu, ID2P(LANG_LIMITS_MENU), 0, Icon_NOICON,
- &max_files_in_dir, &max_files_in_playlist);
+ &max_files_in_dir, &max_files_in_playlist
+#ifdef HAVE_LCD_BITMAP
+ ,&default_glyphs
+#endif
+ );
/* Keyclick menu */
diff --git a/apps/settings.c b/apps/settings.c
index fbfa438ab5..c22fa50f17 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -886,7 +886,7 @@ void settings_apply(bool read_disk)
CHART2(">font_load ", global_settings.font_file);
if (font_ui >= 0)
font_unload(font_ui);
- rc = font_load(buf);
+ rc = font_load_ex(buf, 0, global_settings.glyphs);
CHART2("<font_load ", global_settings.font_file);
screens[SCREEN_MAIN].setuifont(rc);
screens[SCREEN_MAIN].setfont(rc);
diff --git a/apps/settings.h b/apps/settings.h
index 06eba76e3c..6608df6111 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -672,6 +672,7 @@ struct user_settings
unsigned char icon_file[MAX_FILENAME+1];
unsigned char viewers_icon_file[MAX_FILENAME+1];
unsigned char font_file[MAX_FILENAME+1]; /* last font */
+ int glyphs;
#ifdef HAVE_REMOTE_LCD
unsigned char remote_font_file[MAX_FILENAME+1]; /* last font */
#endif
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 9232811ada..305edd93ba 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -222,6 +222,9 @@ static const char graphic_numeric[] = "graphic,numeric";
#else
#define DEFAULT_FONTNAME "35-Adobe-Helvetica"
#endif
+#define DEFAULT_GLYPHS 250
+#define MIN_GLYPHS 50
+#define MAX_GLYPHS 65540
#else
#define DEFAULT_FONTNAME ""
@@ -1622,6 +1625,9 @@ const struct settings_list settings[] = {
#ifdef HAVE_LCD_BITMAP
TEXT_SETTING(F_THEMESETTING, font_file, "font",
DEFAULT_FONTNAME, FONT_DIR "/", ".fnt"),
+ INT_SETTING(0, glyphs, LANG_GLYPHS, DEFAULT_GLYPHS,
+ "glyphs", UNIT_INT, MIN_GLYPHS, MAX_GLYPHS, 10,
+ NULL, NULL, NULL),
#endif
#ifdef HAVE_REMOTE_LCD
TEXT_SETTING(F_THEMESETTING, remote_font_file, "remote font",