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',
53 'category/Sc', # currency
55 'category/Sm', # mathematical
56 'table/arrows/single',
63 if (my $group = $ENV{PATH_INFO}) {
65 my $grouprows = $cover->{$group}
66 or die "Unknown character category $_\n";
67 @rows = map { "$group/$_" } sort keys %{$grouprows};
70 # output character list
72 print '<table class=mapped>';
74 print "<colgroup span=$_>"
75 for map { scalar @{ $cover->{os}->{$_} } } @ossel;
78 print '<th colspan=2>';
79 printf '<td colspan=%d>%s fonts', scalar @{ $cover->{os}->{$_} }, $_
83 print '<th colspan=2>';
84 printf '<td title="%s">%s', $_->{name}, $_->{abbr}
85 for @{ $cover->{fonts} }[@fontlist];
89 my ($group, $name) = split m{/}, $_, 2;
90 my $row = $cover->{$group}->{$name};
93 $name = sprintf '<a href="%s">%s</a>', EncodeURI("/chars/$group/$name"), EscapeHTML($name)
94 if $row->{count} and $row->{count} < 1280;
96 print '<td class=right>', $row->{count};
97 for my $count (@{ $row->{support} }[@fontlist]) {
98 if (not defined $count) {
99 print '<td class="l0">?';
103 print '<td class="l1">✘';
106 if ($count == $row->{count}) {
107 print '<td class="l5">✔';
111 my $rel = $count / $row->{count};
112 my $class = $rel < .5 ? 2 : $rel < .9 ? 3 : 4;
113 printf '<td class="%s">%d%%', "l$class", $rel*100;