X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/4d0dfd97b2708e809741ad853bff0bd000fcbb33..bfb80ffa567c24ad151eaad7c0e813eb1f6cbe76:/font.plp?q=%25d
diff --git a/font.plp b/font.plp
index e0a9663..2af6133 100644
--- a/font.plp
+++ b/font.plp
@@ -17,6 +17,8 @@ if (my $font = $ENV{PATH_INFO} =~ s{^/}{}r) {
$fontmeta or die "Unknown font $font\n";
my $offset = $get{q} || 0;
+ $offset < 0 and $offset = 0;
+ my $size = 0x200;
say "
Font coverage
";
say "$_
" for EscapeHTML($fontmeta->{name});
@@ -47,7 +49,19 @@ if (my $font = $ENV{PATH_INFO} =~ s{^/}{}r) {
EOT
say '';
- for my $cp ($offset .. $offset+0x1FF) {
+ say "$_" for join(' ', grep {$_}
+ $offset > $size && sprintf('â', 0),
+ $offset > 0 && sprintf(
+ 'â
',
+ $offset - $size,
+ ),
+ sprintf('U+%04X', $offset), #TODO: block name
+ $offset + $size < 0x11_0000 && sprintf(
+ 'â»',
+ $offset + $size,
+ ),
+ );
+ for my $cp ($offset .. $offset+$size-1) {
my $info = $glyphs->glyph_info($cp);
my ($class, $name, $mnem, $html, $string) = @{$info};
my $np = $class =~ /\bC\S\b/; # noprint if control or invalid