4 title => 'character support sheet',
7 unicode glyph char character reference common ipa symbol sign mark table digraph
9 stylesheet => [qw'light dark mono circus red'],
10 data => [qw'unicode-table.inc.pl unicode-char.inc.pl'],
14 <h1>Character support</h1>
17 Selected characters from Unicode <a href="/unicode">preset</a>
18 or <a href="/charset">range</a>.
25 use Shiar_Sheet::FormatChar;
26 my $glyphs = Shiar_Sheet::FormatChar->new;
29 win95 => [qw( arial ariuni verdana times )], # microsoft
30 mac10 => [qw( )], # apple
31 android => [qw( droidsans )], # google
32 oss => [qw( dvsans c2k unifont )],
34 my @ossel = qw( win95 oss android );
36 my $tables = do 'unicode-table.inc.pl' or die $@ || $!;
37 my (%font, @fontlist);
39 my $osfonts = $oslist{$os};
40 for my $fontid (@{$osfonts}) {
41 push @fontlist, $fontid;
42 my ($fontmeta, @fontrange) = do "ttfsupport/$fontid.inc.pl";
45 -id => $fontmeta->{id} || $fontid,
46 -name => $fontmeta->{name},
47 map { (chr $_ => 1) } @fontrange
56 for ($ENV{PATH_INFO} || $get{q} || ()) {
62 push @{ $get{'@g'} }, $_;
65 die "unknown parameter: $_\n";
69 $get{'@g'} //= ['latin/sample'];
71 for (map { split / / } @{ $get{'@g'} }) {
72 my ($tablegroup, $tablename) = split m{/}, $_, 2;
73 my $table = $tables->{$tablegroup}->{$tablename};
78 next if $_ eq '>' or $_ eq '=';
83 # output character list
85 print '<table class=mapped>';
87 print "<colgroup span=$_>" for 2, map { scalar @{$oslist{$_}} } @ossel;
90 print '<td colspan=3>character';
91 print '<td colspan=2>input';
92 printf '<td colspan=%d>%s fonts', scalar @{ $oslist{$_} }, $_
96 print '<td colspan=2>unicode';
98 print '<td>di<td>html';
99 printf '<td title="%s">%s', $font{$_}->{-name}, $font{$_}->{-id} // $_
103 for my $chr (@chars) {
104 my $codepoint = ord $chr;
105 my $ascii = $codepoint <= 127;
107 print "<tr><th>$chr\n";
108 my $info = $glyphs->glyph_info($codepoint);
109 my ($class, $name, $mnem, $html, $string) = @$info;
110 print "<td>$_" for sprintf('%X', $codepoint), EscapeHTML($name);
111 printf '<td class="%s">%s', @$_ for (
112 [$ascii ? 'l0' : defined $mnem ? 'l4' : 'l1', $mnem // ''],
113 [$ascii ? 'l0' : defined $html ? 'l4' : 'l1', $html // ''],
115 !$font{$_}->{-id} ? [l0 => '?'] :
116 $font{$_}->{$chr} ? [l4 => '✔'] : [l1 => '✘']