diff options
Diffstat (limited to 'firmware/drivers/lcd-recorder.c')
-rw-r--r-- | firmware/drivers/lcd-recorder.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c index 7e064b8001..081a7a5267 100644 --- a/firmware/drivers/lcd-recorder.c +++ b/firmware/drivers/lcd-recorder.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include "system.h" | 28 | #include "system.h" |
29 | #include "font.h" | 29 | #include "font.h" |
30 | #include "hwcompat.h" | 30 | #include "hwcompat.h" |
31 | #include "rbunicode.h" | ||
31 | #include "bidi.h" | 32 | #include "bidi.h" |
32 | 33 | ||
33 | /*** definitions ***/ | 34 | /*** definitions ***/ |
@@ -844,13 +845,13 @@ void lcd_bitmap(const unsigned char *src, int x, int y, int width, int height) | |||
844 | /* put a string at a given pixel position, skipping first ofs pixel columns */ | 845 | /* put a string at a given pixel position, skipping first ofs pixel columns */ |
845 | static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str) | 846 | static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str) |
846 | { | 847 | { |
847 | int ch; | 848 | unsigned short ch; |
849 | unsigned short *ucs; | ||
848 | struct font* pf = font_get(curfont); | 850 | struct font* pf = font_get(curfont); |
849 | 851 | ||
850 | if (bidi_support_enabled) | 852 | ucs = bidi_l2v(str, 1); |
851 | str = bidi_l2v(str, 1); | ||
852 | 853 | ||
853 | while ((ch = *str++) != '\0' && x < LCD_WIDTH) | 854 | while ((ch = *ucs++) != 0 && x < LCD_WIDTH) |
854 | { | 855 | { |
855 | int width; | 856 | int width; |
856 | const unsigned char *bits; | 857 | const unsigned char *bits; |
@@ -861,7 +862,7 @@ static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str) | |||
861 | ch -= pf->firstchar; | 862 | ch -= pf->firstchar; |
862 | 863 | ||
863 | /* get proportional width and glyph bits */ | 864 | /* get proportional width and glyph bits */ |
864 | width = pf->width ? pf->width[ch] : pf->maxwidth; | 865 | width = font_get_width(pf,ch); |
865 | 866 | ||
866 | if (ofs > width) | 867 | if (ofs > width) |
867 | { | 868 | { |
@@ -869,8 +870,7 @@ static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str) | |||
869 | continue; | 870 | continue; |
870 | } | 871 | } |
871 | 872 | ||
872 | bits = pf->bits + (pf->offset ? | 873 | bits = font_get_bits(pf, ch); |
873 | pf->offset[ch] : ((pf->height + 7) / 8 * pf->maxwidth * ch)); | ||
874 | 874 | ||
875 | lcd_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height); | 875 | lcd_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height); |
876 | 876 | ||
@@ -898,7 +898,7 @@ void lcd_puts_style(int x, int y, const unsigned char *str, int style) | |||
898 | return; | 898 | return; |
899 | 899 | ||
900 | lcd_getstringsize(str, &w, &h); | 900 | lcd_getstringsize(str, &w, &h); |
901 | xpos = xmargin + x*w / strlen(str); | 901 | xpos = xmargin + x*w / utf8length(str); |
902 | ypos = ymargin + y*h; | 902 | ypos = ymargin + y*h; |
903 | lcd_putsxy(xpos, ypos, str); | 903 | lcd_putsxy(xpos, ypos, str); |
904 | drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); | 904 | drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); |
@@ -1007,7 +1007,7 @@ void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style) | |||
1007 | end = strchr(s->line, '\0'); | 1007 | end = strchr(s->line, '\0'); |
1008 | strncpy(end, string, LCD_WIDTH/2); | 1008 | strncpy(end, string, LCD_WIDTH/2); |
1009 | 1009 | ||
1010 | s->len = strlen(string); | 1010 | s->len = utf8length(string); |
1011 | s->offset = 0; | 1011 | s->offset = 0; |
1012 | s->startx = x; | 1012 | s->startx = x; |
1013 | s->backward = false; | 1013 | s->backward = false; |