X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/885337ac8f6df8b7971248d0c31eed25ab5b8123..a668d95d135825e04289106c9a7b73096709eb2d:/tools/mkdigraphs-xorg?ds=inline diff --git a/tools/mkdigraphs-xorg b/tools/mkdigraphs-xorg index be53fff..ec88309 100755 --- a/tools/mkdigraphs-xorg +++ b/tools/mkdigraphs-xorg @@ -4,11 +4,12 @@ use warnings; use utf8; use open IO => ':encoding(utf-8)', ':std'; use re '/msx'; +use lib '.'; use JSON 'decode_json'; use Data::Dump 'pp'; use Shiar_Sheet::FormatChar; -our $VERSION = '1.01'; +our $VERSION = '1.02'; my $matchvim; # enable to prefer best compatibility @@ -41,10 +42,15 @@ while ($_ = readline) { my ($class, $name, undef, undef, $string) = @{ Shiar_Sheet::FormatChar->glyph_info($cp) }; + my $reverse = substr($mnem, 1, 1) . substr($mnem, 0, 1); + my $cmp = $vidi->{key}->{$mnem}; + my $cmpalt = defined $cmp && !$cmp && $vidi->{key}->{$reverse}; my $comparison = ( - !$vidi->{key}->{$mnem} ? 'l3' : # free - $vidi->{key}->{$mnem}->[0] != $cp ? 'l1' : # conflict - $vidi->{key}->{$mnem}->[2] eq 'l5' ? 'l5' : # rfc + !$cmp ? + $cmpalt && $cmpalt->[0] == $cp ? 'l4' : # matches alias + 'l3' : # free + $cmp->[0] != $cp ? 'l1' : # conflict + $cmp->[2] eq 'l5' ? 'l5' : # rfc 'l4' # any ); @@ -77,15 +83,16 @@ print JSON->new->canonical->indent->encode({ title => 'X.Org', key => \%table, intro => join("\n", - 'Character mnemonics following compose key ⎄:', + 'Character mnemonics following compose key ⎄', 'in the X Window System (Shift+AltGr by default).', 'Differences from RFC-1345 are indicated.', - 'Also see common Unicode.', + 'Also see monograph maps', + 'of alternative Xorg input modes with an AltGr modifier.

', ), keywords => [qw( xorg x11 x )], flag => { 'l5' => "matching RFC-1345", - 'l4' => "matching Vim extension", + 'l4' => "matching Vim extension or alternate", 'l3' => "unique to Xorg", 'l1' => "conflict", ('l0' => "Xorg preference") x !!$matchvim,