summaryrefslogtreecommitdiffstats
path: root/apps/settings.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-11-08 10:09:33 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-11-08 10:09:33 +0000
commitf19f3efb078b2947638f6f7a7f209de44daf78b3 (patch)
tree46ddfc7234b2de6e848d5bcd7630821d91a84f37 /apps/settings.c
parent452a3ce2742949e184d6bc9c9b1f7985dae3e874 (diff)
downloadrockbox-f19f3efb078b2947638f6f7a7f209de44daf78b3.tar.gz
rockbox-f19f3efb078b2947638f6f7a7f209de44daf78b3.tar.bz2
rockbox-f19f3efb078b2947638f6f7a7f209de44daf78b3.zip
Redo r30826 (and hopefully not reintroduce font issues) which cleans up the font API. FONT_UI is deprecated, use screens[screen].getuifont() instead (and .setuifont() to set it after a font has been loaded)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30932 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings.c')
-rw-r--r--apps/settings.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/apps/settings.c b/apps/settings.c
index 7142cfb0c6..fbfa438ab5 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -876,37 +876,38 @@ void settings_apply(bool read_disk)
/* fonts need to be loaded before the WPS */
if (global_settings.font_file[0]
&& global_settings.font_file[0] != '-') {
- const char* loaded_font = font_filename(global_status.font_id[SCREEN_MAIN]);
+ int font_ui = screens[SCREEN_MAIN].getuifont();
+ const char* loaded_font = font_filename(font_ui);
snprintf(buf, sizeof buf, FONT_DIR "/%s.fnt",
global_settings.font_file);
if (!loaded_font || strcmp(loaded_font, buf))
{
CHART2(">font_load ", global_settings.font_file);
- if (global_status.font_id[SCREEN_MAIN] >= 0)
- font_unload(global_status.font_id[SCREEN_MAIN]);
+ if (font_ui >= 0)
+ font_unload(font_ui);
rc = font_load(buf);
- font_set_ui(rc);
CHART2("<font_load ", global_settings.font_file);
- global_status.font_id[SCREEN_MAIN] = rc;
- lcd_setfont(rc);
+ screens[SCREEN_MAIN].setuifont(rc);
+ screens[SCREEN_MAIN].setfont(rc);
}
}
#ifdef HAVE_REMOTE_LCD
if ( global_settings.remote_font_file[0]
&& global_settings.remote_font_file[0] != '-') {
- const char* loaded_font = font_filename(global_status.font_id[SCREEN_REMOTE]);
+ int font_ui = screens[SCREEN_REMOTE].getuifont();
+ const char* loaded_font = font_filename(font_ui);
snprintf(buf, sizeof buf, FONT_DIR "/%s.fnt",
global_settings.remote_font_file);
if (!loaded_font || strcmp(loaded_font, buf))
{
CHART2(">font_load_remoteui ", global_settings.remote_font_file);
- if (global_status.font_id[SCREEN_REMOTE] >= 0)
- font_unload(global_status.font_id[SCREEN_REMOTE]);
+ if (font_ui >= 0)
+ font_unload(font_ui);
rc = font_load(buf);
CHART2("<font_load_remoteui ", global_settings.remote_font_file);
- global_status.font_id[SCREEN_REMOTE] = rc;
- lcd_remote_setfont(rc);
+ screens[SCREEN_REMOTE].setuifont(rc);
+ screens[SCREEN_REMOTE].setfont(rc);
}
}
#endif
@@ -1076,10 +1077,11 @@ void settings_reset(void)
#ifdef HAVE_LCD_BITMAP
FOR_NB_SCREENS(i)
{
- if (global_status.font_id[i] > FONT_SYSFIXED)
+ if (screens[i].getuifont() > FONT_SYSFIXED)
{
- font_unload(global_status.font_id[i]);
- global_status.font_id[i] = FONT_SYSFIXED;
+ font_unload(screens[i].getuifont());
+ screens[i].setuifont(FONT_SYSFIXED);
+ screens[i].setfont(FONT_SYSFIXED);
}
}
#endif