sc: refer to ventral sacs overlord by its common name
[sheet.git] / tools / mkcharinfo
index 61f674ff34974ab80ceaa77940340f33824f564b..8f762fad6d2fc06d921750b216bb2267b12cf634 100755 (executable)
@@ -2,7 +2,6 @@
 use 5.014;
 use warnings;
 use utf8;
 use 5.014;
 use warnings;
 use utf8;
-no if $] >= 5.018, warnings => 'experimental::smartmatch';
 use lib '.';
 
 use open OUT => ':encoding(utf-8)', ':std';
 use lib '.';
 
 use open OUT => ':encoding(utf-8)', ':std';
@@ -18,6 +17,9 @@ my %info = (
        "\x{200B}" => {string => '␣'}, # nbsp: ~ in TeX
        "\x{200C}" => {string => '|'}, # ISO-9995-7-081 lookalike (alt: ∣ ⊺ ⟙)
        "\x{200D}" => {string => '⁀'}, # join (alt: ∤ |ͯ ⨝)
        "\x{200B}" => {string => '␣'}, # nbsp: ~ in TeX
        "\x{200C}" => {string => '|'}, # ISO-9995-7-081 lookalike (alt: ∣ ⊺ ⟙)
        "\x{200D}" => {string => '⁀'}, # join (alt: ∤ |ͯ ⨝)
+       (map {( $_ => {string => chr(9676).$_.chr(9676)} )} map {chr} # combining double
+               0x35C .. 0x362, 0x1DCD, 0x1DFC,
+       ),
 );
 $info{chr $_} //= {} for 32 .. 126;
 
 );
 $info{chr $_} //= {} for 32 .. 126;
 
@@ -35,11 +37,15 @@ eval {
        1;
 } or warn "Failed reading unicode tables: $@";
 
        1;
 } or warn "Failed reading unicode tables: $@";
 
-eval {
-       my $kbd = do './keyboard/altgr/macos-abc.eng.inc.pl' or die $@ || $!;
-       $info{$_} //= {} for map {s/◌//g; m/\A./g} values %{ $kbd->{key} };
-       1;
-} or warn "Failed reading additional keyboard map: $@";
+for my $layout ('macos-abc', 'windows') {
+       eval {
+               my $kbd = do "./keyboard/altgr/$layout.eng.inc.pl" or die $@ || $!;
+               my @def = map { values %{$_} } values %{ $kbd->{def} }
+                       or die 'missing key definitions';
+               $info{$_} //= {} for map {s/◌//g; m/\A./g} map { $_->[1] // () } @def;
+               1;
+       } or warn "Failed reading additional keyboard map $layout: $@";
+}
 
 eval {
        require HTML::Entities;
 
 eval {
        require HTML::Entities;
@@ -81,6 +87,7 @@ eval {
 
 for my $chr (keys %info) {
        my $cp = ord $chr;
 
 for my $chr (keys %info) {
        my $cp = ord $chr;
+       #my $info = glyph_mkinfo($cp) or next;
        # attempt to get unicode character information
        my $info = eval {
                require Unicode::UCD;
        # attempt to get unicode character information
        my $info = eval {
                require Unicode::UCD;