-for my $chr (@chars) {
- my $codepoint = ord $chr;
- my $ascii = $codepoint <= 127;
-
- print "<tr><th>$chr\n";
- my $info = $glyphs->glyph_info($codepoint);
- my ($class, $name, $mnem, $html, $string) = @$info;
- print "<td>$_" for sprintf('%X', $codepoint), EscapeHTML($name);
- printf '<td class="%s">%s', @$_ for (
- [$ascii ? 'l0' : defined $mnem ? 'l4' : 'l1', $mnem // ''],
- [$ascii ? 'l0' : defined $html ? 'l4' : 'l1', $html // ''],
- (map {
- !$font{$_}->{-id} ? [l0 => '?'] :
- $font{$_}->{$chr} ? [l4 => '✔'] : [l1 => '✘']
- } @fontlist),
- );
+for (@rows) {
+ my ($group, $name) = split m{/}, $_, 2;
+ my $row = $cover->{$group}->{$name};
+
+ print '<tr>';
+ $name = sprintf '<a href="%s">%s</a>', EncodeURI("/chars/$group/$name"), EscapeHTML($name)
+ if $row->{count} and $row->{count} < 1280;
+ print '<th>', $name;
+ print '<td class=right>', $row->{count};
+ for my $count (@{ $row->{support} }[@fontlist]) {
+ if (not defined $count) {
+ print '<td class="l0">?';
+ next;
+ }
+ if (not $count) {
+ print '<td class="l1">✘';
+ next;
+ }
+ if ($count == $row->{count}) {
+ print '<td class="l5">✔';
+ next;
+ }
+
+ my $rel = $count / $row->{count};
+ my $class = $rel < .5 ? 2 : $rel < .9 ? 3 : 4;
+ printf '<td class="%s">%d%%', "l$class", $rel*100;
+ }
+ say '</tr>';