font: aggregate counts for unicode versions
[sheet.git] / font.plp
index a03990508905532bf62f2d914f41c4e5ee090848..a93835cf4a96c2ee1695fb314187098ad2e2114a 100644 (file)
--- a/font.plp
+++ b/font.plp
@@ -55,6 +55,7 @@ if (my $font = $ENV{PATH_INFO} =~ s{^/}{}r) {
 <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 }
 </style>
 EOT
        say '<table class="glyphs big">';
@@ -90,11 +91,13 @@ EOT
                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) && EscapeHTML(chr $cp);
+                       ($cover{$cp} || !$np) && $html;
        }
        say '</table>';
 
@@ -119,6 +122,8 @@ my @ossel = @{ $cover->{osdefault} };
 my @fontlist = map { @{ $cover->{os}->{$_} } } @ossel;
 
 my @rows = (
+       'version/11',
+       'version/63',
        'block/Latin-1 Supplement',
        'block/Latin Extended-A',
        'block/Latin Extended Additional',
@@ -179,6 +184,7 @@ for (@rows) {
        my $row = $cover->{$group}->{$name};
 
        print '<tr>';
+       $name = sprintf 'Unicode v%.1f', $name / 10 if $group eq 'version';
        $name = sprintf '<a href="%s">%s</a>', EncodeURI("/chars/$group/$name"), EscapeHTML($name)
                if $row->{count} and $row->{count} < 1280;
        print '<th>', $name;