charset: enlarge glyph cells
[sheet.git] / charset.plp
index 41af494365bdfb096ccde286d68a236228872a8c..faeedc2822af742923e945b668cbd313b5f10bbe 100644 (file)
@@ -53,7 +53,15 @@ my @request = map {
                if ($input =~ s/-$//) {
                        $endpoint = $row{offset} ? $row{offset} < 160 ? 159 : 191 : 127;
                }
-               if ($row{set} = resolve_alias($input)) {
+
+               if ($input =~ /^U([0-9a-f]+)(?:-([0-9a-f]+))?/) {
+                       my $start = hex($1) << ($2 ? 4 : 8);
+                       my $end = $2 ? hex($2) << 4 : $start + 240;
+                       $row{table} = join '', map { chr } $start .. $end+15;
+                       utf8::upgrade($row{table});  # prevent latin1 output
+                       $row{set} = sprintf 'Unicode block U+%02Xxx', $start >> 8;
+               }
+               elsif ($row{set} = resolve_alias($input)) {
                        if ($row{set} eq 'Internal') {
                                $row{table} = ' ' x ($endpoint < 255 ? 640 : 4096);
                                $row{set} = 'Unicode BMP';
@@ -100,7 +108,7 @@ print "<ul>\n";
 
 my @nibble = (0..9, 'A'..'F');
 for my $row (@request) {
-       print '<li><table class="glyphs">';
+       printf '<li><table class="glyphs%s">', !$row->{cell} && ' charmap';
        printf '<caption>%s</caption>', $row->{set};
        print '<col>';
        for my $section (qw{thead}) {