1
0
Fork 0
forked from len0rd/rockbox

skin_engine: Splash an error when a font fails to load

...Otherwise we fail silently with the theme only partially applied.

Change-Id: I1010efaee965db86bb8d2859b04364f63bfbcc0f
This commit is contained in:
Solomon Peachy 2024-12-07 09:19:46 -05:00
parent 5ed0db6e90
commit 93ecb97693
2 changed files with 20 additions and 1 deletions

View file

@ -49,9 +49,12 @@
#include "audio.h" #include "audio.h"
#define lang_is_rtl() (false) #define lang_is_rtl() (false)
#define DEBUGF printf #define DEBUGF printf
#define splashf(...)
#endif /*WPSEDITOR*/ #endif /*WPSEDITOR*/
#else #else
#include "debug.h" #include "debug.h"
#include "splash.h"
#include "lang.h"
#include "language.h" #include "language.h"
#endif /*__PCTOOL__*/ #endif /*__PCTOOL__*/
@ -2102,6 +2105,7 @@ static bool skin_load_fonts(struct wps_data *data)
{ {
if (success) if (success)
{ {
splashf(HZ, str(LANG_FONT_LOAD_ERROR), "(no name)");
DEBUGF("font %d not specified\n", font_id); DEBUGF("font %d not specified\n", font_id);
} }
success = false; success = false;
@ -2126,6 +2130,7 @@ static bool skin_load_fonts(struct wps_data *data)
if (font->id < 0) if (font->id < 0)
{ {
splashf(HZ, str(LANG_FONT_LOAD_ERROR), font->name);
DEBUGF("Unable to load font %d: '%s'\n", font_id, font->name); DEBUGF("Unable to load font %d: '%s'\n", font_id, font->name);
font->name = NULL; /* to stop trying to load it again if we fail */ font->name = NULL; /* to stop trying to load it again if we fail */
success = false; success = false;

View file

@ -16567,3 +16567,17 @@
*: "Lineout" *: "Lineout"
</voice> </voice>
</phrase> </phrase>
<phrase>
id: LANG_FONT_LOAD_ERROR
desc: Displayed when font loading fails
user: core
<source>
*: "Unable to load font: (%s)"
</source>
<dest>
*: "Unable to load font: (%s)"
</dest>
<voice>
*: "tracks saved"
</voice>
</phrase>