[w3m-dev 04213] update Unicode charcters' width

This commit is contained in:
Dai Sato
2007-05-23 11:34:09 +00:00
parent 5441e3a0ae
commit e67286c23c
4 changed files with 16 additions and 7 deletions

View File

@@ -1,14 +1,15 @@
#define N_ucs_wide_map 10
#define N_ucs_wide_map 11
static wc_map ucs_wide_map[ N_ucs_wide_map ] = {
{ 0x1100, 0x115F },
{ 0x2E80, 0x3009 },
{ 0x300C, 0x3019 },
{ 0x301C, 0x303E },
{ 0x3040, 0xA4CF },
{ 0x2329, 0x232A },
{ 0x2E80, 0x303E },
{ 0x3040, 0x4DBF },
{ 0x4E00, 0xA4CF },
{ 0xAC00, 0xD7A3 },
{ 0xF900, 0xFAFF },
{ 0xFE10, 0xFE19 },
{ 0xFE30, 0xFE6F },
{ 0xFF00, 0xFF5F },
{ 0xFFE0, 0xFFE6 },

View File

@@ -522,7 +522,8 @@ wc_is_ucs_wide(wc_uint32 ucs)
return (wc_map_range_search((wc_uint16)ucs,
ucs_wide_map, N_ucs_wide_map) != NULL);
else
return ((ucs & ~0xFFFF) == WC_C_UCS4_PLANE2);
return ((ucs & ~0xFFFF) == WC_C_UCS4_PLANE2 ||
(ucs & ~0xFFFF) == WC_C_UCS4_PLANE3);
}
wc_bool

View File

@@ -22,6 +22,7 @@
#define WC_C_CANCEL_TAG 0xE007F
#define WC_C_UCS4_PLANE1 0x10000
#define WC_C_UCS4_PLANE2 0x20000
#define WC_C_UCS4_PLANE3 0x30000
#define wc_ucs_tag_to_ucs(c) ((c) & WC_C_UNICODE_MASK)
#define wc_ucs_tag_to_tag(c) ((c) >> 24)