X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/c74ecf690c0c9047a11049d629a791de47857b53..0b4be0d5ff71ca539da8e741826d499a5d649004:/unicode.plp
diff --git a/unicode.plp b/unicode.plp
index 8dfe132..51bf7c8 100644
--- a/unicode.plp
+++ b/unicode.plp
@@ -1,28 +1,23 @@
-<:
-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';
-
-$header{content_type} = 'text/html; charset=utf-8';
+<(common.inc.plp)><:
+ our $VERSION = 'v1.0';
:>
-
+
-
@@ -30,15 +25,7 @@ Also see the
complete digraphs table.
<:
my $diinfo = do 'digraphs.inc.pl';
my %di = map { $diinfo->{$_}->[0] => $_ } grep { ref $diinfo->{$_} }
- keys %$diinfo;
-
-sub quote {
- local $_ = shift;
- s/"/"/g;
- s/</g;
- s/>/>/g;
- return $_;
-}
+ sort { length $a <=> length $b } keys %$diinfo;
sub glyph_table {
my ($digraphs) = @_;
@@ -59,7 +46,6 @@ sub glyph_table {
my $colspan = 1;
for my $cell (@$digraphs) {
- my $class;
if ($cell =~ s/^\.//) {
# dot indicates start of a new row
push @rows, '';
@@ -76,37 +62,50 @@ sub glyph_table {
next;
}
- my $code = join '', map { $di{ord $_} || '' } split //, $cell;
- my $name = $diinfo->{$code}->[1];
+ my ($code, $name);
# determine display class
- if ($cell =~ s/^-//) {
-# $class = 'Empty';
+ my @class;
+ if ($cell eq '-') {
+ $cell = '';
}
elsif ($cell eq '=') {
- $class = 'Reserved';
+ push @class, 'di-invalid';
$cell = '';
}
- elsif ($cell =~ /[ -~]/) {
- $class = 'Ascii';
- }
- elsif (not $code) {
- $class = 'DiNone';
- }
- elsif ($diinfo->{$code}->[2] =~ /\bXz\b/) {
- $class = 'DiProp';
- }
else {
- $class = 'Di';
+ if ($cell =~ s/^-//) {
+ push @class, 'di-rare'; # discouraged
+ }
+
+ $code = join '', map { $di{ord $_} || '' } split //, $cell;
+ $name = $diinfo->{$code}->[1];
+ length $code == 2 or undef $code;
+
+ if (defined $code) {
+ push @class, 'di-d'; # digraph
+ push @class, 'di-prop' # unofficial
+ if $diinfo->{$code}->[2] =~ /\bXz\b/;
+ }
+ elsif (defined $name) {
+ push @class, 'X';
+ }
+
+ if ($cell =~ /[ -~]/) {
+ push @class, 'di-a'; # ascii
+ }
+ else {
+ push @class, 'di-b'; # basic unicode
+ }
}
# add cell html
$rows[-1] .= sprintf('
%s%s',
defined $name ? qq{ title="$name"} : '',
- defined $class ? qq{ class="$class"} : '',
+ @class ? sprintf(' class="%s"', join ' ', @class) : '',
$colspan > 1 && qq{ colspan="$colspan"},
- $cell eq '' ? ' ' : quote($cell),
- $code ne '' ? sprintf(' %s', quote($code))
+ $cell eq '' ? ' ' : EscapeHTML($cell),
+ defined $code ? sprintf(' %s', EscapeHTML($code))
: length($cell) == 1 && $cell !~ /[a-z]/
? sprintf(' %04X', 'value', ord $cell)
: '',
@@ -121,7 +120,7 @@ sub glyph_table {
sub print_glyph_tables {
while (@_) {
- printf "%s\n\n", shift;
+ printf ' %s'."\n\n", shift;
while (ref $_[0] and $_ = shift) {
print glyph_table($_);
}
@@ -129,20 +128,40 @@ sub print_glyph_tables {
}
}
+our $verbose = exists $get{v};
+
print_glyph_tables(
'Popular',
- [qw{. « » . ⹠⺠. â â . â â . â â}],
- [qw{. â ⡠⢠. § ¶ # . © ® ⢠. â à ÷ . ± ² â}],
- [qw{. Ã¥ ä ö ü à . Ã
æ ø ű ſ}],
+ [qw{. « » . ⹠⺠. â â . â â . â â . â â}],
+ [qw{. â ⡠⢠. § ¶ # . © ® ⢠. ° â² â³ . â à ÷ . ± ² â}],
+ [qw{. â â . â â . ⺠⹠. â â . â â . â ⺠}],
+ [qw{. Ã¥ ä ö ü à . Ä Ã¦ ø ű Å¿}],
[qw{. ¿ ç ñ é ê è}],
+ [qw{. α β}], [qw{. ×}],
+
+ 'Signs',
+ [qw{. ¤ ¢ ⥠⬠£ ⨠$ Â¥ . â« â ⦠Ⱡ⧠⮠⩠âª}],
+ [qw{. â ⡠⢠⣠. ⤠⥠⦠â§}],
+ [qw{. â â¿ â â â â â â
â â}], # solar
+ [qw{. â â â â â â â â â â â â}], # zodiac
'Arrows',
[qw{. â â â â . â - â â . â â â -}],
[qw{. â â â â . â - â â . â â â -}],
- [qw{. ⤠Ⲡ⥠. â â ⶠ. ⣠⼠â¢}],
- [qw{. ⸠Ⳡ⹠. â â â· . ⺠⽠â¿}],
+ [qw{. ⬠⧠⬠⬠. ⦠- ⨠Ⳡ. ⬠⩠⬠-}],
+ [qw{. ⬠⬠⬠⬠. â¬
- ⡠⬠. ⬠⬠⬠-}],
+ [qw{. ⩠⬠⬠. ⧠⡠⨠. ⬠⬠⪠}],
+ [qw{. ⤠Ⲡ⥠. â â ⶠ. ⣠⼠⢠}],
+ [qw{. ⸠Ⳡ⹠. â â â· . ⺠⽠⿠}],
+$verbose ? (
+ [qw{. î© î§ îª . î¥ - î¦ . î« î¨ î¬ }],
+ [qw{. î± î¯ î² . î - î® . î³ î° î´ }],
+) : (),
'Line drawing',
+ [qw{. â ⦠â â . â ⬠⣠â . â â© â - }],
+ [qw{. â ⤠â . â ⪠⡠. â ⧠â }],
+ [qw{. â ⥠â . â ⫠⢠. â ⨠â }],
[qw{. â ⬠â . â ⼠⤠. â â´ â}],
[qw{. â â³ â . ⣠â â« . â â» â}],
[qw{. â ⯠â . â ⿠⥠. â â· â}],
@@ -154,30 +173,21 @@ print_glyph_tables(
. â¹ â â â â â» â½
}],
[qw{. â± â³ â² }],
- [qw{. â ⦠â â . â ⬠⣠â . â â© â - }],
- [qw{. â ⤠â . â ⪠⡠. â ⧠â }],
- [qw{. â ⥠â . â ⫠⢠. â ⨠â }],
'Blocks',
- [qw{. â â â . â â â . â â â }],
+ [qw{. ⡠⣠â . ⤠⦠⥠. ⧠⩠â¨}],
[qw{. â . â . â }],
+ [qw{. â â â . â â â . â â â }],
[qw{. â â â . â â â }],
[qw{. â â â â â
â â â . â â â â â â â â }],
- [qw{. ⡠⣠â . ⤠⦠⥠. ⧠⩠â¨}],
-
- 'Signs',
- [qw{. ¤ ¢ ⥠⬠£ ⨠$ Â¥ . â« â ⦠Ⱡ⧠⮠⩠âª}],
- [qw{. â ⡠⢠⣠. ⤠⥠⦠â§}],
- [qw{. â â¿ â â â â â â
â â}], # solar
- [qw{. â â â â â â â â â â â â}], # zodiac
'IPA',
[qw{
- BiL:Bilabial LD:Labiodental D:Dental Alv:Alveolar PA:Postalveolar
Rf:Retroflex Pal:Palatal Vel:Velar Uv:Uvular Ph:Pharyngeal
EG:Epiglottal Gl:Glottal
- .>Plosive p p̪ > > t Ê c k q = Ê¡ Ê
- .>Voiced_Plosive b b̪ > > d É É É¡ É¢ = - =
+ .>Plosive p -ȹ > > t Ê c k q = Ê¡ Ê
+ .>Voiced_Plosive b -ȸ > > d É É É¡ É¢ = - =
.>Nasal m ɱ > > n ɳ ɲ Šɴ = = =
.>Trill Ê - > > r - - = Ê = -Ñ =
.>Tap/flap - â±± > > ɾ ɽ - = É¢Ì = - =
@@ -190,13 +200,16 @@ print_glyph_tables(
.>Click Ê - Ç Ç Ç -â¼ Ç - - = = =
.>Implosive É É̪ > > É -á¶ Ê É Ê = = =
}],
+ [qw{
+ co . É . Ê . ɧ . É¥ . Ê . w
+ }],
[(
'-',
map { substr($_, 0, 1).':'.$_, substr($_, 0, 1)." r:$_ rounded" }
qw{Front Central Back}
), qw{
.>Close i y ɨ Ê É¯ u
- .>Near-close - ɪ Ê - Ê -
+ .>Near-close ɪ Ê - - - Ê
.>Close-mid e ø É Éµ ɤ o
.>Mid - - É - - -
.>Open-mid É Å É É Ê É
@@ -204,14 +217,7 @@ print_glyph_tables(
.>Open a ɶ - - É É
}],
- 'Alphabetics',
- [qw{
- .>Latin a Ä« ı Ä Ã´ ɳ Šṡ Å¡ Ä Ã° Æ·
- .>Cyrillic а Ñ Ð¹ Ñ Ñ Ð½ Ñ Ñ Ñ Ñ Ñ Ð¯
- .>Greek α ί Ï Î· Ï Ï Ï Ï Ï Î¸ ξ Ω
- .>Hebrew × ×² × ×¢ × × × ×¡ ש × ×¦ ×¥
- }],
-
+$verbose ? (
'Japanese',
[qw{
- A I U E O _
@@ -224,7 +230,7 @@ print_glyph_tables(
.>M ã¾ ã¿ ã ã ã =
.>Y ã = ã = ã =
.>R ã ã ã ã ã =
- .>W ã ã = ã ã =
+ .>W ã -ã = -ã ã =
}],
[qw{
- A I U E O
@@ -256,20 +262,29 @@ print_glyph_tables(
.>P ã ã ã ã ã
.>V 㷠㸠㴠㹠ãº
}],
+) : (),
);
:>
-
+
+ ascii
+ | digraph
+ | proposed
+ | other unicode
+ | discouraged
+ |
+
+
+
|