4 title => 'character support sheet',
7 unicode font glyph char character support overview cover coverage
8 script block symbol sign mark reference table
10 stylesheet => [qw( light dark mono circus red )],
11 data => [qw( unicode-cover.inc.pl )],
15 <h1>Font coverage</h1>
18 Character support of Unicode
19 <a href="/charset">blocks</a> and <a href="/unicode">presets</a>.
26 use Shiar_Sheet::FormatChar;
27 my $glyphs = Shiar_Sheet::FormatChar->new;
29 my $cover = do 'unicode-cover.inc.pl' or die $@ || $!;
31 my @ossel = @{ $cover->{osdefault} };
32 my @fontlist = map { @{ $cover->{os}->{$_} } } @ossel;
35 'block/Latin-1 Supplement',
36 'block/Latin Extended-A',
37 'block/Latin Extended Additional',
38 'block/Latin Extended-B',
54 'table/arrows/single',
61 for my $group ($ENV{PATH_INFO} || ()) {
63 my $grouprows = $cover->{$group}
64 or die "Unknown character category $_\n";
65 @rows = map { "$group/$_" } sort keys %{$grouprows};
68 # output character list
70 print '<table class=mapped>';
72 print "<colgroup span=$_>"
73 for map { scalar @{ $cover->{os}->{$_} } } @ossel;
76 print '<th colspan=2>';
77 printf '<td colspan=%d>%s fonts', scalar @{ $cover->{os}->{$_} }, $_
81 print '<th colspan=2>';
82 printf '<td title="%s">%s', $_->{name}, $_->{abbr}
83 for @{ $cover->{fonts} }[@fontlist];
87 my ($group, $name) = split m{/}, $_, 2;
88 my $row = $cover->{$group}->{$name};
91 $name = sprintf '<a href="%s">%s</a>', EncodeURI("/chars/$group/$name"), EscapeHTML($name)
92 if $row->{count} and $row->{count} < 1280;
94 print '<td class=right>', $row->{count};
95 for my $count (@{ $row->{support} }[@fontlist]) {
96 if (not defined $count) {
97 print '<td class="l0">?';
101 print '<td class="l1">✘';
104 if ($count == $row->{count}) {
105 print '<td class="l5">✔';
109 my $rel = $count / $row->{count};
110 my $class = $rel < .5 ? 2 : $rel < .9 ? 3 : 4;
111 printf '<td class="%s">%d%%', "l$class", $rel*100;