From 45e3044ed47fcaab15579da516df8922b3b48954 Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Sun, 1 Aug 2010 13:52:04 +0200 Subject: Add wide character support to the Hurd console * hurd/console.h (CONS_WCHAR_MASK, CONS_WCHAR_CONTINUED): New macros. * console/console.c: Include (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. --- console/console.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'console/console.c') 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 #include #include +#include #include #include @@ -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 (); -- cgit v1.2.3