This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#12293 - Global default glyph size setting for gui/skins
Attached to Project:
Rockbox
Opened by Fred Bauer (freddyb) - Sunday, 25 September 2011, 20:32 GMT+2
Last edited by Fred Bauer (freddyb) - Sunday, 20 November 2011, 00:40 GMT+2
Opened by Fred Bauer (freddyb) - Sunday, 25 September 2011, 20:32 GMT+2
Last edited by Fred Bauer (freddyb) - Sunday, 20 November 2011, 00:40 GMT+2
|
DetailsWe should allocate font memory according to the number of glyphs needed because the font coverage can vary quite a bit between a small mono font and a large anti-aliased font for a given buffer size. It's easy to do this now that font memory is reserved via buflib. This patch adds a global setting for the default number of glyphs for fonts rather than a fixed buffer size for each font. The setting is under Theme Settings>Glyphs to cache, which sets global_settings.glyphs (default 250).
Adds the function font_load_glyphs( char *path, int glyphs ); Adds a #define font_load_whole( char *path ); that tries to load the entire font into memory. font_load_glyphs now checks if the specified number of glyphs would make the font_cache structure larger than the font file and if so, just loads the whole font file in memory instead. |
This task depends upon
Closed by Fred Bauer (freddyb)
Sunday, 20 November 2011, 00:40 GMT+2
Reason for closing: Accepted
Additional comments about closing: In r31031.
Sunday, 20 November 2011, 00:40 GMT+2
Reason for closing: Accepted
Additional comments about closing: In r31031.
15-Adobe-Helvetica.fnt loaded (cache). file size 231946 - 60000 bytes - 1250 glyphs
20-Ubuntu-R.fnt loaded (cache). file size 431297 - 60000 bytes - 280 glyphs
38-Ubuntu-R.fnt loaded (cache). file size 656925 - 60000 bytes - 82 glyphs
15-Adobe-Helvetica.fnt loaded (cache). file size 231946 - 60000 bytes - 1250 glyphs
24 iLike.fnt loaded (mem). file_size 48510 - 8818 glyphs
18 iLike.fnt loaded (mem). file_size 48510 - 8818 glyphs
18 iLike.fnt loaded (mem). file_size 48510 - 8818 glyphs
TimesNewRomanPSMT-16.fnt loaded (cache). file size 401709 - 60000 bytes - 256 glyphs
Georgia-19.fnt loaded (cache). file size 253293 - 60000 bytes - 272 glyphs
Army-23.fnt loaded (cache). file size 225679 - 60000 bytes - 180 glyphs
Army-15.fnt loaded (mem). file_size 6305 - 95 glyphs
Army-18.fnt loaded (cache). file size 212355 - 60000 bytes - 300 glyphs
15-Adobe-Helvetica.fnt loaded (cache). file size 231946 - 60000 bytes - 1250 glyphs
DejaVuSans_10.fnt loaded (mem). file_size 57759 - 11351 glyphs
DejaVuSans_15.fnt loaded (cache). file size 79401 - 60000 bytes - 410 glyphs
DejaVuSans_20.fnt loaded (cache). file size 130751 - 60000 bytes - 250 glyphs
FreeSerif-10.fnt loaded (cache). file size 464502 - 60000 bytes - 517 glyphs
FreeSerif-20.fnt loaded (cache). file size 851638 - 60000 bytes - 142 glyphs
FreeSerif-30.fnt loaded (cache). file size 1489538 - 60000 bytes - 64 glyphs
-Creates a theme menu entry for the default number of glyphs to load
-Font_load_ex() is now font_load_ex( name, buffer size, glyphs ).
-Buffer size and glyphs may be zero for defaults.
-Default font_load() allocates the lesser of 256 glyphs or MAX_FONT_SIZE, which can be a significant memory savings (~46000 bytes for 15-Adobe-Helvetica)
-Font buffer will be limited to MAX_FONT_SIZE for targets with less than 4MB, overriding the glyph parameter
-Font buffer can exceed MAX_FONT_SIZE if glyphs are specified and buffer size is not and target mem >= 4MB.
-Font buffer will be limited to buffer size if both parameters are given.
-(The original patch limited the size of the font buffer to the size of the font file but that change was committed to SVN separately.)
-Skin fonts will use the global glyph parameter if not specified in the skin.