From bfb80ffa567c24ad151eaad7c0e813eb1f6cbe76 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Fri, 6 Mar 2015 07:07:06 +0100 Subject: [PATCH] font: navigation links to offset character table --- font.plp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 -- 2.30.0
$_