Revision: 10315 https://osdn.net/projects/ttssh2/scm/svn/commits/10315 Author: zmatsuo Date: 2022-10-15 23:38:54 +0900 (Sat, 15 Oct 2022) Log Message: ----------- ファイル名を変更 Added Paths: ----------- trunk/teraterm/teraterm/unicode/get_asianwidth_table.md trunk/teraterm/teraterm/unicode/get_asianwidth_table.pl Removed Paths: ------------- trunk/teraterm/teraterm/unicode/get_f_w_a.md trunk/teraterm/teraterm/unicode/get_f_w_a.pl -------------- next part -------------- Copied: trunk/teraterm/teraterm/unicode/get_asianwidth_table.md (from rev 10314, trunk/teraterm/teraterm/unicode/get_f_w_a.md) =================================================================== --- trunk/teraterm/teraterm/unicode/get_asianwidth_table.md (rev 0) +++ trunk/teraterm/teraterm/unicode/get_asianwidth_table.md 2022-10-15 14:38:54 UTC (rev 10315) @@ -0,0 +1,21 @@ + +# unicodeの全角半角 + +- unicode.orgにある East Asian Width に基づいて決める + +# テーブルの作り方 + +- あらかじめ EastAsianWidth.txt をダウンロードしておく +- 次のように実行 + - `perl get_asianwidth_table.pl > unicode_asian_width.tbl` + +## East Asian Width について + +https://ja.wikipedia.org/wiki/%E6%9D%B1%E3%82%A2%E3%82%B8%E3%82%A2%E3%81%AE%E6%96%87%E5%AD%97%E5%B9%85 + +## original data + +http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt + + EastAsianWidth-12.1.0.txt + Date: 2019-03-31, 22:01:58 GMT [KW, LI] Copied: trunk/teraterm/teraterm/unicode/get_asianwidth_table.pl (from rev 10314, trunk/teraterm/teraterm/unicode/get_f_w_a.pl) =================================================================== --- trunk/teraterm/teraterm/unicode/get_asianwidth_table.pl (rev 0) +++ trunk/teraterm/teraterm/unicode/get_asianwidth_table.pl 2022-10-15 14:38:54 UTC (rev 10315) @@ -0,0 +1,48 @@ +#!/usr/bin/perl +use utf8; + +open(FILE, "EastAsianWidth.txt") || die "Cannot open width file."; +$ostart = -1; +while($a = <FILE>) { + if ($a =~ /^([0-9A-F]+)\.\.([0-9A-F]+);([A-Za-z]+)/) { + $start = hex $1; + $end = hex $2; + $type = $3; + if ($type eq "Na") { + $type = "n"; + } + } + elsif ($a =~ /^([0-9A-F]+);([A-Za-z]+)/) { + $start = hex $1; + $end = hex $1; + $type = $2; + if ($type eq "Na") { + $type = "n"; + } + } else { + next; + } + +# printf("-{ 0x%06x, 0x%06x, $type },\n", $start, $end); + + if ($otype eq $type + #&& $oend+1 == $start # 未定義部を飛ばしてつなげる + ) + { + # 1つ前とつなげる + $oend = $end; + } elsif ($ostart == -1) { + $ostart = $start; + $oend = $end; + $otype = $type; + } else { + if (($otype eq "W") || ($otype eq "F") || ($otype eq "A") || + ($otype eq "N") || ($otype eq "n")) { + printf("{ 0x%06x, 0x%06x, '$otype' },\n", $ostart, $oend); + } + $ostart = $start; + $oend = $end; + $otype = $type; + } +} +printf("{ 0x%06x, 0x%06x, '$type' },\n", $ostart, $oend); Deleted: trunk/teraterm/teraterm/unicode/get_f_w_a.md =================================================================== --- trunk/teraterm/teraterm/unicode/get_f_w_a.md 2022-10-15 14:38:44 UTC (rev 10314) +++ trunk/teraterm/teraterm/unicode/get_f_w_a.md 2022-10-15 14:38:54 UTC (rev 10315) @@ -1,21 +0,0 @@ - -# unicodeの全角半角 - -- unicode.orgにある East Asian Width に基づいて決める - -# テーブルの作り方 - -- あらかじめ EastAsianWidth.txt をダウンロードしておく -- 次のように実行 - - `perl get_f_w_a.pl > unicode_asian_width.tbl` - -## East Asian Width について - -https://ja.wikipedia.org/wiki/%E6%9D%B1%E3%82%A2%E3%82%B8%E3%82%A2%E3%81%AE%E6%96%87%E5%AD%97%E5%B9%85 - -## original data - -http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt - - EastAsianWidth-12.1.0.txt - Date: 2019-03-31, 22:01:58 GMT [KW, LI] Deleted: trunk/teraterm/teraterm/unicode/get_f_w_a.pl =================================================================== --- trunk/teraterm/teraterm/unicode/get_f_w_a.pl 2022-10-15 14:38:44 UTC (rev 10314) +++ trunk/teraterm/teraterm/unicode/get_f_w_a.pl 2022-10-15 14:38:54 UTC (rev 10315) @@ -1,48 +0,0 @@ -#!/usr/bin/perl -use utf8; - -open(FILE, "EastAsianWidth.txt") || die "Cannot open width file."; -$ostart = -1; -while($a = <FILE>) { - if ($a =~ /^([0-9A-F]+)\.\.([0-9A-F]+);([A-Za-z]+)/) { - $start = hex $1; - $end = hex $2; - $type = $3; - if ($type eq "Na") { - $type = "n"; - } - } - elsif ($a =~ /^([0-9A-F]+);([A-Za-z]+)/) { - $start = hex $1; - $end = hex $1; - $type = $2; - if ($type eq "Na") { - $type = "n"; - } - } else { - next; - } - -# printf("-{ 0x%06x, 0x%06x, $type },\n", $start, $end); - - if ($otype eq $type - #&& $oend+1 == $start # 未定義部を飛ばしてつなげる - ) - { - # 1つ前とつなげる - $oend = $end; - } elsif ($ostart == -1) { - $ostart = $start; - $oend = $end; - $otype = $type; - } else { - if (($otype eq "W") || ($otype eq "F") || ($otype eq "A") || - ($otype eq "N") || ($otype eq "n")) { - printf("{ 0x%06x, 0x%06x, '$otype' },\n", $ostart, $oend); - } - $ostart = $start; - $oend = $end; - $otype = $type; - } -} -printf("{ 0x%06x, 0x%06x, '$type' },\n", $ostart, $oend);