git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
font: describe search query
[sheet.git]
/
font.plp
diff --git
a/font.plp
b/font.plp
index 66f6e4a58d209ea4b77576fe308be3ea1792d31c..4cc99c9deee7ca639302c82ec96ddf91dcf9c59c 100644
(file)
--- a/
font.plp
+++ b/
font.plp
@@
-52,12
+52,14
@@
for my $os (@ossel) {
# parse input
my @chars;
# parse input
my @chars;
+my @querydesc;
my $query = $ENV{PATH_INFO} || $get{q} || 'ipa';
for ($query) {
s{^/}{};
when (qr{^[a-z]+(?:/|\z)}) {
for (split / /) {
my $query = $ENV{PATH_INFO} || $get{q} || 'ipa';
for ($query) {
s{^/}{};
when (qr{^[a-z]+(?:/|\z)}) {
for (split / /) {
+ push @querydesc, "preset group $_";
my ($tablegroup, $tablename) = split m{/}, $_, 2;
my @tables = $tablename ? $tables->{$tablegroup}->{$tablename}
: sort values %{ $tables->{$tablegroup} };
my ($tablegroup, $tablename) = split m{/}, $_, 2;
my @tables = $tablename ? $tables->{$tablegroup}->{$tablename}
: sort values %{ $tables->{$tablegroup} };
@@
-73,12
+75,14
@@
for ($query) {
}
}
when (qr{[\d,;\s+-]+}) {
}
}
when (qr{[\d,;\s+-]+}) {
+ push @querydesc, "character codepoints $_";
for (map { split /[^\d-]/ } $_) {
my ($charnum, $range) = split /-/, $_;
push @chars, chr $_ for $charnum .. ($range // $charnum);
}
}
when (qr{[A-Z]}) {
for (map { split /[^\d-]/ } $_) {
my ($charnum, $range) = split /-/, $_;
push @chars, chr $_ for $charnum .. ($range // $charnum);
}
}
when (qr{[A-Z]}) {
+ push @querydesc, "unicode match $_";
eval {
my $match = qr/\A\p{$_}\z/;
push @chars, grep { m/$match/ } map { chr $_ }
eval {
my $match = qr/\A\p{$_}\z/;
push @chars, grep { m/$match/ } map { chr $_ }
@@
-90,12
+94,15
@@
for ($query) {
}
}
}
}
-@chars <= 1500
- or die sprintf 'too many matches (%d)'."\n", scalar @chars;
+@chars <= 1500 or die sprintf(
+ 'too many matches (%d) for %s'."\n",
+ scalar @chars, join(', ', @querydesc),
+);
# output character list
print '<table class=mapped>';
# output character list
print '<table class=mapped>';
+say '<caption>'.EscapeHTML(join ', ', @querydesc).'</caption>';
print '<col>' x 3;
print "<colgroup span=$_>" for 2, map { scalar @{$oslist{$_}} } @ossel;
print '<col>' x 3;
print "<colgroup span=$_>" for 2, map { scalar @{$oslist{$_}} } @ossel;
@@
-108,7
+115,7
@@
printf '<td colspan=%d>%s fonts', scalar @{ $oslist{$_} }, $_
print '<tr>';
print '<td colspan=2>unicode';
print '<td>name';
print '<tr>';
print '<td colspan=2>unicode';
print '<td>name';
-print '<td>
di
<td>html';
+print '<td>
<a href="/digraphs" title="digraph">di</a>
<td>html';
printf '<td title="%s">%s', $font{$_}->{-name}, $font{$_}->{-id} // $_
for @fontlist;
say '</thead>';
printf '<td title="%s">%s', $font{$_}->{-name}, $font{$_}->{-id} // $_
for @fontlist;
say '</thead>';