diff options
-rw-r--r-- | apps/plugins/lib/grey_draw.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/apps/plugins/lib/grey_draw.c b/apps/plugins/lib/grey_draw.c index 51d340dd7f..5879b8e35a 100644 --- a/apps/plugins/lib/grey_draw.c +++ b/apps/plugins/lib/grey_draw.c | |||
@@ -534,20 +534,18 @@ void grey_gray_bitmap(const unsigned char *src, int x, int y, int width, | |||
534 | void grey_putsxyofs(int x, int y, int ofs, const unsigned char *str) | 534 | void grey_putsxyofs(int x, int y, int ofs, const unsigned char *str) |
535 | { | 535 | { |
536 | int ch; | 536 | int ch; |
537 | unsigned short *ucs; | ||
537 | struct font* pf = _grey_info.rb->font_get(_grey_info.curfont); | 538 | struct font* pf = _grey_info.rb->font_get(_grey_info.curfont); |
539 | |||
540 | ucs = _grey_info.rb->bidi_l2v(str, 1); | ||
538 | 541 | ||
539 | while ((ch = *str++) != '\0' && x < _grey_info.width) | 542 | while ((ch = *ucs++) != 0 && x < _grey_info.width) |
540 | { | 543 | { |
541 | int width; | 544 | int width; |
542 | const unsigned char *bits; | 545 | const unsigned char *bits; |
543 | 546 | ||
544 | /* check input range */ | ||
545 | if (ch < pf->firstchar || ch >= pf->firstchar+pf->size) | ||
546 | ch = pf->defaultchar; | ||
547 | ch -= pf->firstchar; | ||
548 | |||
549 | /* get proportional width and glyph bits */ | 547 | /* get proportional width and glyph bits */ |
550 | width = pf->width ? pf->width[ch] : pf->maxwidth; | 548 | width = _grey_info.rb->font_get_width(pf, ch); |
551 | 549 | ||
552 | if (ofs > width) | 550 | if (ofs > width) |
553 | { | 551 | { |
@@ -555,8 +553,7 @@ void grey_putsxyofs(int x, int y, int ofs, const unsigned char *str) | |||
555 | continue; | 553 | continue; |
556 | } | 554 | } |
557 | 555 | ||
558 | bits = pf->bits + (pf->offset ? | 556 | bits = _grey_info.rb->font_get_bits(pf, ch); |
559 | pf->offset[ch] : (((pf->height + 7) >> 3) * pf->maxwidth * ch)); | ||
560 | 557 | ||
561 | grey_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height); | 558 | grey_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height); |
562 | 559 | ||