From 4d1897863f30817d3e8beb6e3be1f1115402f8b5 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 20 Dec 2013 21:31:50 +0000 Subject: Extend libteken to support CJK fullwidth characters. Introduce a new formatting bit (TF_CJK_RIGHT) that is set when putting a cell that is the right part of a CJK fullwidth character. This will allow drivers like vt(9) to support fullwidth characters properly. emaste@ has a patch to extend vt(9)'s font handling to increase the number of Unicode -> glyph maps from 2 ({normal,bold)} to 4 ({normal,bold} x {left,right}). This will need to use this formatting bit to determine whether to draw the left or right glyph. Reviewed by: emaste --- sys/dev/syscons/scterm-teken.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/dev/syscons') diff --git a/sys/dev/syscons/scterm-teken.c b/sys/dev/syscons/scterm-teken.c index e2e9118..43f16fa 100644 --- a/sys/dev/syscons/scterm-teken.c +++ b/sys/dev/syscons/scterm-teken.c @@ -553,7 +553,14 @@ scteken_putchar(void *arg, const teken_pos_t *tp, teken_char_t c, vm_offset_t p; int cursor, attr; + /* + * No support for printing right hand sides for CJK fullwidth + * characters. Simply print a space and assume that the left + * hand side describes the entire character. + */ attr = scteken_attr(a) << 8; + if (a->ta_format & TF_CJK_RIGHT) + c = ' '; #ifdef TEKEN_UTF8 scteken_get_cp437(&c, &attr); #endif /* TEKEN_UTF8 */ -- cgit v1.1