forked from len0rd/rockbox
waiting is over: initial unicode commit
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8169 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
01917ec980
commit
b0fee17d6e
70 changed files with 253032 additions and 14343 deletions
|
|
@ -28,6 +28,7 @@
|
|||
#include "system.h"
|
||||
#include "font.h"
|
||||
#include "hwcompat.h"
|
||||
#include "rbunicode.h"
|
||||
#include "bidi.h"
|
||||
|
||||
/*** definitions ***/
|
||||
|
|
@ -844,13 +845,13 @@ void lcd_bitmap(const unsigned char *src, int x, int y, int width, int height)
|
|||
/* put a string at a given pixel position, skipping first ofs pixel columns */
|
||||
static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str)
|
||||
{
|
||||
int ch;
|
||||
unsigned short ch;
|
||||
unsigned short *ucs;
|
||||
struct font* pf = font_get(curfont);
|
||||
|
||||
if (bidi_support_enabled)
|
||||
str = bidi_l2v(str, 1);
|
||||
ucs = bidi_l2v(str, 1);
|
||||
|
||||
while ((ch = *str++) != '\0' && x < LCD_WIDTH)
|
||||
while ((ch = *ucs++) != 0 && x < LCD_WIDTH)
|
||||
{
|
||||
int width;
|
||||
const unsigned char *bits;
|
||||
|
|
@ -861,7 +862,7 @@ static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str)
|
|||
ch -= pf->firstchar;
|
||||
|
||||
/* get proportional width and glyph bits */
|
||||
width = pf->width ? pf->width[ch] : pf->maxwidth;
|
||||
width = font_get_width(pf,ch);
|
||||
|
||||
if (ofs > width)
|
||||
{
|
||||
|
|
@ -869,8 +870,7 @@ static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str)
|
|||
continue;
|
||||
}
|
||||
|
||||
bits = pf->bits + (pf->offset ?
|
||||
pf->offset[ch] : ((pf->height + 7) / 8 * pf->maxwidth * ch));
|
||||
bits = font_get_bits(pf, ch);
|
||||
|
||||
lcd_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height);
|
||||
|
||||
|
|
@ -898,7 +898,7 @@ void lcd_puts_style(int x, int y, const unsigned char *str, int style)
|
|||
return;
|
||||
|
||||
lcd_getstringsize(str, &w, &h);
|
||||
xpos = xmargin + x*w / strlen(str);
|
||||
xpos = xmargin + x*w / utf8length(str);
|
||||
ypos = ymargin + y*h;
|
||||
lcd_putsxy(xpos, ypos, str);
|
||||
drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID);
|
||||
|
|
@ -1007,7 +1007,7 @@ void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style)
|
|||
end = strchr(s->line, '\0');
|
||||
strncpy(end, string, LCD_WIDTH/2);
|
||||
|
||||
s->len = strlen(string);
|
||||
s->len = utf8length(string);
|
||||
s->offset = 0;
|
||||
s->startx = x;
|
||||
s->backward = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue