X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/0d7d8b502321cdd3d041b756c742a4805b009f8f..853d2447d4ee85d7a6a7511d6ecf1006f68ecba5:/tools/mkcharinfo?ds=inline diff --git a/tools/mkcharinfo b/tools/mkcharinfo index 6d08f9e..8f762fa 100755 --- a/tools/mkcharinfo +++ b/tools/mkcharinfo @@ -2,12 +2,12 @@ use 5.014; use warnings; use utf8; -no if $] >= 5.018, warnings => 'experimental::smartmatch'; +use lib '.'; use open OUT => ':encoding(utf-8)', ':std'; use Data::Dump 'pp'; -our $VERSION = '1.02'; +our $VERSION = '1.03'; my %info = ( # prepare presentational string for some control(lish) entries @@ -17,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: ∤ |ͯ ⨝) + (map {( $_ => {string => chr(9676).$_.chr(9676)} )} map {chr} # combining double + 0x35C .. 0x362, 0x1DCD, 0x1DFC, + ), ); $info{chr $_} //= {} for 32 .. 126; @@ -34,6 +37,16 @@ eval { 1; } or warn "Failed reading unicode tables: $@"; +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; our %char2entity; @@ -74,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;