summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine
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/gui/skin_engine
parent452a3ce2742949e184d6bc9c9b1f7985dae3e874 (diff)
downloadrockbox-f19f3efb078b2947638f6f7a7f209de44daf78b3.tar.gz
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/gui/skin_engine')
-rw-r--r--apps/gui/skin_engine/skin_parser.c12
-rw-r--r--apps/gui/skin_engine/skin_render.c2
2 files changed, 8 insertions, 6 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 1557783a7c..d207a1fb3e 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -246,10 +246,12 @@ static int parse_statusbar_tags(struct skin_element* element,
246 viewport_set_fullscreen(&default_vp->vp, curr_screen); 246 viewport_set_fullscreen(&default_vp->vp, curr_screen);
247 } 247 }
248#ifdef HAVE_REMOTE_LCD 248#ifdef HAVE_REMOTE_LCD
249 /* viewport_set_defaults() sets the font to FONT_UI+curr_screen. 249 /* This parser requires viewports which will use the settings font to
250 * This parser requires font 1 to always be the UI font, 250 * have font == 1, but the above viewport_set() calls set font to
251 * so force it back to FONT_UI and handle the screen number at the end */ 251 * the current real font id. So force 1 here it will be set correctly
252 default_vp->vp.font = FONT_UI; 252 * at the end
253 */
254 default_vp->vp.font = 1;
253#endif 255#endif
254 } 256 }
255 return 0; 257 return 0;
@@ -1645,7 +1647,7 @@ static bool skin_load_fonts(struct wps_data *data)
1645 font_id = skin_vp->parsed_fontid; 1647 font_id = skin_vp->parsed_fontid;
1646 if (font_id == 1) 1648 if (font_id == 1)
1647 { /* the usual case -> built-in fonts */ 1649 { /* the usual case -> built-in fonts */
1648 vp->font = global_status.font_id[curr_screen]; 1650 vp->font = screens[curr_screen].getuifont();
1649 continue; 1651 continue;
1650 } 1652 }
1651 else if (font_id <= 0) 1653 else if (font_id <= 0)
diff --git a/apps/gui/skin_engine/skin_render.c b/apps/gui/skin_engine/skin_render.c
index 369bd46be5..4d41a6f9b7 100644
--- a/apps/gui/skin_engine/skin_render.c
+++ b/apps/gui/skin_engine/skin_render.c
@@ -658,7 +658,7 @@ void skin_render_viewport(struct skin_element* viewport, struct gui_wps *gwps,
658 658
659 /* fix font ID's */ 659 /* fix font ID's */
660 if (skin_viewport->parsed_fontid == 1) 660 if (skin_viewport->parsed_fontid == 1)
661 skin_viewport->vp.font = global_status.font_id[display->screen_type]; 661 skin_viewport->vp.font = display->getuifont();
662#endif 662#endif
663 663
664 while (line) 664 while (line)