diff options
author | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-01 13:52:04 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2010-08-01 14:02:43 +0200 |
commit | 45e3044ed47fcaab15579da516df8922b3b48954 (patch) | |
tree | 7e0c4ca4d49afba73218f8fd51c40cce52eae996 /console/console.c | |
parent | ee096c09818baf60ef2f8bafc421171ceadd8e18 (diff) |
Add wide character support to the Hurd console
* hurd/console.h (CONS_WCHAR_MASK, CONS_WCHAR_CONTINUED): New macros.
* console/console.c: Include <locale.h>
(main): Call setlocale.
* console/display.c (display_output_one): Call wcwidth() to know the
width of the character to be displayed. Iterate over this with to insert
characters with the additional CONS_WCHAR_CONTINUED flag. Update
screen_shift_right and display_record_filechange calls accordingly.
* console-client/vga-dynafont.c (WCHAR_BOLD, WCHAR_ITALIC, WCHAR_MASK):
Change macro values.
(dynafont_new): Use glyph->bbox.{width,height} instead of
df->font->bbox.{width,height}.
(dynafont_change_font): Likewise.
(dynafont_lookup_internal): Likewise.
Mask out CONS_WCHAR_CONTINUED before calling bdf_find_glyph, but test it
for the second position of a double-width glyph.
(dynafont_activate): Enable 9-bit width only when font width is not
dividable by 8.
Diffstat (limited to 'console/console.c')
-rw-r--r-- | console/console.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/console/console.c b/console/console.c index 6225d71d..eb2f1f44 100644 --- a/console/console.c +++ b/console/console.c @@ -23,6 +23,7 @@ #include <stdlib.h> #include <stddef.h> #include <unistd.h> +#include <locale.h> #include <argp.h> #include <argz.h> @@ -2018,6 +2019,8 @@ main (int argc, char **argv) /* Parse our command line arguments. */ argp_parse (&netfs_std_runtime_argp, argc, argv, 0, 0, cons); + setlocale (LC_CTYPE, "C.UTF-8"); + task_get_bootstrap_port (mach_task_self (), &bootstrap); netfs_init (); |