Revision: 10889 https://osdn.net/projects/ttssh2/scm/svn/commits/10889 Author: zmatsuo Date: 2023-09-06 00:35:48 +0900 (Wed, 06 Sep 2023) Log Message: ----------- DEC Speical Graphics の誤り修正、置き換え文字の追加 - DEC Speical Graphics の範囲 0x5f - 0x7e - 修正前 0x60 - 0x7f - 0x5f, 0x7f は表示しないため問題なかったと思われる - 0x5f は NBSP(スペース) - 0x7f は DEL - Unicode -> DEC Speical Graphics 対応文字を追加した - unisym2decsp.map にデータを追加 - Unicode -> DEC Speical Graphics テスト用スクリプト追加 - tests/various_code_texts/dec_special_unicode.pl Modified Paths: -------------- trunk/doc/en/html/about/emulations.html trunk/doc/ja/html/about/emulations.html trunk/teraterm/teraterm/charset.cpp trunk/teraterm/teraterm/unisym2decsp.map trunk/teraterm/teraterm/vtterm.c trunk/tests/various_code_texts/dump_code.pl Added Paths: ----------- trunk/tests/various_code_texts/dec_special_unicode.pl -------------- next part -------------- Modified: trunk/doc/en/html/about/emulations.html =================================================================== --- trunk/doc/en/html/about/emulations.html 2023-09-03 15:21:34 UTC (rev 10888) +++ trunk/doc/en/html/about/emulations.html 2023-09-05 15:35:48 UTC (rev 10889) @@ -25,7 +25,7 @@ <b>[*1] DEC special font</b><br> The line drawing characters by using the Linux TUI(Text User Interface) are controlled as the DEC special font(Tera Special font). The special font is defined as the <ESC>(0 escape -sequence, and assigned to the line drawing character from 0140(0x60) to 0176(0x7f). <br> +sequence, and assigned to the line drawing character from 0137(0x5f) to 0176(0x7e). <br> Reference: <a href="qanda.html#dec_special_graphic">Frequently asked questions</a> </p> Modified: trunk/doc/ja/html/about/emulations.html =================================================================== --- trunk/doc/ja/html/about/emulations.html 2023-09-03 15:21:34 UTC (rev 10888) +++ trunk/doc/ja/html/about/emulations.html 2023-09-05 15:35:48 UTC (rev 10889) @@ -25,7 +25,7 @@ <b>[*1] DEC\x93\xC1\x8E\xEA\x83t\x83H\x83\x93\x83g</b><br> Linux\x82\xCCTUI(Text User Interface)\x82ȂǂŎg\x82\xED\x82\xEA\x82\xE9\x8Cr\x90\xFC\x82́ADEC\x93\xC1\x8E\xEA\x83t\x83H\x83\x93\x83g(Tera Special font)\x82Ƃ\xB5\x82ď\x88\x97\x9D\x82\xB5\x82܂\xB7\x81B DEC\x93\xC1\x8E\xEA\x83t\x83H\x83\x93\x83g\x82́A<ESC>(0 \x82Ƃ\xA2\x82\xA4\x93\xC1\x8E\xEA\x82ȃG\x83X\x83P\x81[\x83v\x83V\x81[\x83P\x83\x93\x83X\x82Œ\xE8\x8B`\x82\xB3\x82\xEA\x82Ă\xA8\x82\xE8\x81A -0140(0x60) \x81` 0176(0x7f) \x82Ɍr\x90\xFC\x82ŃA\x83T\x83C\x83\x93\x82\xB3\x82\xEA\x82Ă\xA2\x82܂\xB7\x81B<br> +0137(0x5f) \x81` 0176(0x7e) \x82Ɍr\x90\xFC\x82ŃA\x83T\x83C\x83\x93\x82\xB3\x82\xEA\x82Ă\xA2\x82܂\xB7\x81B<br> \x8EQ\x8F\xC6: <a href="qanda.html#dec_special_graphic">Q & A\x8FW</a> </p> Modified: trunk/teraterm/teraterm/charset.cpp =================================================================== --- trunk/teraterm/teraterm/charset.cpp 2023-09-03 15:21:34 UTC (rev 10888) +++ trunk/teraterm/teraterm/charset.cpp 2023-09-05 15:35:48 UTC (rev 10889) @@ -969,9 +969,9 @@ } /** - * DEC\x93\xC1\x8E\xEA\x83t\x83H\x83\x93\x83g(Tera Special font) - * 0140(0x60) ... 0176(0x7f) \x82Ɍr\x90\xFC\x82ŃA\x83T\x83C\x83\x93\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9 - * (0xe0) ... (0xff) \x82\xE0? + * DEC\x93\xC1\x8E\xEA\x83t\x83H\x83\x93\x83g(DEC Special Graphics, DSG) + * 0137(0x5f) ... 0176(0x7e) \x82Ɍr\x90\xFC\x82ŃA\x83T\x83C\x83\x93\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9 + * (0xdf) ... (0xfe) \x82\xE0? * <ESC>(0 \x82Ƃ\xA2\x82\xA4\x93\xC1\x8E\xEA\x82ȃG\x83X\x83P\x81[\x83v\x83V\x81[\x83P\x83\x93\x83X\x82Œ\xE8\x8B` * about/emulations.html * @@ -983,17 +983,21 @@ { BOOL SpecialNew = FALSE; - if ((b>0x5F) && (b<0x80)) { - if (w->SSflag) - SpecialNew = (w->Gn[w->GLtmp]==IdSpecial); - else - SpecialNew = (w->Gn[w->Glr[0]]==IdSpecial); + if ((b >= 0x5F) && (b < 0x7f)) { + if (w->SSflag) { + SpecialNew = (w->Gn[w->GLtmp] == IdSpecial); + } + else { + SpecialNew = (w->Gn[w->Glr[0]] == IdSpecial); + } } - else if (b>0xDF) { - if (w->SSflag) - SpecialNew = (w->Gn[w->GLtmp]==IdSpecial); - else - SpecialNew = (w->Gn[w->Glr[1]]==IdSpecial); + else if ((b >= 0xDF) && (b < 0xff)) { + if (w->SSflag) { + SpecialNew = (w->Gn[w->GLtmp] == IdSpecial); + } + else { + SpecialNew = (w->Gn[w->Glr[1]] == IdSpecial); + } } return SpecialNew; Modified: trunk/teraterm/teraterm/unisym2decsp.map =================================================================== --- trunk/teraterm/teraterm/unisym2decsp.map 2023-09-03 15:21:34 UTC (rev 10888) +++ trunk/teraterm/teraterm/unisym2decsp.map 2023-09-05 15:35:48 UTC (rev 10889) @@ -31,6 +31,9 @@ * Map of Unicode Symbols to Dec Special Characters */ static const codemap_t mapUnicodeSymbolToDecSp[] = { + { 0x00b0, 0x0266 }, // DEGREE SIGN + { 0x00b1, 0x0267 }, // PLUS-MINUS SIGN + /* * Latin-1 supplement * http://www.unicode.org/charts/PDF/U0080.pdf @@ -37,6 +40,8 @@ */ { 0x00B7, 0x047E }, // Middle dot + { 0x03c0, 0x047b }, + /* * General punctuation * http://www.unicode.org/charts/PDF/U2000.pdf @@ -50,8 +55,19 @@ * http://www.unicode.org/charts/PDF/U2200.pdf */ { 0x2219, 0x047E }, // Bullet operator + { 0x2260, 0x047c }, // NOT EQUAL TO + { 0x2264, 0x0479 }, // LESS-THAN OR EQUAL TO + { 0x2265, 0x047a }, // GREATER-THAN OR EQUAL TO /* + * Horizontal Scan line + */ + { 0x23BA, 0x016f }, // HORIZONTAL SCAN LINE-1 + { 0x23BB, 0x0170 }, // HORIZONTAL SCAN LINE-3 + { 0x23BC, 0x0172 }, // HORIZONTAL SCAN LINE-7 + { 0x23BD, 0x0173 }, // HORIZONTAL SCAN LINE-9 + + /* * Box drawing * http://www.unicode.org/charts/PDF/U2500.pdf */ @@ -201,6 +217,7 @@ */ { 0x25AA, 0x027E }, // Black small square { 0x25AE, 0x0260 }, // Black vertical rectangle + { 0x25c6, 0x0260 }, // BLACK DIAMOND /* * Miscellaneous symbols and arrows Modified: trunk/teraterm/teraterm/vtterm.c =================================================================== --- trunk/teraterm/teraterm/vtterm.c 2023-09-03 15:21:34 UTC (rev 10888) +++ trunk/teraterm/teraterm/vtterm.c 2023-09-05 15:35:48 UTC (rev 10889) @@ -751,8 +751,13 @@ if (dec_special) { // DEC\x93\xC1\x8Eꕶ\x8E\x9A\x82\xA9\x82\xE7Unicode\x82ւ̃}\x83b\x83s\x83\x93\x83O if (ts.Dec2Unicode) { - // 0x60\x82\xA9\x82\xE70x7e \x82\xF0 Unicode \x82Ɋ\x84\x82\xE8\x90U\x82\xE9 + // 0x5f\x82\xA9\x82\xE70x7e \x82\xF0 Unicode \x82Ɋ\x84\x82\xE8\x90U\x82\xE9 + // Unicode\x82ւ̃}\x83b\x83s\x83\x93\x83O\x82\xCD + // DEC Special Graphics(Wikipedia en)\x82\xCCUnicode\x82\xF0\x8EQ\x8Dl\x82ɂ\xB5\x82\xBD + // https://en.wikipedia.org/wiki/DEC_Special_Graphics static const char16_t dec2unicode[] = { + 0x00a0, // 0x5f + 0x25c6, 0x2592, 0x2409, 0x240c, // 0x60 - 0x240d, 0x240a, 0x00b0, 0x00b1, 0x2424, 0x240b, 0x2518, 0x2510, @@ -764,8 +769,8 @@ 0x2260, 0x00a3, 0x00b7, // 0x7c - 0x7e }; code = code & 0x7F; - if (0x60 <= code && code <= 0x7e) { - code = dec2unicode[code - 0x60]; + if (0x5f <= code && code <= 0x7e) { + code = dec2unicode[code - 0x5f]; dec_special = FALSE; } } Added: trunk/tests/various_code_texts/dec_special_unicode.pl =================================================================== --- trunk/tests/various_code_texts/dec_special_unicode.pl (rev 0) +++ trunk/tests/various_code_texts/dec_special_unicode.pl 2023-09-05 15:35:48 UTC (rev 10889) @@ -0,0 +1,51 @@ +# DEC Special Graphic - Unicode + +use utf8; + +binmode STDOUT, ":utf8"; +local $| = 1; + +# +print " 0123456789ABCDEF\n"; + +print "0x5f: "; +print " \N{U+00a0}"; +print "|\n"; + +print "0x60: "; +print "\N{U+25c6}"; +print "\N{U+2592}"; +print "\N{U+2409}"; +print "\N{U+240c}"; +print "\N{U+240d}"; +print "\N{U+240a}"; +print "\N{U+00b0}"; +print "\N{U+00b1}"; +print "\N{U+2424}"; +print "\N{U+240b}"; +print "\N{U+2518}"; +print "\N{U+2510}"; +print "\N{U+250c}"; +print "\N{U+2514}"; +print "\N{U+253c}"; +print "\N{U+23ba}"; +print "|\n"; + +print "0x70: "; +print "\N{U+23bb}"; +print "\N{U+2500}"; +print "\N{U+23bc}"; +print "\N{U+23bd}"; +print "\N{U+251c}"; +print "\N{U+2524}"; +print "\N{U+2534}"; +print "\N{U+252c}"; +print "\N{U+2502}"; +print "\N{U+2264}"; +print "\N{U+2265}"; +print "\N{U+03c0}"; +print "\N{U+2260}"; +print "\N{U+00a3}"; +print "\N{U+00b7}"; +print " "; +print "|\n" Modified: trunk/tests/various_code_texts/dump_code.pl =================================================================== --- trunk/tests/various_code_texts/dump_code.pl 2023-09-03 15:21:34 UTC (rev 10888) +++ trunk/tests/various_code_texts/dump_code.pl 2023-09-05 15:35:48 UTC (rev 10889) @@ -309,8 +309,8 @@ print "C1(0x80-0x9F) & GR(0xA0-0xFF):\n"; ShowCode('jis', 0x80, 0xff); } elsif ($c eq 'd') { - print "DEC Special Graphics, GL, 0x5F-0x7F\n"; - # 5F-7F以外はASCII + print "DEC Special Graphics, GL, 0x5F-0x7E\n"; + # 5F-7E以外はASCII $invoke_enter = "\x1b(0"; $invoke_leave = "\x1b(B"; ShowCode('utf8', 0x00, 0x7f);