summaryrefslogtreecommitdiff
path: root/firmware/font.c
AgeCommit message (Collapse)Author
2017-09-05Initial commit for the Sony NWZ linux portAmaury Pouly
SUPPORTED SERIES: - NWZ-E450 - NWZ-E460 - NWZ-E470 - NWZ-E580 - NWZ-A10 NOTES: - bootloader makefile convert an extra font to be installed alongside the bootloader since sysfont is way too small - the toolsicon bitmap comes from the Oxygen iconset - touchscreen driver is untested TODO: - implement audio routing driver (pcm is handled by pcm-alsa) - fix playback: it crashes on illegal instruction in DEBUG builds - find out why the browser starts at / instead of /contents - implement radio support - implement return to OF for usb handling - calibrate battery curve (NB: of can report a battery level on a 0-5 scale but probabl don't want to use that ?) - implement simulator build (we need a nice image of the player) - figure out if we can detect jack removal POTENTIAL TODOS: - try to build a usb serial gadget and gdbserver Change-Id: Ic77d71e0651355d47cc4e423a40fb64a60c69a80
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-16Fix red. Screw those last-minute changes :\Thomas Martitz
Change-Id: I12666e98114e490a13023af7149fc37147d4e864
2014-01-16font: Fix crash due to uninitialized field.Thomas Martitz
Change-Id: If2fafb15a9998eebb2936e819507758e003abe30
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
2014-01-05Do not include kernel.h in system.h.Thomas Martitz
system.h doesn't need it on its own and this change makes it less dependant on Rockbox internals. Change-Id: I4e1e4108a52a7b599627a829204eb82b392fc6d6
2012-06-10Fix checks on buflib allocated handles (0 is not a valid handle value)Bertrik Sikken
Change-Id: I8fdc5a59a5062f40a431cd49971390e21631b8ec
2012-05-02Use buflib for the allocation of voice PCM resources.Michael Sevakis
Buffers are not allocated and thread is not created until the first call where voice is required. Adds a different callback (sync_callback) to buflib so that other sorts of synchonization are possible, such as briefly locking-out the PCM callback for a buffer move. It's sort of a messy addition but it is needed so voice decoding won't have to be stopped when its buffer is moved. Change-Id: I4d4d8c35eed5dd15fb7ee7df9323af3d036e92b3
2011-12-20Another round of making local functions staticBertrik Sikken
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31384 a1c6a512-1295-4272-9138-f99709370657
2011-12-06Fix FS#12423 : Rockbox access to /.rockbox/fonts after usb_enable(true). ↵Boris Gjenero
This fixes entry into USB mode on the Archos Recorder V2 and possibly also other targets using a USB to IDE bridge chip. Fred Bauer found this removes the need for a workaround in glyph_cache_save(). I'm including his patch which removes the workaround. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31155 a1c6a512-1295-4272-9138-f99709370657
2011-11-27Guard font functions against invalid font ids. These arguably should never ↵Frank Gevaerts
be passed, but this prevents freezes. Fixes FS#12400 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31075 a1c6a512-1295-4272-9138-f99709370657
2011-11-27Actually make glyph_cache_save static instead of just claiming it should beFrank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31074 a1c6a512-1295-4272-9138-f99709370657
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-20Fix parameter order in font_load_in_memory(). FS#12395.Fred Bauer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31033 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-11-03Make local functions and variables static where possibleBertrik Sikken
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30897 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-21Add empty font_lock() for bootloaders to fix builds.Dominik Riebeling
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30817 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-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-10-14Fix yellowFred Bauer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30753 a1c6a512-1295-4272-9138-f99709370657
2011-10-14Remove font_reset() which tried to fetch font *pfs from uninitiaized ↵Fred Bauer
buflib_allocations. Change handle locking to track number of locks applied. Remove some duplicated code from internal_load_font() git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30752 a1c6a512-1295-4272-9138-f99709370657
2011-10-14Don't make font available via buflib_allocations[] until fully loadedFred Bauer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30750 a1c6a512-1295-4272-9138-f99709370657
2011-10-07Add two macros for char*-based pointer arithmetic and use it in font.cThomas Martitz
This fixes errornous pointer addition (+ on a short*), which crashed in some situation. Fixes FS#12317 and should hopefully get the clips booting again. Thanks to Jonathan Gordon for spotting the bad pointer arithmetic. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30724 a1c6a512-1295-4272-9138-f99709370657
2011-10-05Only alloc if necessary. Patch by Jonathan Gordon.Björn Stenberg
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30716 a1c6a512-1295-4272-9138-f99709370657
2011-09-29Don't leak file descriptor.Thomas Martitz
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30619 a1c6a512-1295-4272-9138-f99709370657
2011-09-29font_load(): Reduce font memory allocation to the font's file size if less ↵Fred Bauer
than MAX_FONT_SIZE git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30618 a1c6a512-1295-4272-9138-f99709370657
2011-09-27Do not move NULL pointers in buflibmove_callback(). Fixes some skin crashes ↵Fred Bauer
when changing themes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30610 a1c6a512-1295-4272-9138-f99709370657
2011-09-26glyph_bytes() should pad to an even numberFred Bauer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30606 a1c6a512-1295-4272-9138-f99709370657
2011-09-25Fix typos. Should have test compiled at least once :\Thomas Martitz
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30604 a1c6a512-1295-4272-9138-f99709370657
2011-09-25Fonts/buflib: The lru cache base poitner needs to be updated as well in the ↵Thomas Martitz
move callback. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30603 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
2011-02-27iPod Classic CE-ATA Support (Part 1 of 4: Cacheline align some statically ↵Michael Sparmann
allocated sector buffers) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29444 a1c6a512-1295-4272-9138-f99709370657
2011-02-02Clean up multiple definitions of RAM size. Remove -DMEM (make) and MEM ↵Andree Buschmann
(code), use the already defined MEMORYSIZE instead. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29189 a1c6a512-1295-4272-9138-f99709370657
2010-12-06Get rid of get_user_file_path and do the path handling in wrappers for ↵Thomas Martitz
open() and friends. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28752 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-27close file when cached font load failsFred Bauer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27910 a1c6a512-1295-4272-9138-f99709370657
2010-08-27limit font_cache preloading to cache capacityFred Bauer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27909 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-08-23Read glyph cache in disk order to speed up loading - FS#11168 by Fred BauerFrank Gevaerts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27864 a1c6a512-1295-4272-9138-f99709370657
2010-08-01Rockbox as an application: add get_user_file_path().Thomas Martitz
For RaaA it evaluates user paths at runtime. For everything but codecs/plugins it will give the path under $HOME/.config/rockbox.org if write access is needed or if the file/folder in question exists there (otherwise it gives /usr/local/share/rockbox). This allows for installing themes under $HOME as well as having config.cfg and other important files there while installing the application (and default themes) under /usr/local. On the DAPs it's a no-op, returing /.rockbox directly. Not converted to use get_user_file_path() are plugins themselves, because RaaA doesn't build plugins yet. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27656 a1c6a512-1295-4272-9138-f99709370657
2010-06-23revert r27027,27028, 27071 - need to find a correct way to close font fd's. ↵Jonathan Gordon
27027 caused data aborts, 27028 caused multifont issues after returning from usb git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27072 a1c6a512-1295-4272-9138-f99709370657
2010-06-23redo r27027 to hopefully fix data aborts when loading a themeJonathan Gordon
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27071 a1c6a512-1295-4272-9138-f99709370657
2010-06-21Allow UI fonts to be unloaded (needed for FS#11428)Michael Sparmann
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27027 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Make open() posix compliant api-wise. A few calls (those with O_CREAT) need ↵Thomas Martitz
the additional optional mode parameter so add it. Impact for the core is almost zero, as open() is a wrapper macro for the real open function which doesn't take the variable parameter. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25844 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Make creat() posix compliant API-wise. Shouldn't affect the core as it's ↵Thomas Martitz
wrapped via a static inline. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25843 a1c6a512-1295-4272-9138-f99709370657