summaryrefslogtreecommitdiff
path: root/firmware/export/font.h
AgeCommit message (Collapse)Author
2014-01-26fonts: Fix regression(s) caused by c23ce62.Thomas Martitz
The builtin sysfont does not have an associated buflib_alloc_data (because it's builtin right?). font_get_{width,bits} accessed a field of it for all fonts which crashed on some systems but not on mine. Solution: Move this field to struct font directly. The cache size calculated was also busted. Fixes FS#12944 and most likely FS#12938. Change-Id: I32303c4335a12a6c421fdca34f7ece851aac12ca
2014-01-15fonts: Do not unload completely on USB.Thomas Martitz
The font engine can now perform cache lookups even if the font file is closed, if the font was disabled with the new font_disable_all() function. It is highly probable that the lookup succeeds but in the cache-miss case a blank, full-width glyph will be returned. Change-Id: I3c97e747d2a0ba30c7b495c6118c9f029d265b56
2013-04-01Increase MAXUSERFONTS to 12.Frank Gevaerts
In the modern everything-can-be-skinned world, themes are beginning to hit the limit of 8 fonts (which includes sysfont). Increasing this to 12 will allow some headroom, at the cost of a bit more RAM usage (about 20 bytes per extra possible font, so about 80 bytes total here) Change-Id: Iddf4374b7ccf92b400614a7309bf3d2147ba98ab
2011-11-27glyph_cache_save should be staticFrank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31073 a1c6a512-1295-4272-9138-f99709370657
2011-11-19FS#12293 Global default glyph setting in System > Limits > Glyphs To Cache. ↵Fred Bauer
Defaults to 250. This saves a lot of RAM while still allowing non-English users to have adequate glyph coverage. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31031 a1c6a512-1295-4272-9138-f99709370657
2011-11-08Redo r30826 (and hopefully not reintroduce font issues) which cleans up the ↵Jonathan Gordon
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
2011-10-22Add functions font_set_ui() and font_get_ui(). The font returned by FONT_UI ↵Fred Bauer
used to be fixed at zero but since buflib-fonts (r30589) can be different, depending on the order of loads and unloads. Fixes broken behavoir in virtual keyboard (FS#12336), lyrics player (FS#12306), and hopefully, FS#12337 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30826 a1c6a512-1295-4272-9138-f99709370657
2011-10-21Provide font_lock(). Font_get_bits() or ..width() may have to read glyph ↵Fred Bauer
cache misses from disk so provide a means to lock the buflib memory during the wait. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30814 a1c6a512-1295-4272-9138-f99709370657
2011-10-17Faster cached font loading. FS#12333Fred Bauer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30769 a1c6a512-1295-4272-9138-f99709370657
2011-10-16Fix Yellow: missing protoFred Bauer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30761 a1c6a512-1295-4272-9138-f99709370657
2011-10-16FS:12299 Font glyph cache is no longer saved. Each font will now have its ↵Fred Bauer
own glyph cache file with the extension '.gc' Includes a temporary fix that delays saving the file to prevent the creation of multiple gc files with same name. Mostly JD Gordon's code. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30760 a1c6a512-1295-4272-9138-f99709370657
2011-09-24Allow fonts to use smaller buffers than the default size. use font_load_ex() ↵Jonathan Gordon
to speficiy the buffer size. If the font is already loaded with a smaller buffer it will be reloaded to use the new size. Also fix an issue where handles would get lost if fonts fail to load in skins git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30592 a1c6a512-1295-4272-9138-f99709370657
2011-09-24FS#12273 - use buflib for font storage. thanks to the testers :)Jonathan Gordon
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30589 a1c6a512-1295-4272-9138-f99709370657
2011-03-05Anti-Aliased Fonts support.Thomas Martitz
This enables Rockbox to render anti-aliased fonts using an alpha blending method. The input font bitmaps are 4bit, i.e. 4x larger, but the metadata size stays the same. A tool, convttf, for converting ttf fonts directly to the Rockbox fnt format is provided. It has a useful help output, but the parameter that works best is -c1 or -c2 (2 for larger font sizes). Flyspray: FS#8961 Author: Initial work by Jonas Hurrelmann, further work by Fred Bauer, Andrew Mahone, Teruaki Kawashima and myself. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29523 a1c6a512-1295-4272-9138-f99709370657
2010-08-27change get_glyph_size() to font_glyphs_to_bufsize(). fixes a bug when font ↵Fred Bauer
glyph buffer < font header git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27911 a1c6a512-1295-4272-9138-f99709370657
2010-08-25Accept FS#11567 by Fred Bauer - better memory management for the skin fontsJonathan Gordon
%Fl now takes an optional 3rd param which is the number of glyphs to cache (default to 256). the smaller the number, the less ram will be used (i.e using 15 for a font which only shown numbers is a good idea) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27882 a1c6a512-1295-4272-9138-f99709370657
2010-06-21Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with ↵Thomas Martitz
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently). The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR). The new define is to (de-)select code to compile on hosted platforms generally. Should be no functional change to targets or the simulator. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27019 a1c6a512-1295-4272-9138-f99709370657
2010-03-03FS#10756 - Free unused init codeThomas Martitz
Introduce a new .init section for initialisation code, so that it can be copied to an area which is later overwritten before calling. The stack/bss can then overwrite that code, effectively freeing the code size that the initialisation routines need. Gives a few kB ram usage back. Only implemented for PP and as3525 so far. More targets could be added, as well as more functions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25013 a1c6a512-1295-4272-9138-f99709370657
2010-03-03undo that last undo, make the font loader more forgiving to user errorsJonathan Gordon
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24994 a1c6a512-1295-4272-9138-f99709370657
2010-03-02revert r24989 ad r24990 which are cuasing segfaults... they were working ↵Jonathan Gordon
fine for me though :( (stupid font stuff is cursed!) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24993 a1c6a512-1295-4272-9138-f99709370657
2010-03-02* Make the user font count more saneJonathan Gordon
* font 2-9 in the skins will always be user fonts in the skins * init the skinfonts array so it doesnt think id 'x' is used already * make the parser work with FONT_UI untill the very end, even on remote fonts git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24989 a1c6a512-1295-4272-9138-f99709370657
2010-03-01Revert r24958. It didn't fix anything (in fact, the problem described didn't ↵Thomas Martitz
exist). Increase MAXFONTS by 1 to allow for remote screen targets to load fonts 2-9. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24983 a1c6a512-1295-4272-9138-f99709370657
2010-02-28redo r24943. the font mappings are not needed once the skin is finished ↵Jonathan Gordon
parsing so using the skin buffer there is a waste and overcomplicates things. Also that commit breaks plain %pb so make sure you dont use %pb inside a viewport with a font number > 1 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24957 a1c6a512-1295-4272-9138-f99709370657
2010-02-14FS#10984 - multifont! 2 major additions:Jonathan Gordon
1) seperate UI font for the remote and main displays 2) allow individual skins to load additional fonts for use in the skin (Uo to 7 extra in this first version) see CustomWPS for info on how to load a font in the skins. Code should always use FONT_UI+screen_number to get the correct user font git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24644 a1c6a512-1295-4272-9138-f99709370657
2009-12-13Font improvements: Fix bug that caused some fonts to be rendered garbled on ↵Nils Wallménius
custom builds with MAX_FONT_SIZE > 64k (closes FS#10844). Simplify version check. Use void pointer and explicit casting for the offsets to make it clearer that they may be of different sizes, add a comment too. Use uint16_t in stead of short in some places for consistency. Replace magic number with meaningful define. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23969 a1c6a512-1295-4272-9138-f99709370657
2009-09-13Get rid of some of the code duplication from checkwps, it still duplicates a ↵Thomas Martitz
lot though. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22695 a1c6a512-1295-4272-9138-f99709370657
2009-01-29Get checkwps working againMaurus Cuelenaere
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19880 a1c6a512-1295-4272-9138-f99709370657
2008-11-24Added support for configurable rockbox directory. FS#9567 by Alex Bennee.Björn Stenberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19208 a1c6a512-1295-4272-9138-f99709370657
2008-06-28Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg
later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-03-25Make checkwps compile again. Still more work is needed though, as checkwps ↵Dave Chapman
is compiled to emulate an iPod Color - this needs changing to allow the LCD (and remote LCD) dimensions/depth to be specified on the commandline - the new %V tags are validated against the LCD characteristics git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16807 a1c6a512-1295-4272-9138-f99709370657
2007-09-14Tab policeNils Wallménius
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14691 a1c6a512-1295-4272-9138-f99709370657
2007-06-30Change unsigned long to uint32_t and long to int32_t to fix a crash in Nils Wallménius
64 bit sims. Make a couple of private functions 'static'. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13743 a1c6a512-1295-4272-9138-f99709370657
2007-03-05Use a larger font cache on the targets that can afford the (quite small) RAM ↵Linus Nielsen Feltzing
usage git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12620 a1c6a512-1295-4272-9138-f99709370657
2007-01-17sysfont.h is only needed by devices with bitmap displays.Barry Wardell
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12042 a1c6a512-1295-4272-9138-f99709370657
2007-01-17Make the build system create a sysfont.h which includes font information for ↵Barry Wardell
the system font. Available #defines are: SYSFONT_NAME, SYSFONT_FACENAME, SYSFONT_WIDTH, SYSFONT_HEIGHT, SYSFONT_SIZE, SYSFONT_ASCENT, SYSFONT_DESCENT, SYSFONT_FIRST_CHAR, SYSFONT_LAST_CHAR, SYSFONT_DEFAULT_CHAR, SYSFONT_PROPORTIONAL, SYSFONT_COPYRIGHT, SYSFONT_BITS_SIZE. Also fix a small bug in the iPod bootloader printf() code and use printf() for PortalPlayer bootloaders too. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12041 a1c6a512-1295-4272-9138-f99709370657
2005-12-06waiting is over: initial unicode commitMarcoen Hirschberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8169 a1c6a512-1295-4272-9138-f99709370657
2005-08-03Increased maximum file size for models with LCD height larger than 64 toDaniel Stenberg
10000 bytes. Also adjusted the buildzip script to dynamically figure out the maximum buffer size for the particular build that the zip is made for. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7280 a1c6a512-1295-4272-9138-f99709370657
2005-04-19moved lcd_getstringsize into font.cChristian Gmeiner
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6321 a1c6a512-1295-4272-9138-f99709370657
2004-08-27font format documentation updated, obsolete definitions removedJörg Hohensohn
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5020 a1c6a512-1295-4272-9138-f99709370657
2004-08-27By reducing the font buffer to 4000 bytes from 9000, we get 5000 fresh bytesDaniel Stenberg
to buffer mp3 with! Only 3 out of 44 fonts that fit within 9000 are bigger than 4000, leaving us with 41 fonts that fit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5019 a1c6a512-1295-4272-9138-f99709370657
2004-08-26Fixed pointer types & struct fontJens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5016 a1c6a512-1295-4272-9138-f99709370657
2004-08-26New font format (already rotated) saves code, space and time. On the ↵Jörg Hohensohn
downside this new format is incompatible, so get the new fonts, too. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5015 a1c6a512-1295-4272-9138-f99709370657
2004-08-16Const policed pointer arguments to functions, part 1Jens Arnold
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4995 a1c6a512-1295-4272-9138-f99709370657
2003-06-29Added multiple inclusion protectionBjörn Stenberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3767 a1c6a512-1295-4272-9138-f99709370657
2003-02-07Include File Cleanup And Move-Around Party 2003.Daniel Stenberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3213 a1c6a512-1295-4272-9138-f99709370657