From: Mischa POSLAWSKY Date: Sat, 11 Oct 2008 01:35:21 +0000 (+0000) Subject: unicode: colourise different character classes X-Git-Tag: v1.2~19 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/982ebe99c0ce43548ad4910fb87d7b425b6ff689 unicode: colourise different character classes --- diff --git a/digraphs.css b/digraphs.css index 22c2d6f..6019e5e 100644 --- a/digraphs.css +++ b/digraphs.css @@ -108,6 +108,13 @@ td.Zs {background: #ACB} /* space */ td.Zs span {background: #EEE} td.Co {background: #A99} /* private */ +/* alternate categories */ +td.Ascii {background: #EFD} /* ascii */ +td.Di {background: #FFD} /* rfc-1345 digraph */ +td.DiProp {background: #FED} /* proposed digraph */ +td.DiNone {background: #FDD} /* other unicode */ +td.Reserved {background: #BBB} /* impossible */ + /* hover effects */ td.X:hover {cursor: help} td.Greek:hover {background: #FA9} diff --git a/unicode.plp b/unicode.plp index acca2b9..2d5b54c 100644 --- a/unicode.plp +++ b/unicode.plp @@ -32,20 +32,33 @@ tbody { h2, h3 { clear: both; } +h2 { + margin: 0 1ex; + font-size: 100%; +} th { text-align: left; font-size: 50%; background: #888; + background: #778; + background: #889; color: #FFF; padding: 0 0.2em; } +th, td { + border-color: #778; + border: 1px solid #888; +} thead td { border: 0; + background: transparent; +} +thead th { + text-align: center; } td { - background: transparent; vertical-align: top; margin: 0; padding: 0; @@ -58,17 +71,18 @@ small { small.digraph { background: #888; color: #FFF; + + background: #000; + color: #FFF; + opacity: 0.3; } small.value { background: #CCC; color: #666; -} -td.empty { - background: #DDD; -} -td.reserved { - background: #BBB; + background: #800; + color: #FFF; + opacity: 0.3; } @@ -109,16 +123,29 @@ sub table { $colspan++; next; } - elsif ($cell =~ s/^-//) { - $class = 'empty'; + + my $code = join '', map { $di{ord $_} || '' } split //, $cell; + my $name = $diinfo->{$code}->[1]; + + if ($cell =~ s/^-//) { +# $class = 'Empty'; } elsif ($cell eq '=') { - $class = 'reserved'; + $class = 'Reserved'; $cell = ''; } - - my $code = join '', map { $di{ord $_} || '' } split //, $cell; - my $name = $diinfo->{$code}->[1]; + elsif ($cell =~ /[ -~]/) { + $class = 'Ascii'; + } + elsif (not $code) { + $class = 'DiNone'; + } + elsif ($diinfo->{$code}->[2] =~ /\bXz\b/) { + $class = 'DiProp'; + } + else { + $class = 'Di'; + } $rows[-1] .= sprintf('%s%s', defined $name ? qq{ title="$name"} : '',