mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
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.
This commit is contained in:
1 parent
e70cb72f73
commit
3049237440
2 files changed
+12
-16
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user