X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/95a62b8397c02f6103132a3c248df2c50e6c8829..bd2329060230590cb612232ec5309e288204f91d:/digraphs.plp diff --git a/digraphs.plp b/digraphs.plp index 93dfd75..937228c 100644 --- a/digraphs.plp +++ b/digraphs.plp @@ -4,8 +4,6 @@ use strict; use warnings; use open IO => ':utf8'; -use Unicode::UCD qw(charinfo); - our $VERSION = '1.0'; $header{content_type} = 'text/html; charset=utf-8'; @@ -17,77 +15,7 @@ $header{content_type} = 'text/html; charset=utf-8'; digraph cheat sheet - + @@ -122,20 +50,15 @@ for my $c1 (@chars) { print ''; next; } - my $chr = $di->{$mnem}; - my $glyph = chr $chr; - utf8::upgrade($glyph); # prevent latin1 output - my $info = charinfo($chr); - - my $desc = $mnem; - $desc .= " ($_)" for $info->{name} || (); + my ($codepoint, $name, $prop, $script) = @{ $di->{$mnem} }; - my @class = 'X'; - push @class, $_ for $info->{category} || (); - push @class, $_ for $info->{script} || (); + my $glyph = chr $codepoint; + utf8::upgrade($glyph); # prevent latin1 output + my $desc = $mnem . ($name && " ($name)"); + my @class = ('X', grep {$_} $prop, $script); $glyph = quote($glyph); - $glyph = "$glyph" if $info->{category} eq 'Zs'; + $glyph = "$glyph" if $prop eq 'Zs'; printf "\n".'%s', join(' ', @class), quote($desc), $glyph; @@ -167,8 +90,8 @@ print "\n";
unicode - ascii latin1 + ascii private proposed