From 7682cb5ca8f201be74dc12c1388cdd69a6c178bc Mon Sep 17 00:00:00 2001 From: Tomer Shalev Date: Tue, 24 Nov 2009 20:41:42 +0000 Subject: 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 --- firmware/font.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'firmware/font.c') 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); -- cgit v1.1