diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/bidi.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/firmware/bidi.c b/firmware/bidi.c index 336291f68d..539c64a127 100644 --- a/firmware/bidi.c +++ b/firmware/bidi.c | |||
@@ -28,13 +28,14 @@ | |||
28 | #include "arabjoin.h" | 28 | #include "arabjoin.h" |
29 | #include "scroll_engine.h" | 29 | #include "scroll_engine.h" |
30 | 30 | ||
31 | //#define _HEB_BUFFER_LENGTH (MAX_PATH + LCD_WIDTH/2 + 3 + 2 + 2) * 2 | 31 | /* #define _HEB_BUFFER_LENGTH (MAX_PATH + LCD_WIDTH/2 + 3 + 2 + 2) * 2 */ |
32 | #define _HEB_BLOCK_TYPE_ENG 1 | 32 | #define _HEB_BLOCK_TYPE_ENG 1 |
33 | #define _HEB_BLOCK_TYPE_HEB 0 | 33 | #define _HEB_BLOCK_TYPE_HEB 0 |
34 | #define _HEB_ORIENTATION_LTR 1 | 34 | #define _HEB_ORIENTATION_LTR 1 |
35 | #define _HEB_ORIENTATION_RTL 0 | 35 | #define _HEB_ORIENTATION_RTL 0 |
36 | 36 | ||
37 | #define ischar(c) ((c > 0x0589 && c < 0x0700) || (c >= 0xfb50 && c <= 0xfefc) ? 1 : 0) | 37 | #define ischar(c) ((c > 0x0589 && c < 0x0700) || \ |
38 | (c >= 0xfb50 && c <= 0xfefc) ? 1 : 0) | ||
38 | #define _isblank(c) ((c==' ' || c=='\t') ? 1 : 0) | 39 | #define _isblank(c) ((c==' ' || c=='\t') ? 1 : 0) |
39 | #define _isnewline(c) ((c=='\n' || c=='\r') ? 1 : 0) | 40 | #define _isnewline(c) ((c=='\n' || c=='\r') ? 1 : 0) |
40 | #define XOR(a,b) ((a||b) && !(a&&b)) | 41 | #define XOR(a,b) ((a||b) && !(a&&b)) |
@@ -134,12 +135,14 @@ unsigned short *bidi_l2v(const unsigned char *str, int orientation) | |||
134 | int length = utf8length(str); | 135 | int length = utf8length(str); |
135 | static unsigned short utf16_buf[SCROLL_LINE_SIZE]; | 136 | static unsigned short utf16_buf[SCROLL_LINE_SIZE]; |
136 | static unsigned short bidi_buf[SCROLL_LINE_SIZE]; | 137 | static unsigned short bidi_buf[SCROLL_LINE_SIZE]; |
137 | unsigned short *heb_str, *target, *tmp; // *broken_str | 138 | unsigned short *heb_str, *target, *tmp; /* *broken_str */ |
138 | int block_start, block_end, block_type, block_length, i; | 139 | int block_start, block_end, block_type, block_length, i; |
139 | //long max_chars=0; | 140 | /* |
140 | //int begin, end, char_count, orig_begin; | 141 | long max_chars=0; |
142 | int begin, end, char_count, orig_begin; | ||
141 | 143 | ||
142 | //tmp = str; | 144 | tmp = str; |
145 | */ | ||
143 | target = tmp = utf16_buf; | 146 | target = tmp = utf16_buf; |
144 | while (*str) | 147 | while (*str) |
145 | str = utf8decode(str, target++); | 148 | str = utf8decode(str, target++); |
@@ -186,7 +189,8 @@ unsigned short *bidi_l2v(const unsigned char *str, int orientation) | |||
186 | } | 189 | } |
187 | 190 | ||
188 | for (i=block_start; i<=block_end; i++) { | 191 | for (i=block_start; i<=block_end; i++) { |
189 | *target = (block_type == orientation) ? *(utf16_buf+i) : *(utf16_buf+block_end-i+block_start); | 192 | *target = (block_type == orientation) ? |
193 | *(utf16_buf+i) : *(utf16_buf+block_end-i+block_start); | ||
190 | if (block_type!=orientation) { | 194 | if (block_type!=orientation) { |
191 | switch (*target) { | 195 | switch (*target) { |
192 | case '(': | 196 | case '(': |