diff options
author | Takamichi Horikawa <takamichiho@gmail.com> | 2017-08-16 23:55:51 +0900 |
---|---|---|
committer | Takamichi Horikawa <takamichiho@gmail.com> | 2017-08-16 23:55:51 +0900 |
commit | dc476f36eb1847a9f1e6a8adcfdd83fc3a0e87ef (patch) | |
tree | d3d0edff4f504bdd9c38f82b315891decc8ed219 /win32/winfont.c | |
parent | df77159e29d62a805f29597d4ebb5b441af416c8 (diff) |
fixed doublebyte-halfwidth katakana, added default shinonome font to gtk
Diffstat (limited to 'win32/winfont.c')
-rw-r--r-- | win32/winfont.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/win32/winfont.c b/win32/winfont.c index 226f4df..1ed7a78 100644 --- a/win32/winfont.c +++ b/win32/winfont.c @@ -73,11 +73,18 @@ static const void *winfont_get(const struct fmdsp_font *font, TextOut(fw->dc, 0, 0, text, 1); break; case FMDSP_FONT_JIS_LEFT: - if (c>>8 == 0x29) { - // doublebyte halfwidth - text[0] = jis2unih(c & 0xff); - } else { - text[0] = jis2uni(c); + { + uint8_t row = c >> 8; + if (row == 0x29 || row == 0x2a) { + // doublebyte halfwidth ANK + // JIS doublewidth JIS halfwidth + // 0x2921-0x297e -> 0x21-0x7e (ASCII) + // 0x2a21-0x2a7e -> 0xa1-0xfe (halfwidth katakana) + uint16_t jis = (c & 0xff) | ((row-0x29) * 0x80); + text[0] = jis2unih(jis); + } else { + text[0] = jis2uni(c); + } } TextOut(fw->dc, 0, 0, text, 1); break; |