git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unicode: colourise different character classes
[sheet.git]
/
unicode.plp
diff --git
a/unicode.plp
b/unicode.plp
index 1aadd030a23049454ad63d3ca7d1b8dbcbef0740..2d5b54c8a58812f010a9e30dca9fe820a47b9b11 100644
(file)
--- a/
unicode.plp
+++ b/
unicode.plp
@@
-2,6
+2,7
@@
use utf8;
use strict;
use warnings;
use utf8;
use strict;
use warnings;
+no warnings 'qw'; # that's not a comment, it's a NUMBER SIGN
use open IO => ':utf8';
our $VERSION = '1.0';
use open IO => ':utf8';
our $VERSION = '1.0';
@@
-31,20
+32,33
@@
tbody {
h2, h3 {
clear: both;
}
h2, h3 {
clear: both;
}
+h2 {
+ margin: 0 1ex;
+ font-size: 100%;
+}
th {
text-align: left;
font-size: 50%;
background: #888;
th {
text-align: left;
font-size: 50%;
background: #888;
+ background: #778;
+ background: #889;
color: #FFF;
padding: 0 0.2em;
}
color: #FFF;
padding: 0 0.2em;
}
+th, td {
+ border-color: #778;
+ border: 1px solid #888;
+}
thead td {
border: 0;
thead td {
border: 0;
+ background: transparent;
+}
+thead th {
+ text-align: center;
}
td {
}
td {
- background: transparent;
vertical-align: top;
margin: 0;
padding: 0;
vertical-align: top;
margin: 0;
padding: 0;
@@
-57,17
+71,18
@@
small {
small.digraph {
background: #888;
color: #FFF;
small.digraph {
background: #888;
color: #FFF;
+
+ background: #000;
+ color: #FFF;
+ opacity: 0.3;
}
small.value {
background: #CCC;
color: #666;
}
small.value {
background: #CCC;
color: #666;
-}
-td.empty {
- background: #DDD;
-}
-td.reserved {
- background: #BBB;
+ background: #800;
+ color: #FFF;
+ opacity: 0.3;
}
</style>
</head>
}
</style>
</head>
@@
-108,16
+123,29
@@
sub table {
$colspan++;
next;
}
$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 '=') {
}
elsif ($cell eq '=') {
- $class = '
r
eserved';
+ $class = '
R
eserved';
$cell = '';
}
$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('<td%s%s%s>%s%s',
defined $name ? qq{ title="$name"} : '',
$rows[-1] .= sprintf('<td%s%s%s>%s%s',
defined $name ? qq{ title="$name"} : '',
@@
-135,7
+163,7
@@
sub table {
if ($colheads) {
unshift @rows, sprintf '<thead><tr><td>%s<tbody>', join '',
if ($colheads) {
unshift @rows, sprintf '<thead><tr><td>%s<tbody>', join '',
- map { sprintf '<th title="%2$s">%s', split(/:/, $_, 2) }
+ map { sprintf '<th title="%2$s">%s', split(/:/, $_, 2)
, '', ''
}
@$colheads
}
@$colheads
}
@@
-153,7
+181,7
@@
print table(@$_) for (
print "<h2>Arrows</h2>\n\n";
print table(@$_) for (
[ 4 => [qw{. ↖ ↑ ↗ ↔ . ← - → ↕ . ↙ ↓ ↘ -}]],
print "<h2>Arrows</h2>\n\n";
print table(@$_) for (
[ 4 => [qw{. ↖ ↑ ↗ ↔ . ← - → ↕ . ↙ ↓ ↘ -}]],
- [ 4 => [qw{. ⇖ ⇑ ⇗ ⇔ . ⇐ - ⇒ ⇕ . �
� ⇓ ⇙
-}]],
+ [ 4 => [qw{. ⇖ ⇑ ⇗ ⇔ . ⇐ - ⇒ ⇕ . �
� ⇓ ⇘
-}]],
[ 3 => [qw{. ◤ ▲ ◥ . ◀ ◆ ▶ . ◣ ▼ ◢}]],
[ 3 => [qw{. ◸ △ ◹ . ◁ ◇ ▷ . ◺ ▽ ◿}]],
);
[ 3 => [qw{. ◤ ▲ ◥ . ◀ ◆ ▶ . ◣ ▼ ◢}]],
[ 3 => [qw{. ◸ △ ◹ . ◁ ◇ ▷ . ◺ ▽ ◿}]],
);
@@
-176,14
+204,21
@@
print table(@$_) for (
[ 3 => [qw{. ╓ ╥ ╖ . ╟ ╫ ╢ . ╙ ╨ ╜ }]],
);
[ 3 => [qw{. ╓ ╥ ╖ . ╟ ╫ ╢ . ╙ ╨ ╜ }]],
);
-print "<h2>
Sign
s</h2>\n\n";
+print "<h2>
Block
s</h2>\n\n";
print table(@$_) for (
print table(@$_) for (
- [ 3 => [qw{. ▘ ▀ ▝ . ▌ █ ▐ . ▖ ▄ ▗ . ░ ▒ ▓}]],
+ [ 3 => [qw{. ▘ ▀ ▝ . ▌ █ ▐ . ▖ ▄ ▗ }]],
+ [ 3 => [qw{. ░ . ▒ . ▓ }]],
+ [ 2 => [qw{. ▛ ▚ ▟ . ▙ ▞ ▜ }]],
+ [ 2 => [qw{. ▁ ▂ ▃ ▄ ▅ ▆ ▇ ▔ . ▏ ▎ ▍ ▌ ▋ ▊ ▉ ▕ }]],
[ 3 => [qw{. □ ▣ ■ . ▤ ▦ ▥ . ▧ ▩ ▨}]],
[ 3 => [qw{. □ ▣ ■ . ▤ ▦ ▥ . ▧ ▩ ▨}]],
- [ 4 => [qw{. ♠ ♡ ♢ ♣ . ♤ ♥ ♦ ♧}]],
- [ 5 => [qw{. ☼ ☿ ♀ ♁ ♂ ♃ ♄ ♅ ♆ ♇}]], # solar
-# [12 => [qw{. ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓}]], # zodiac
+);
+
+print "<h2>Signs</h2>\n\n";
+print table(@$_) for (
[ 8 => [qw{. ¤ ¢ ₥ € £ ₨ $ ¥ . ₫ ₭ ₦ ₱ ₧ ₮ ₩ ₪}]],
[ 8 => [qw{. ¤ ¢ ₥ € £ ₨ $ ¥ . ₫ ₭ ₦ ₱ ₧ ₮ ₩ ₪}]],
+ [ 4 => [qw{. ♠ ♡ ♢ ♣ . ♤ ♥ ♦ ♧}]],
+ [ 5 => [qw{. ☉ ☿ ♀ ♁ ♂ ♃ ♄ ♅ ♆ ♇}]], # solar
+ [12 => [qw{. ♈ ♉ ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓}]], # zodiac
);
print "<h2>IPA</h2>\n\n";
);
print "<h2>IPA</h2>\n\n";