diff --git a/ChangeLog b/ChangeLog index 76dea17a9..6aa1a8a59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-01-12 Vladimir Serbinenko + + Fix handling of wide characters in gfxterm. + + * grub-core/term/gfxterm.c (grub_colored_char): Remove width and index. + (clear_char): Likewise. + (paint_char): Skip code == NULL chars. + (grub_gfxterm_putchar): Set code = NULL on "shadowed" positions. + 2012-01-12 Vladimir Serbinenko * grub-core/normal/charset.c: Move comment to right place. diff --git a/grub-core/term/gfxterm.c b/grub-core/term/gfxterm.c index 0eee64105..5ecd7c5b5 100644 --- a/grub-core/term/gfxterm.c +++ b/grub-core/term/gfxterm.c @@ -54,12 +54,6 @@ struct grub_colored_char /* Color values. */ grub_video_color_t fg_color; grub_video_color_t bg_color; - - /* The width of this character minus one. */ - unsigned char width; - - /* The column index of this character. */ - unsigned char index; }; struct grub_virtual_screen @@ -187,8 +181,6 @@ clear_char (struct grub_colored_char *c) grub_errno = GRUB_ERR_NONE; c->fg_color = virtual_screen.fg_color; c->bg_color = virtual_screen.bg_color; - c->width = 0; - c->index = 0; } static void @@ -621,7 +613,8 @@ paint_char (unsigned cx, unsigned cy) p = (virtual_screen.text_buffer + cx + (cy * virtual_screen.columns)); - p -= p->index; + if (!p->code) + return; /* Get glyph for character. */ glyph = grub_font_construct_glyph (virtual_screen.font, p->code); @@ -885,8 +878,6 @@ grub_gfxterm_putchar (struct grub_term_output *term, grub_errno = GRUB_ERR_NONE; p->fg_color = virtual_screen.fg_color; p->bg_color = virtual_screen.bg_color; - p->width = char_width - 1; - p->index = 0; /* If we have large glyph, add fixup info. */ if (char_width > 1) @@ -898,11 +889,7 @@ grub_gfxterm_putchar (struct grub_term_output *term, * virtual_screen.rows; i++) { grub_free (p[i].code); - p[i].code = grub_unicode_glyph_from_code (' '); - if (!p[i].code) - grub_errno = GRUB_ERR_NONE; - p[i].width = char_width - 1; - p[i].index = i; + p[i].code = NULL; } }