diff options
| author | Tomer Shalev <shalev.tomer@gmail.com> | 2009-11-24 20:41:42 +0000 |
|---|---|---|
| committer | Tomer Shalev <shalev.tomer@gmail.com> | 2009-11-24 20:41:42 +0000 |
| commit | 7682cb5ca8f201be74dc12c1388cdd69a6c178bc (patch) | |
| tree | a59dda85dbc95c9dddd69970ee7bcd36cdbba7c0 /firmware/font.c | |
| parent | 640d98de0fe2d7f5447ce2bdaf435108478e451a (diff) | |
| download | rockbox-7682cb5ca8f201be74dc12c1388cdd69a6c178bc.zip rockbox-7682cb5ca8f201be74dc12c1388cdd69a6c178bc.tar.gz rockbox-7682cb5ca8f201be74dc12c1388cdd69a6c178bc.tar.bz2 rockbox-7682cb5ca8f201be74dc12c1388cdd69a6c178bc.tar.xz | |
FS#10720 - Support for displaying diacritic characters
This commit corrects the display of diacritic characters, which exist in many
languages. Hopefully, it will make Rockbox much more usable for users of these
languages.
Diacritic information (which used to decide whether a given character is
diacritic or not) is taken from the Unicode Standard, Version 5.2.
This feature does not affect drawing performance much, as the diacritic
database is cached (simple MRU mechanism).
There may be room for further performance, footprint, and
code-reuse wise improvements, that could be worked on in the future.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23742 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/font.c')
| -rw-r--r-- | firmware/font.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/font.c b/firmware/font.c index e02f276..624e0de 100644 --- a/firmware/font.c +++ b/firmware/font.c @@ -35,6 +35,7 @@ #include "debug.h" #include "panic.h" #include "rbunicode.h" +#include "diacritic.h" #ifndef BOOTLOADER /* Font cache includes */ @@ -604,6 +605,8 @@ int font_getstringsize(const unsigned char *str, int *w, int *h, int fontnumber) for (str = utf8decode(str, &ch); ch != 0 ; str = utf8decode(str, &ch)) { + if (is_diacritic(ch, NULL)) + continue; /* get proportional width and glyph bits*/ width += font_get_width(pf,ch); |