X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/675221b52b08ff40fa91f38fe2eae05a4ef155bc..ff54b2f125dada0899ac2b12bf4fa9f496d03762:/chars.plp diff --git a/chars.plp b/chars.plp index ebfdc6b..5d9a3e2 100644 --- a/chars.plp +++ b/chars.plp @@ -2,19 +2,27 @@ Html({ title => 'character support sheet', - version => 'v1.0', + version => '1.0', keywords => [qw' unicode glyph char character reference common ipa symbol sign mark table digraph '], stylesheet => [qw'light dark mono circus red'], - data => [qw( unicode-cover.inc.pl ttfsupport unicode-char.inc.pl )], + data => [qw( data/unicode-cover.inc.pl data/font data/unicode-char.inc.pl )], + raw => <<'EOT', + +EOT }); -use 5.010; use Shiar_Sheet::FormatChar; my $glyphs = Shiar_Sheet::FormatChar->new; -my $groupinfo = do 'unicode-cover.inc.pl' or die $@ || $!; +my $groupinfo = do 'data/unicode-cover.inc.pl' or die $@ || $!; my @ossel = @{ $groupinfo->{osdefault} }; my @fontlist = map { $_->{file} } @@ -22,7 +30,7 @@ my @fontlist = map { $_->{file} } my %font; for my $fontid (@fontlist) { - my ($fontmeta, @fontrange) = do "ttfsupport/$fontid.inc.pl"; + my ($fontmeta, @fontrange) = do "data/font/$fontid.inc.pl"; $fontmeta or next; $font{$fontid} = { (map { (-$_ => $fontmeta->{$_}) } keys %{$fontmeta}), @@ -34,8 +42,7 @@ for my $fontid (@fontlist) { my ($title, $parent) = ('Character overview'); my $query = eval { - for ($ENV{PATH_INFO} || ()) { - s{^/}{}; + for ($Request || ()) { return $_ if m{^[0-9 +-]+$}; my ($cat, $name) = split m{/}, $_, 2 or die "invalid query\n"; @@ -55,7 +62,7 @@ my $query = eval { say "
Unicode group not specified: $@
"; + Alert('Unicode group not specified', $@); exit; }; @@ -89,7 +96,7 @@ for (map { split /[^\d-]/ } $query) { # output character list say '$chr\n"; + say ' | ||
---|---|---|
', $chr; my $info = $glyphs->glyph_info($codepoint); - my ($class, $name, $mnem, $html, $string) = @$info; + my ($class, $name, $mnem, $entity, $string) = @$info; print " | $_" for sprintf('%X', $codepoint), EscapeHTML($name || '?'); printf ' | %s', @$_ for ( [$ascii ? 'l0' : defined $mnem ? $class =~ /\bu-di\b/ ? 'l4' : 'l3' : 'l1', EscapeHTML($mnem) // ''], - [$ascii ? 'l0' : defined $html ? 'l4' : 'l1', $html // ''], + [$ascii ? 'l0' : defined $entity ? 'l4' : 'l1', $entity // ''], (map { !defined $font{$_}->{-name} ? [l0 => '?'] : $font{$_}->{$chr} ? [l4 => 'â'] : [l1 => 'â'] |