From: Mischa POSLAWSKY Date: Fri, 21 Apr 2017 22:19:29 +0000 (+0200) Subject: charset: encode webdings font X-Git-Tag: v1.10~111 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/466e0b0bee6b61530b0be73a394df19828bf24f9 charset: encode webdings font Reference: --- diff --git a/Encode/Webdings.pm b/Encode/Webdings.pm new file mode 100644 index 0000000..eb6e487 --- /dev/null +++ b/Encode/Webdings.pm @@ -0,0 +1,22 @@ +package Encode::Webdings; + +use 5.014; +use warnings; +use utf8; + +our $VERSION = '1.00'; + +use parent 'Encode::Wingdings'; +__PACKAGE__->Define('webdings'); + +our @MAP = (qw[ + 🕷 🕸 🕲 🕶 🏆 🎖 🖇 🗨 🗩 🗰 🗱 🌶 🎗 ▞ 🙼 🗕 🗖 🗗 ⏴ ⏵ ⏶ ⏷ ⏪ ⏩ ⏮ ⏭ ⏸ ⏹ ⏺ 🗚 🗳 + 🛠 🏗 🏘 🏙 🏚 🏜 🏭 🏛 🏠 🏖 🏝 🛣 🔍 🏔 👁 👂 🏞 🏕 🛤 🏟 🛳 🕬 🕫 🕨 🔈 🎔 🎕 🗬 🙽 🗭 🗪 🗫 + ⮔ ✔ 🚲 □ 🛡 📦 🛱 ■ 🚑 🛈 🛩 🛰 🟈 🕴 ⚫ 🛥 🚔 🗘 🗙 ❓ 🛲 🚇 🚍 ⛳ 🛇 ⊖ 🚭 🗮 | 🗯 🗲  + 🚹 🚺 🛉 🛊 🚼 👽 🏋 ⛷ 🏂 🏌 🏊 🏄 🏍 🏎 🚘 🗠 🛢 💰 🏷 💳 👪 🗡 🗢 🗣 ✯ 🖄 🖅 🖃 🖆 🖹 🖺 🖻 + 🕵 🕰 🖽 🖾 📋 🗒 🗓 📖 📚 🗞 🗟 🗃 🗂 🖼 🎭 🎜 🎘 🎙 🎧 💿 🎞 📷 🎟 🎬 📽 📹 📾 📻 🎚 🎛 📺 💻 + 🖥 🖦 🖧 🕹 🎮 🕻 🕼 📟 🖁 🖀 🖨 🖩 🖿 🖪 🗜 🔒 🔓 🗝 📥 📤 🕳 🌣 🌤 🌥 🌦 ☁ 🌧 🌨 🌩 🌪 🌬 🌫 + 🌜 🌡 🛋 🛏 🍽 🍸 🛎 🛍 Ⓟ ♿ 🛆 🖈 🎓 🗤 🗥 🗦 🗧 🛪 🐿 🐦 🐟 🐕 🐈 🙬 🙮 🙭 🙯 🗺 🌍 🌏 🌎 🕊 +]); + +1; diff --git a/Encode/Wingdings.pm b/Encode/Wingdings.pm index df06b86..cb553dd 100644 --- a/Encode/Wingdings.pm +++ b/Encode/Wingdings.pm @@ -1,6 +1,7 @@ package Encode::Wingdings; use 5.014; +no strict 'refs'; use warnings; use utf8; @@ -23,7 +24,7 @@ sub decode ($$;$) { my ($self, $input, $check) = @_; my $output = ''; for (unpack 'C*', $input) { - $output .= $_ < 33 ? chr : $MAP[$_ - 33]; + $output .= $_ < 33 ? chr : ${ref($self).'::MAP'}[$_ - 33]; } return $output; } diff --git a/charset.plp b/charset.plp index 25bc44b..be31655 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 )], - symbols => [qw( symbol dingbats MacDingbats wingdings )], + symbols => [qw( symbol dingbats MacDingbats wingdings webdings )], # iso-code shorthand 1 => 'westeur', @@ -139,6 +139,7 @@ sub tabinput { 'symbol' => ['' => '32-127+160'], 'AdobeSymbol' => ['symbol' => '32-127+160', '' => '32-127+160'], # minor differences, irrelevant except for different '€' 'wingdings' => ['' => '32'], + 'webdings' => ['' => '32'], 'iso-8859-2' => ['iso-8859-1' => '160'], 'iso-8859-3' => ['iso-8859-1' => '160'], #TODO: also apply to iso-8859-9 @@ -253,8 +254,8 @@ sub tabinput { } } - if (lc $input eq 'wingdings') { - require Encode::Wingdings; + if ($input =~ m{ \A (?:wing|web)dings \z }ix) { + require "Encode/\u$input.pm"; } if ($input =~ m{ \A u ([0-9a-f]+) (?:-([0-9a-f]+))? \z }ix) {