X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/95a62b8397c02f6103132a3c248df2c50e6c8829..04d963b223ec1e49784c96a1b6b36cddf6cd29f0:/digraphs.plp diff --git a/digraphs.plp b/digraphs.plp index 93dfd75..67d2a1a 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'; @@ -122,20 +120,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 ($codepoint, $name, $prop, $script) = @{ $di->{$mnem} }; - my $desc = $mnem; - $desc .= " ($_)" for $info->{name} || (); - - 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;