|
Rockbox mail archiveSubject: Hebrew: bidirectional patch (782511)Hebrew: bidirectional patch (782511)
From: Gadi Cohen <dragon_at_wastelands.net>
Date: Mon, 4 Aug 2003 01:03:37 +0200 This patch introduces a compile time option which will correctly display hebrew text, from right-to-left, from inside of rockbox. It is emplemented on an 'OS' level, meaning any text displayed through the firmware will be affected (including directly display, wps and text file viewer). [Read on for more technical info.] This was mostly a quick hack, using some Hebrew code I found (and modded) in BitchX by crisk. Using the Unicode BiDi algorythm on an application level seemed a bit of an overkill, especially since we have no need for logical-to-visual mapping for cut and paste, or vice versa. Ideally we might have wanted a right-to-left interface / 'document direction', but for me this patch is more than adequate. The code affects any text with an ASCII value between 224 and 250 (according to ISO8859-8, the encoding generally used in Hebrew filesystems) but the macros could probably be modified very easily to include Arabic characters aswell. Only major problem: on my rockbox, whenever the scrolling algorythm is called, I get some junk appearing on the 2nd last column of all non scrolling lines. This does not happen in the UI simulator. My main change is a "str = hebrew_process(str)" in lcd_putsxyofs, and it seems the problem only manifests itself when s->offset > 0. Maybe someone familiar with the LCD code can comment. Nevertheless despite this oddity the code _seems_ stable and I've been quite enjoying it. Only other cause for attention: I wasn't sure how big to make the buffers, so set some fairly arbitary values. This should probably be something like sizeof(scrollinfo->line) but I thought I'd leave this to someone who is actually sure what kind of data gets pumped into the putsxyofs routine. _____ Gadi Cohen Habonim Dror Southern Africa National Youth Worker and Webmaster גדי כהן הבונים דרור דרום אפריקה עובד נוער ארצי ומומחה רשת Cell: +27 84 555 4234 Israel: +927 55 204 878 email: <mailto:gadi_at_habo.org.za> gadi_at_habo.org.za Received on 2003-08-04 Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy |