unicode: prepend unicode 6.0 support level
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 11 Feb 2015 23:17:04 +0000 (00:17 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 13 Feb 2015 16:46:33 +0000 (17:46 +0100)
Distinguish more recent characters as .l2 in all modes.
In html mode, further distinguish latin1 (i.e. HTML version 3.2) subset
from HTML4 entities.

Shiar_Sheet/FormatChar.pm
unicode.plp

index 35f6076..8b00318 100644 (file)
@@ -109,31 +109,34 @@ sub cell {
 
                if ($self->{style} eq 'di') {
                        if ($class =~ /\bu-di\b/) {
-                               push @class, ('l3', 'u-di'); # standard digraph
+                               push @class, ('l4', 'u-di'); # standard digraph
                        }
                        elsif ($class =~ /\bu-prop\b/) {
-                               push @class, ('l2', 'u-prop'); # unofficial
+                               push @class, ('l3', 'u-prop'); # unofficial
                        }
                }
                elsif ($self->{style} eq 'html') {
                        if (defined $entity) {
-                               push @class, ('l3', 'u-html');
+                               push @class, ($codepoint <= 0xFF ? 'l4' : 'l3', 'u-html');
                        }
                }
                else {
                        if ($codepoint <= 0xFF) {
-                               push @class, 'l3', 'u-lat1';  # latin1
+                               push @class, 'l4', 'u-lat1';  # latin1
                        }
                        elsif ($codepoint <= 0xD7FF) {
-                               push @class, 'l2', 'u-bmp';  # bmp
+                               push @class, 'l3', 'u-bmp';  # bmp
                        }
                }
 
                if ($input =~ /[ -~]/) {
-                       push @class, 'l4', 'u-ascii'; # ascii
+                       push @class, 'l5', 'u-ascii'; # ascii
+               }
+               elsif ($input =~ /^\p{in=6.0}+$/) {
+                       push @class, 'l2'; # in unicode 6.0
                }
                else {
-                       push @class, 'l1'; # basic unicode
+                       push @class, 'l1'; # any unicode
                }
        }}
 
index 095b206..b14deff 100644 (file)
@@ -163,9 +163,10 @@ $glyphs->print(map {
 
 <div class="legend">
        <table class="glyphs"><tr>
-       <td class="X l4">ascii
-       <td class="X l3"><:= $glyphs->{style} eq 'di' ? 'digraph' : 'latin1' :>
-       <td class="X l2"><:= $glyphs->{style} eq 'di' ? 'proposed' : 'BMP' :>
+       <td class="X l5">ascii
+       <td class="X l4"><:= $glyphs->{style} eq 'di' ? 'digraph' : 'latin1' :>
+       <td class="X l3"><:= $glyphs->{style} eq 'di' ? 'proposed' : 'HTML4' :>
+       <td class="X l2">unicode ≤6.0
        <td class="X l1">other unicode
        <td class="X ex">discouraged
        </table>