git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
latin: single cell for identical i/j columns
[sheet.git]
/
chars.plp
diff --git
a/chars.plp
b/chars.plp
index 869366c708b227182a1f3af259005917915ac67c..d4cf06beb480889549f60b1c0164ba89bb8d6abe 100644
(file)
--- a/
chars.plp
+++ b/
chars.plp
@@
-2,47
+2,47
@@
Html({
title => 'character support sheet',
Html({
title => 'character support sheet',
- version => '
v
1.0',
+ version => '1.0',
keywords => [qw'
unicode glyph char character reference common ipa symbol sign mark table digraph
'],
stylesheet => [qw'light dark mono circus red'],
data => [qw( unicode-cover.inc.pl ttfsupport unicode-char.inc.pl )],
keywords => [qw'
unicode glyph char character reference common ipa symbol sign mark table digraph
'],
stylesheet => [qw'light dark mono circus red'],
data => [qw( unicode-cover.inc.pl ttfsupport unicode-char.inc.pl )],
+ raw => <<'EOT',
+<style>
+ tbody tr:hover th {
+ font-size: 300%;
+ min-width: 1.2em;
+ border-width: 1px;
+ }
+</style>
+EOT
});
});
-use 5.010;
use Shiar_Sheet::FormatChar;
my $glyphs = Shiar_Sheet::FormatChar->new;
use Shiar_Sheet::FormatChar;
my $glyphs = Shiar_Sheet::FormatChar->new;
-my %oslist = (
- win95 => [qw( arial ariuni verdana times )], # microsoft
- mac10 => [qw( )], # apple
- android => [qw( droidsans )], # google
- oss => [qw( dvsans c2k unifont )],
-);
-my @ossel = qw( win95 oss android );
+my $groupinfo = do 'unicode-cover.inc.pl' or die $@ || $!;
-my (%font, @fontlist);
-for my $os (@ossel) {
- my $osfonts = $oslist{$os};
- for my $fontid (@{$osfonts}) {
- push @fontlist, $fontid;
+my @ossel = @{ $groupinfo->{osdefault} };
+my @fontlist = map { $_->{file} }
+ @{ $groupinfo->{fonts} }[ map { @{ $groupinfo->{os}->{$_} } } @ossel ];
+
+my %font;
+for my $fontid (@fontlist) {
my ($fontmeta, @fontrange) = do "ttfsupport/$fontid.inc.pl";
$fontmeta or next;
$font{$fontid} = {
my ($fontmeta, @fontrange) = do "ttfsupport/$fontid.inc.pl";
$fontmeta or next;
$font{$fontid} = {
- -id => $fontmeta->{id} || $fontid,
- -name => $fontmeta->{name},
+ (map { (-$_ => $fontmeta->{$_}) } keys %{$fontmeta}),
map { (chr $_ => 1) } @fontrange
};
map { (chr $_ => 1) } @fontrange
};
- }
}
# parse input
my ($title, $parent) = ('Character overview');
my $query = eval {
}
# parse input
my ($title, $parent) = ('Character overview');
my $query = eval {
- for ($ENV{PATH_INFO} || ()) {
- s{^/}{};
+ for ($Request || ()) {
return $_ if m{^[0-9 +-]+$};
my ($cat, $name) = split m{/}, $_, 2 or die "invalid query\n";
return $_ if m{^[0-9 +-]+$};
my ($cat, $name) = split m{/}, $_, 2 or die "invalid query\n";
@@
-50,20
+50,19
@@
my $query = eval {
($cat, $name) = ('table', $cat);
}
($cat, $name) = ('table', $cat);
}
- my $groupinfo = do 'unicode-cover.inc.pl' or die $@ || $!;
my $row = $groupinfo->{$cat}->{$name}
or die "unknown character group $cat/$name\n";
$title = ucfirst EscapeHTML($name).' characters';
$parent = $cat;
my $row = $groupinfo->{$cat}->{$name}
or die "unknown character group $cat/$name\n";
$title = ucfirst EscapeHTML($name).' characters';
$parent = $cat;
- return EscapeHTML($row->{
-
query});
+ return EscapeHTML($row->{query});
}
} || $get{q};
say "<h1>$title</h1>";
if (!$query) {
}
} || $get{q};
say "<h1>$title</h1>";
if (!$query) {
-
say "<p>Unicode group not specified: $@</p>"
;
+
Alert('Unicode group not specified', $@)
;
exit;
};
exit;
};
@@
-97,37
+96,41
@@
for (map { split /[^\d-]/ } $query) {
# output character list
say '<div>';
# output character list
say '<div>';
-print '<table class=
mapped
>';
+print '<table class=
"mapped cover"
>';
print '<col>' x 3;
print '<col>' x 3;
-print "<colgroup span=$_>" for 2, map { scalar @{$oslist{$_}} } @ossel;
+print "<colgroup span=$_>"
+ for 2, map { scalar @{ $groupinfo->{os}->{$_} } } @ossel;
print '<thead><tr>';
print '<td colspan=3>character';
print '<td colspan=2>input';
print '<thead><tr>';
print '<td colspan=3>character';
print '<td colspan=2>input';
-printf '<td colspan=%d>%s
fonts', scalar @{ $oslist
{$_} }, $_
+printf '<td colspan=%d>%s
', scalar @{ $groupinfo->{os}->
{$_} }, $_
for @ossel;
print '<tr>';
print '<td colspan=2>unicode';
print '<td>name';
print '<td><a href="/digraphs" title="digraph">di</a><td>html';
for @ossel;
print '<tr>';
print '<td colspan=2>unicode';
print '<td>name';
print '<td><a href="/digraphs" title="digraph">di</a><td>html';
-printf '<td title="%s">%s', $font{$_}->{-name}, $font{$_}->{-id} // $_
- for @fontlist;
+printf('<td title="%s">%s', map { EscapeHTML($_) }
+ join("\n", $font{$_}->{-name}, $font{$_}->{-description}),
+ $font{$_}->{-abbr},
+) for @fontlist;
say '</thead>';
for my $chr (@chars) {
my $codepoint = ord $chr;
my $ascii = $codepoint <= 127;
say '</thead>';
for my $chr (@chars) {
my $codepoint = ord $chr;
my $ascii = $codepoint <= 127;
-
print "<tr><th>$chr\n"
;
+
say '<tr><th>', $chr
;
my $info = $glyphs->glyph_info($codepoint);
my $info = $glyphs->glyph_info($codepoint);
- my ($class, $name, $mnem, $
html
, $string) = @$info;
+ my ($class, $name, $mnem, $
entity
, $string) = @$info;
print "<td>$_" for sprintf('%X', $codepoint), EscapeHTML($name || '?');
printf '<td class="%s">%s', @$_ for (
print "<td>$_" for sprintf('%X', $codepoint), EscapeHTML($name || '?');
printf '<td class="%s">%s', @$_ for (
- [$ascii ? 'l0' : defined $mnem ? $class =~ /\bu-di\b/ ? 'l4' : 'l3' : 'l1', $mnem // ''],
- [$ascii ? 'l0' : defined $html ? 'l4' : 'l1', $html // ''],
+ [$ascii ? 'l0' : defined $mnem ? $class =~ /\bu-di\b/ ? 'l4' : 'l3' : 'l1',
+ EscapeHTML($mnem) // ''],
+ [$ascii ? 'l0' : defined $entity ? 'l4' : 'l1', $entity // ''],
(map {
(map {
- !
$font{$_}->{-id
} ? [l0 => '?'] :
+ !
defined $font{$_}->{-name
} ? [l0 => '?'] :
$font{$_}->{$chr} ? [l4 => '✔'] : [l1 => '✘']
} @fontlist),
);
$font{$_}->{$chr} ? [l4 => '✔'] : [l1 => '✘']
} @fontlist),
);