X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/13f64783b1e5ed763a85912e7129d58791de8340..29b407ddf91b653e6e8380f73e221628a392376f:/chars.plp diff --git a/chars.plp b/chars.plp index 775674e..d4cf06b 100644 --- a/chars.plp +++ b/chars.plp @@ -2,15 +2,23 @@ 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 )], + raw => <<'EOT', + +EOT }); -use 5.010; use Shiar_Sheet::FormatChar; my $glyphs = Shiar_Sheet::FormatChar->new; @@ -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 "

$title

"; if (!$query) { - say "

Unicode group not specified: $@

"; + Alert('Unicode group not specified', $@); exit; }; @@ -89,7 +96,7 @@ for (map { split /[^\d-]/ } $query) { # output character list say '
'; -print ''; +print '
'; print '' x 3; print "" for 2, map { scalar @{ $groupinfo->{os}->{$_} } } @ossel; @@ -104,22 +111,24 @@ print ''; print '
unicode'; print 'name'; print 'dihtml'; -printf '%s', $font{$_}->{-name}, $font{$_}->{-abbr} - for @fontlist; +printf('%s', map { EscapeHTML($_) } + join("\n", $font{$_}->{-name}, $font{$_}->{-description}), + $font{$_}->{-abbr}, +) for @fontlist; say ''; for my $chr (@chars) { my $codepoint = ord $chr; my $ascii = $codepoint <= 127; - print "
$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 => '✘']