-<:
-use 5.010;
-use Shiar_Sheet::FormatChar;
-my $glyphs = Shiar_Sheet::FormatChar->new;
-
-my %oslist = (
- win95 => [qw( arial ariuni verdana times )], # microsoft
- mac10 => [qw( )], # apple
- android => [qw( droidsans )], # google
- oss => [qw( dvsans c2k unifont )],
-);
-my @ossel = qw( win95 oss android );
-
-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
- };
+ for my $cp ($offset .. $offset+$pagerows-1) {
+ state $sameblock;
+ my $block = Unicode::UCD::charblock($cp);
+
+ if ($sameblock and $sameblock ne $block and $block ne 'No_Block') {
+ say sprintf '<tbody><tr><th colspan=%d>%s', $pagecols+1, $block;
+ undef $sameblock;
+ }
+
+ if (not $sameblock) {
+ $sameblock = $block;
+ if (my $gap = $cp % $pagecols) {
+ say sprintf '<tr><th>%X<th colspan=%d>', $cp, $gap;
+ }
+ }
+
+ say sprintf '<tr><th>%X', $cp if $cp % $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
+ 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) && EscapeHTML(chr $cp);