digraphs: option to show xorg digraphs instead
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 22 Feb 2015 18:01:00 +0000 (19:01 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 9 Jun 2015 03:43:42 +0000 (05:43 +0200)
digraphs.plp

index 84ac97133fccb16f8e7e3b122e830e604d1b1586..b40eac0915cefd19f0176e4bbed836f7f4da169d 100644 (file)
@@ -36,6 +36,18 @@ my @chars2 = (['_'], @chars);  # trailing character (extended set)
 my @columns = !exists $get{split} ? \@chars2 :
        ([@chars2[0, 1, 3, 4, 6]], [@chars2[2, 5, 7]]);
 
+if (exists $get{xorg}) {
+       my $xorg = do 'data/digraphs-xorg.inc.pl'
+               or die "Error loading Xorg data: ", $@ // $!;
+       $_ = [ord $_] for values %{$xorg};
+       $xorg->{$_}->[2] =  # class = same as rfc | any other spec | xorg only
+               $di->{$_} ? $di->{$_}->[2] =~ /\bu-di\b/ ? 'l5' : 'l3' : 'l1'
+               for keys %{$xorg};
+       $chars2[0] = [qw( # ^ _ ` ~ )];
+       @chars = @chars2;
+       $di = $xorg;
+}
+
 for my $colchars (@columns) {
 print '<table class="glyphs dimap"><col>';
 print qq'<colgroup span="$_">' for map {scalar @$_} @{$colchars};