X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/13f64783b1e5ed763a85912e7129d58791de8340..25a210c5de3a4e164a39839dedeb997d56f31faf:/font.plp diff --git a/font.plp b/font.plp index 98fff40..8867921 100644 --- a/font.plp +++ b/font.plp @@ -1,4 +1,5 @@ <(common.inc.plp)><: +use 5.014; Html({ title => 'character support sheet', @@ -11,6 +12,79 @@ Html({ data => [qw( unicode-cover.inc.pl )], }); +if (my $font = $ENV{PATH_INFO} =~ s{^/}{}r) { + my ($fontmeta, @cover) = do "ttfsupport/$font.inc.pl"; + $fontmeta or die "Unknown font $font\n"; + + require Unicode::UCD; + + my $size = 0x200; + my $offset = eval { + local $_ = $get{q} || 0; + return $_ if /\A\d+\z/; # numeric + return hex $1 if /\A (?: 0?x | u\W* ) ([0-9a-f]+) \z/ix; # hexadecimal + return $_->[0]->[0] for Unicode::UCD::charblock(ucfirst) || (); # block + die "Unknown offset query '$_'\n"; + }; + die $@ if $@; + + say "
Version %s released %s contains %d glyphs.
\n", + !!$_->[2] && qq( title="revision $_->[2]"), + $_->[1], $_->[0], + scalar @cover, + ) for [ + grep { $_ } + ($fontmeta->{date} || '?') =~ s/T.*//r, + EscapeHTML($fontmeta->{version}), + $fontmeta->{revision}, + ]; + printf "%s
\n", join('%X', $cp if $cp % 32 == 0; + say sprintf ' | %s', + !$class ? ('l0', $cp, '', '') : + $cover{$cp} ? $np ? 'l2' : 'l5' : $np ? 'Xi' : 'l1', + $cp, !!$name && ": $name", + ($cover{$cp} || !$np) && EscapeHTML(chr $cp); + } + say ' |
---|