my %oslist = (
win95 => [qw( arial ariuni verdana times courier )], # microsoft
- mac10 => [qw( )], # apple
- android => [qw( droidsans )], # google
+ mac10 => [qw( lucida garamond )], # apple
+ android => [qw( roboto noto )], # google
oss => [qw( dvsans c2k unifont )],
);
-my @ossel = qw( win95 oss android );
+my @ossel = qw( win95 mac10 oss android );
my @fontlist = map { @{ $oslist{$_} } } @ossel;
my $cover = do 'unicode-cover.inc.pl' or die $@ || $!;
+my @rows = (
+ 'block/Latin-1 Supplement',
+ 'block/Latin Extended-A',
+ 'block/Latin Extended Additional',
+ 'block/Latin Extended-B',
+ 'script/Latin',
+ 'script/Greek',
+ 'script/Cyrillic',
+ 'script/Arabic',
+ 'script/Hebrew',
+ 'script/Devanagari',
+ 'script/Thai',
+ 'script/Hangul',
+ 'table/japanese',
+ 'script/Han',
+ 'table/ipa',
+ 'table/punctuation',
+ 'block/Dingbats',
+ 'table/symbols',
+ 'table/math',
+ 'table/arrows/single',
+ 'table/lines/single',
+ 'table/block',
+ 'table/lines',
+ 'table/html',
+);
+
+for my $group ($ENV{PATH_INFO} || ()) {
+ $group =~ s{^/}{};
+ my $grouprows = $cover->{$group}
+ or die "Unknown character category $_\n";
+ @rows = map { "$group/$_" } sort keys %{$grouprows};
+}
+
# output character list
print '<table class=mapped>';
printf '<td>%s', $_ for @fontlist;
say '</thead>';
-for my $name (sort keys %{$cover}) {
- my $row = $cover->{$name};
+for (@rows) {
+ my ($group, $name) = split m{/}, $_, 2;
+ my $row = $cover->{$group}->{$name};
+
print '<tr>';
- $name = qq{<a href="/chars/$name">$name</a>}
+ $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};
next;
}
if (not $count) {
- print '<td class="l1">0';
+ 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 < .75 ? 3 : $rel < 1 ? 4 : 5;
+ my $class = $rel < .5 ? 2 : $rel < .9 ? 3 : 4;
printf '<td class="%s">%d%%', "l$class", $rel*100;
}
say '</tr>';