From: Mischa POSLAWSKY Date: Fri, 21 Apr 2017 17:07:12 +0000 (+0200) Subject: charset: symbols inheritance, override private use X-Git-Tag: v1.10~116 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/4a6c818d4db51cb135196d442a8c5c7b25544744 charset: symbols inheritance, override private use Find unicode equivalents for placeholders in Encode::Symbol maps, matching descriptions in ucm sources. Compare Windows Symbol at with Adobe version at . --- diff --git a/charset.plp b/charset.plp index 5955c39..e8382f5 100644 --- a/charset.plp +++ b/charset.plp @@ -105,7 +105,7 @@ sub tabinput { hebrew => [qw( iso-8859-8 cp1255 MacHebrew cp862 U59-5F )], thai => [qw( iso-8859-11 cp874 MacThai )], vietnamese => [qw( viscii cp1258 MacVietnamese )], - symbol => [qw( symbol dingbats MacDingbats AdobeZdingbat AdobeSymbol )], + symbols => [qw( symbol dingbats MacDingbats )], # iso-code shorthand 1 => 'westeur', @@ -125,7 +125,7 @@ sub tabinput { return; } - state $visible = {}; # all present tables + state $visible = {'' => 1}; # all present tables my %row = (offset => 0, cols => 16); my $params = $input =~ s/[+](.*)\z// ? $1 : undef; @@ -133,6 +133,11 @@ sub tabinput { state $INHERIT = { 'cp437' => ['cp850' => 0, 'ascii' => '0-31+128'], # ascii range overridden later 'gsm0338' => ['ascii' => '0-127'], + 'dingbats' => ['' => '32-127+160'], + 'MacDingbats' => ['dingbats' => '128-159'], + 'AdobeZdingbat'=> ['MacDingbats' => '128-159'], # should be identical but maps to private use + 'symbol' => ['' => '32-127+160'], + 'AdobeSymbol' => ['symbol' => '32-127+160', '' => '32-127+160'], # minor differences, irrelevant except for different '€' 'iso-8859-2' => ['iso-8859-1' => '160'], 'iso-8859-3' => ['iso-8859-1' => '160'], #TODO: also apply to iso-8859-9 @@ -313,6 +318,21 @@ sub tabinput { ); } } + elsif ($row{set} eq 'symbol') { + if ($row{offset} <= 0x60 and $row{endpoint} >= 0x60 - $row{offset}) { + # replace radical extender by closest unicode equivalent + substr($row{table}, 0x60 - $row{offset}, 1) = '│'; + } + if ($row{offset} <= 0xBD and $row{endpoint} >= 0xFF - $row{offset}) { + substr($row{table}, 0xBD - $row{offset}, 2) = '⏐⎯'; # arrow extenders + substr($row{table}, 0xD2 - $row{offset}, 3) = '®©™'; # serif variants + substr($row{table}, 0xE0 - $row{offset}, 1) = '◊'; # replace lookalike, should match AdobeSymbol + substr($row{table}, 0xE2 - $row{offset}, 3) = '®©™'; # sans-serif variants + substr($row{table}, 0xE6 - $row{offset}, 10) = '⎛⎜⎝⎡⎢⎣⎧⎨⎩⎪'; + substr($row{table}, 0xF0 - $row{offset}, 1) = '€'; + substr($row{table}, 0xF4 - $row{offset}, 11) = '⎮⌡⎞⎟⎠⎤⎥⎦⎫⎬⎭'; + } + } $visible->{ascii} = # assume common base $visible->{ $row{set} } = 1;