mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-06 21:25:03 -05:00
FS#13704 - Rockpaint fonts memory troubles -- Disable font rendering in font selection
Displaying the fonts as you select them is nice but IMO pretty wasteful I think a few static bitmaps would probably suffice I however don't feel like addressing this so lets just disable it, for now? Change-Id: I882cc0c4129e99d8b2f4ac135301dc3906340bb7
This commit is contained in:
parent
4e4af2fe96
commit
76ee238d48
1 changed files with 31 additions and 1 deletions
|
|
@ -1134,6 +1134,7 @@ static bool browse( char *dst, int dst_size, const char *start )
|
|||
* In other words, cache_first-1 must be cached before cache_first-2 is cached.
|
||||
* - there is enough space to store all preview currently displayed.
|
||||
*/
|
||||
#if 0 /* Broken crashy caching implementation that renders the font in the list FS#13704 */
|
||||
static bool browse_fonts( char *dst, int dst_size )
|
||||
{
|
||||
#define LINE_SPACE 2
|
||||
|
|
@ -1312,7 +1313,7 @@ static bool browse_fonts( char *dst, int dst_size )
|
|||
li = tree->filesindir-1;
|
||||
if( reset_font )
|
||||
{
|
||||
// fixme rb->font_load(NULL, bbuf_s );
|
||||
// fixme rb->font_load(bbuf_s );
|
||||
reset_font = false;
|
||||
}
|
||||
if( lvi-fvi+1 < tree->filesindir )
|
||||
|
|
@ -1386,6 +1387,35 @@ static bool browse_fonts( char *dst, int dst_size )
|
|||
#undef PREVIEW_SIZE
|
||||
#undef PREVIEW_NEXT
|
||||
}
|
||||
#else /* simple uncached non-rendered fallback */
|
||||
static bool browse_fonts( char *dst, int dst_size )
|
||||
{
|
||||
/* taken from text_viewer */
|
||||
char font[MAX_PATH], name[MAX_FILENAME+10];
|
||||
rb->snprintf(name, sizeof(name), "%s.fnt", rb->global_settings->font_file);
|
||||
|
||||
struct browse_context browse = {
|
||||
.dirfilter = SHOW_FONT,
|
||||
.flags = BROWSE_SELECTONLY | BROWSE_NO_CONTEXT_MENU,
|
||||
.title = rb->str(LANG_CUSTOM_FONT),
|
||||
.icon = Icon_Menu_setting,
|
||||
.root = FONT_DIR,
|
||||
.selected = name,
|
||||
.buf = font,
|
||||
.bufsize = sizeof(font),
|
||||
//.callback_show_item = &callback_show_font,
|
||||
};
|
||||
|
||||
rb->rockbox_browse(&browse);
|
||||
|
||||
if (browse.flags & BROWSE_SELECTED)
|
||||
{
|
||||
rb->snprintf( dst, dst_size, "%s", font );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
* HSVRGB Color chooser
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue