X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/1a1445238307079771732342d00cc0a3af52d23a..385813929989c8745b914a7fb4b48384f388c6cb:/tools/mkcharinfo diff --git a/tools/mkcharinfo b/tools/mkcharinfo index ace9dbe..8f762fa 100755 --- a/tools/mkcharinfo +++ b/tools/mkcharinfo @@ -2,7 +2,6 @@ use 5.014; use warnings; use utf8; -no if $] >= 5.018, warnings => 'experimental::smartmatch'; use lib '.'; use open OUT => ':encoding(utf-8)', ':std'; @@ -38,11 +37,15 @@ eval { 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; @@ -84,6 +87,7 @@ eval { 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;