summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-01 13:52:04 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2010-08-01 14:02:43 +0200
commit45e3044ed47fcaab15579da516df8922b3b48954 (patch)
tree7e0c4ca4d49afba73218f8fd51c40cce52eae996 /hurd
parentee096c09818baf60ef2f8bafc421171ceadd8e18 (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 'hurd')
-rw-r--r--hurd/console.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/hurd/console.h b/hurd/console.h
index 065ed7d2..16bc068d 100644
--- a/hurd/console.h
+++ b/hurd/console.h
@@ -50,7 +50,13 @@ typedef struct
uint32_t italic : 1;
uint32_t bold : 1;
} conchar_attr_t;
-
+
+/* We support double-width characters by using an extra bit to identify the
+ continuation in the character matrix. The constants below document our
+ usage of wchar_t. */
+#define CONS_WCHAR_MASK ((wchar_t) 0x401fffff)
+#define CONS_WCHAR_CONTINUED ((wchar_t) 0x40000000)
+
typedef struct
{
wchar_t chr;