git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
keyboard/altgr: label keys in each row with big class
[sheet.git]
/
charset.plp
diff --git
a/charset.plp
b/charset.plp
index c924d5e8a19feb48fcd7682e23caa7bcf42b0e08..bbab1d6b83868e67e4619e94db05b88e67d8ce65 100644
(file)
--- a/
charset.plp
+++ b/
charset.plp
@@
-5,7
+5,8
@@
my @tablist = split m{/+}, $Request || 'default';
Html({
title => 'charset cheat sheet',
Html({
title => 'charset cheat sheet',
- version => '1.2',
+ version => '1.3',
+ canonical => "/charset/$Request" . ($mode && '?compare'),
description => [
"Reference sheet with all glyphs in common character encoding tables,",
"and an overview of Unicode ranges and UTF-8 bytes.",
description => [
"Reference sheet with all glyphs in common character encoding tables,",
"and an overview of Unicode ranges and UTF-8 bytes.",
@@
-14,9
+15,9
@@
Html({
charset codepage unicode ascii utf8 latin glyph character encoding
reference common overview table
'],
charset codepage unicode ascii utf8 latin glyph character encoding
reference common overview table
'],
-
stylesheet => [qw'light']
,
+
(stylesheet => [qw'light']) x !$mode
,
data => [qw(
data => [qw(
- charset-encoding.inc.pl
+ charset
.inc.pl charset
-encoding.inc.pl
charset-unicode.inc.pl charset-ucplanes.inc.pl charset-utf8.inc.pl
)],
});
charset-unicode.inc.pl charset-ucplanes.inc.pl charset-utf8.inc.pl
)],
});
@@
-55,6
+56,7
@@
print join " •\n", (
dos => 'DOS',
mac => 'Apple',
ebcdic => 'EBCDIC',
dos => 'DOS',
mac => 'Apple',
ebcdic => 'EBCDIC',
+ legacy => 'legacy',
$tablist[0] eq 'default' ? () : ('' => 'common'),
],
[
$tablist[0] eq 'default' ? () : ('' => 'common'),
],
[
@@
-78,8
+80,7
@@
use Shiar_Sheet::FormatChar;
my $glyphs = Shiar_Sheet::FormatChar->new;
my @request;
my $glyphs = Shiar_Sheet::FormatChar->new;
my @request;
-my $charsets = do 'charset-encoding.inc.pl'
- or Alert('Encoding metadata could not be read', $@ || $!);
+my $charsets = Data('charset');
sub tabinput {
# generate character table(s)
sub tabinput {
# generate character table(s)
@@
-97,6
+98,7
@@
sub tabinput {
state $visible = {'' => 1}; # all present tables
my %row = (offset => 0, cols => 16);
state $visible = {'' => 1}; # all present tables
my %row = (offset => 0, cols => 16);
+ $row{$_} = $charset->{$_} for qw( note table ); # copy metadata
if (not defined $params) {
my @parents = @{ $charset->{inherit} || [] };
if (not defined $params) {
my @parents = @{ $charset->{inherit} || [] };
@@
-131,7
+133,7
@@
sub tabinput {
# extend earlier range
my $skip = int(($row{endpoint} || $row{startpoint}) / $row{cols});
for ($skip + 1 .. (hex($+{start}) / $row{cols}) - 1) {
# extend earlier range
my $skip = int(($row{endpoint} || $row{startpoint}) / $row{cols});
for ($skip + 1 .. (hex($+{start}) / $row{cols}) - 1) {
- $row{skip}->{ $_ * $row{cols}
- $row{startpoint}
}++;
+ $row{skip}->{ $_ * $row{cols} }++;
}
}
else {
}
}
else {
@@
-153,7
+155,7
@@
sub tabinput {
if (defined $row{table} or defined $row{cell}) {
$row{set} //= $input;
}
if (defined $row{table} or defined $row{cell}) {
$row{set} //= $input;
}
- elsif ($row{set} = Encode::resolve_alias($input)) {
+ elsif ($row{set} = Encode::resolve_alias($
charset->{set} // $
input)) {
$row{offset} = delete $row{startpoint};
if ($charset->{varchar}) {
# array of possibly multiple characters per code point
$row{offset} = delete $row{startpoint};
if ($charset->{varchar}) {
# array of possibly multiple characters per code point
@@
-169,6
+171,7
@@
sub tabinput {
$row{endpoint} -= $row{offset};
$visible->{ascii}++; # assume common base
$row{endpoint} -= $row{offset};
$visible->{ascii}++; # assume common base
+ $row{set} = $input if $charset->{set}; # base override
}
else {
Alert("Encoding <q>$input</q> unknown");
}
else {
Alert("Encoding <q>$input</q> unknown");
@@
-289,8
+292,8
@@
for my $row (@request) {
printf '<div class="section"><table class="glyphs%s">', !$row->{cell} && ' charmap';
my $title = $row->{set};
printf '<div class="section"><table class="glyphs%s">', !$row->{cell} && ' charmap';
my $title = $row->{set};
- $title .= " <aside>(over $_)</aside>"
-
for $row->{parent
} || ();
+ $title .= " <aside>(over $_)</aside>"
for $row->{parent} || ();
+
$title .= " <aside>($_)</aside>" for $row->{note
} || ();
printf '<caption>%s</caption>', $title;
print '<col>' x ($cols + 1);
for my $section (qw{thead}) {
printf '<caption>%s</caption>', $title;
print '<col>' x ($cols + 1);
for my $section (qw{thead}) {
@@
-301,13
+304,13
@@
for my $row (@request) {
print '<tbody>';
while ($offset <= $row->{endpoint} * $colsize) {
print '<tbody>';
while ($offset <= $row->{endpoint} * $colsize) {
- if ($row->{skip}->{$offset}) {
+ if ($row->{skip}->{$offset
+ $row->{offset}
}) {
$offset += $cols * $colsize;
next;
}
print '<tr><th>';
$offset += $cols * $colsize;
next;
}
print '<tr><th>';
- if (defined $row->{skip}->{$offset}) {
+ if (defined $row->{skip}->{$offset
+ $row->{offset}
}) {
print '⋮';
}
else {
print '⋮';
}
else {
@@
-340,14
+343,14
@@
for my $row (@request) {
$cp == ord $glyph ? 'l4' :
$row->{parent} && $glyph eq
Encode::decode($row->{parent}, pack 'C', $cp) ? 'l3' :
$cp == ord $glyph ? 'l4' :
$row->{parent} && $glyph eq
Encode::decode($row->{parent}, pack 'C', $cp) ? 'l3' :
- !
$class
? undef :
+ !
defined $cell
? undef :
$visible->{$glyph} ? 'l2' :
'l1'
);
$visible->{$glyph}++;
}
$visible->{$glyph} ? 'l2' :
'l1'
);
$visible->{$glyph}++;
}
- print '<td title="%s"', $name;
+ print
f
'<td title="%s"', $name;
say $class ? sprintf(' class="X %s">%s', $class, $cell) : '>';
}
continue {
say $class ? sprintf(' class="X %s">%s', $class, $cell) : '>';
}
continue {