X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/38dcfca045c69d0e303e8e5a4ca4915202e19970..eea96a232c342a6e73c9a8acdc8ee9e8218fe2ae:/charset.plp
diff --git a/charset.plp b/charset.plp
index c83508b..080e208 100644
--- a/charset.plp
+++ b/charset.plp
@@ -1,111 +1,237 @@
-<:
-use utf8;
-use strict;
-use warnings;
-use open IO => ':utf8';
-
-our $VERSION = '1.0';
-
-$header{content_type} = 'text/html; charset=utf-8';
-
-:>
-
-
-
-\n";
+ $attr .= sprintf ' colspan=%d', $len unless $len == 1;
+ $attr .= $1 if $class and $class =~ s/( \w+="[^"]*")//;
+ $attr .= sprintf ' class="%s"', $class if $class;
+ $attr .= sprintf ' title="%s"', EscapeHTML($title) if $title;
+ return "$name";
+}
-my @nibble = (0..9, 'A'..'F');
-for my $tablenum (0 .. $#tables) {
- print '';
- printf '%s', $request[$tablenum];
- print '';
+for my $row (@request) {
+ my $colsize = $row->{cell} && $row->{cell}->{colsize} || 1;
+ printf '', !$row->{cell} && ' charmap';
+ my $title = $row->{set};
+ $title .= " " for $row->{setnote} // ();
+ printf '%s', $title;
+ print '' x ($cols + 1);
+ my $coldigits = $colsize * $cols <= 16 ? 1 : 2; # uniform length of hexadecimal header
for my $section (qw{thead}) {
print "<$section>â±";
- print ' | ', $_ for @nibble;
+ printf ' | %0*X', $coldigits, $_ * $colsize for 0 .. $cols - 1;
print "\n";
}
print ' | ';
- for my $msb (0 .. $#nibble) {
- print '', $nibble[$msb];
- for my $lsb (0 .. $#nibble) {
- my $glyph = substr $tables[$tablenum], ($msb<<4) + $lsb, 1;
+ for my $msb (0 .. ((length($row->{table}) || 256) - 1) / $cols) {
+ printf ' |
---|
%X', ($msb + int($row->{offset} / $cols)) * $cols * $colsize;
+ for my $lsb (0 .. $cols - 1) {
+ my $val = ( ($msb * $cols) + $lsb ) * $colsize;
+ if ($row->{cell}) {
+ print range_cell($row->{cell}, $val);
+ next;
+ }
+
+ my $glyph = substr $row->{table}, $val, 1;
if ($glyph eq $NOCHAR) {
print ' | ';
next;
}
- my $info = [ord $glyph];
- if (defined (my $mnem = $di{ord $glyph})) {
- $info = $diinfo->{$mnem};
- }
- my ($codepoint, $name, $prop, $script, $string) = @$info;
- $glyph = quote($string || $glyph);
- my $desc = sprintf 'U+%04X%s', $codepoint, $name && " ($name)";
- my @class = ('X', grep {$_} $prop, $script);
-
- $glyph = "$glyph" if $prop eq 'Zs';
-
- printf "\n".' | %s',
- join(' ', @class), quote($desc), $glyph;
+ print "\n".$glyphs->glyph_cell($glyph);
}
print "\n";
}
- print " |
---|
\n";
+ say ' ';
}
-print "\n";
-
:>
-
-
-
+
+
+ control
+ | whitespace
+ | diacritic
+ | punctuation
+ | symbol
+ | numeric
+ | greek
+ | aramaic
+ | syllabic
+ african
+ | japanese
+ | cjk
+ | chinese
+ |
+ | alphabetic
+ |
+
+
+ unicode 7.0
+ | proposed
+ | deprecated
+ | unassigned
+ | invalid
+ |
+
+
|