-my $tables = do 'unicode-table.inc.pl' or die $@ || $!;
-my (%font, @fontlist);
-for my $os (@ossel) {
- my $osfonts = $oslist{$os};
- for my $fontid (@{$osfonts}) {
- push @fontlist, $fontid;
- my ($fontmeta, @fontrange) = do "ttfsupport/$fontid.inc.pl";
- $fontmeta or next;
- $font{$fontid} = {
- -id => $fontmeta->{id} || $fontid,
- -name => $fontmeta->{name},
- map { (chr $_ => 1) } @fontrange
- };
+<style>
+ .glyphs tbody th[!colspan] { text-align: right }
+ .glyphs tbody td { font-family: "$fontmeta->{name}" }
+ .glyphs tbody td:nth-child(18) { border-left-width: 2px }
+ \@font-face {
+ font-family: "$fontmeta->{name}";
+ src: url(/data/font/$font.ttf);
+ }
+</style>
+EOT
+ say '<table class="glyphs big">';
+
+ say "<caption>$_</caption>" for join(' ', grep {$_}
+ $offset > $pagerows && sprintf('<a rel="start" href="?q=%d">◄</a>', 0),
+ $offset > 0 && sprintf(
+ '<a rel="prev" href="?q=%d" title="U+%1$04X">◅</a>',
+ $offset - $pagerows,
+ ),
+ sprintf('U+%04X', $offset),
+ Unicode::UCD::charblock($offset),
+ $offset + $pagerows < 0x11_0000 && sprintf(
+ '<a rel="next" href="?q=%d" title="U+%1$04X">▻</a>',
+ $offset + $pagerows,
+ ),
+ );
+
+ for my $cp ($offset .. $offset+$pagerows-1) {
+ state $colpos;
+ my $block = Unicode::UCD::charblock($cp);
+ if ($block ne (state $sameblock = $block) and $block ne 'No_Block') {
+ print '<tbody>';
+ printf '<tr><th colspan=%d>%s', $pagecols+1, $block
+ unless $block eq 'No_Block';
+ say '';
+ $sameblock = $block;
+ $colpos = 0;
+ }
+
+ say sprintf '<tr><th>%X', $cp if $colpos++ % $pagecols == 0;
+
+ my $info = $glyphs->glyph_info($cp);
+ my ($class, $name, $mnem, $html, $string) = @{$info};
+ my $np = $class =~ /\bC\S\b/; # noprint if control or invalid
+ # display literal character, with placeholder circle if non-spacing/enclosing
+ my $html = ($class =~ /\bM[ne]\b/ && chr 9676) . EscapeHTML(chr $cp);
+ say sprintf '<td class="%s" title="U+%04X%s">%s',
+ !$class ? ('l0', $cp, '', '') :
+ $cover{$cp} ? $np ? 'l2' : 'l5' : $np ? 'Xi' : 'l1',
+ $cp, !!$name && ": $name",
+ ($cover{$cp} || !$np) && $html;