Fix tab and wide character handling in editor and menu.
* grub-core/normal/charset.c (grub_unicode_aglomerate_comb): Don't agglomerate control characters with combining marks. (bidi_line_wrap): Allow break on tab. (grub_unicode_get_comb_start): New function. * grub-core/normal/menu_entry.c: Restructure to handle wide characters and tab correctly. * grub-core/normal/menu_text.c (print_entry): Replace \n, \r, \b and \e with a space. * grub-core/normal/term.c (print_ucs4_terminal): New argument fixed_tab_size. All users updated. * include/grub/term.h (GRUB_TERM_TAB_WIDTH): New const. (grub_term_getcharwidth): Handle \t. * include/grub/unicode.h (grub_unicode_glyph_dup): Fix allocation and copy.
This commit is contained in:
parent
22e6a774f9
commit
e1bd676b4e
9 changed files with 320 additions and 189 deletions
|
@ -234,6 +234,12 @@ print_entry (int y, int highlight, grub_menu_entry_t entry,
|
|||
grub_term_gotoxy (term, GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN, y);
|
||||
|
||||
int last_printed = 0;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
if (unicode_title[i] == '\n' || unicode_title[i] == '\b'
|
||||
|| unicode_title[i] == '\r' || unicode_title[i] == '\e')
|
||||
unicode_title[i] = ' ';
|
||||
|
||||
for (x = GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + 1, i = 0;
|
||||
x < (int) (GRUB_TERM_LEFT_BORDER_X + grub_term_border_width (term)
|
||||
- GRUB_TERM_MARGIN);)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue