From: Mischa POSLAWSKY Date: Fri, 21 Apr 2017 20:05:52 +0000 (+0200) Subject: charset: encode wingdings2 font X-Git-Tag: v1.10~110 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/33f2daf5edc4b89711060babeaf8d674d8482128 charset: encode wingdings2 font Reference: --- diff --git a/Encode/Wingdings.pm b/Encode/Wingdings.pm index cb553dd..f63ec04 100644 --- a/Encode/Wingdings.pm +++ b/Encode/Wingdings.pm @@ -20,11 +20,13 @@ our @MAP = (qw[ 🡪 🡩 🡫 🡬 🡭 🡯 🡮 🡸 🡺 🡹 🡻 🡼 🡽 🡿 🡾 ⇦ ⇨ ⇧ ⇩ ⬄ ⇳ ⬀ ⬁ ⬃ ⬂ 🢬 🢭 🗶 ✔ 🗷 🗹  ]); +our $NOCHAR = '�'; + sub decode ($$;$) { my ($self, $input, $check) = @_; my $output = ''; for (unpack 'C*', $input) { - $output .= $_ < 33 ? chr : ${ref($self).'::MAP'}[$_ - 33]; + $output .= $_ < 33 ? chr : ${ref($self).'::MAP'}[$_ - 33] // $NOCHAR; } return $output; } diff --git a/Encode/Wingdings2.pm b/Encode/Wingdings2.pm new file mode 100644 index 0000000..cf70296 --- /dev/null +++ b/Encode/Wingdings2.pm @@ -0,0 +1,22 @@ +package Encode::Webdings2; + +use 5.014; +use warnings; +use utf8; + +our $VERSION = '1.00'; + +use parent 'Encode::Wingdings'; +__PACKAGE__->Define('wingdings2'); + +our @MAP = (qw[ + 🖊 🖋 🖌 🖍 ✄ ✀ 🕾 🕽 🗅 🗆 🗇 🗈 🗉 🗊 🗋 🗌 🗍 📋 🗑 🗔 🖵 🖶 🖷 🖸 🖭 🖯 🖱 🖒 🖓 🖘 🖙 + 🖚 🖛 👈 👉 🖜 🖝 🖞 🖟 🖠 🖡 👆 👇 🖢 🖣 🖑 🗴 ✓ 🗵 ☑ ☒ ☒ ⮾ ⮿ ⦸ ⦸ 🙱 🙴 🙲 🙳 ‽ 🙹 🙺 + 🙻 🙦 🙤 🙥 🙧 🙚 🙘 🙙 🙛 ⓪ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⓿ ❶ ❷ ❸ ❹ ❺ ❻ ❼ ❽ ❾ ❿  + ☉ 🌕 ☽ ☾ ⸿ ✝ 🕇 🕜 🕝 🕞 🕟 🕠 🕡 🕢 🕣 🕤 🕥 🕦 🕧 🙨 🙩 • ● ⚫ ⬤ 🞅 🞆 🞇 🞈 🞊 ⦿ ◾ + ■ ◼ ⬛ ⬜ 🞑 🞒 🞓 🞔 ▣ 🞕 🞖 🞗 ⬩ ⬥ ◆ ◇ 🞚 ◈ 🞛 🞜 🞝 ⬪ ⬧ ⧫ ◊ 🞠 ◖ ◗ ⯊ ⯋ ◼ ⬥ + ⬟ ⯂ ⬣ ⬢ ⯃ ⯄ 🞡 🞢 🞣 🞤 🞥 🞦 🞧 🞨 🞩 🞪 🞫 🞬 🞭 🞮 🞯 🞰 🞱 🞲 🞳 🞴 🞵 🞶 🞷 🞸 🞹 🞺 + 🞻 🞼 🞽 🞾 🞿 🟀 🟂 🟄 ✦ 🟉 ★ ✶ 🟋 ✷ 🟏 🟒 ✹ 🟃 🟇 ✯ 🟍 🟔 ⯌ ⯍ ※ ⁂ +]); + +1; diff --git a/charset.plp b/charset.plp index be31655..7891ee3 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 webdings )], + symbols => [qw( symbol dingbats MacDingbats wingdings wingdings2 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'], + 'wingdings2' => ['' => '32'], 'webdings' => ['' => '32'], 'iso-8859-2' => ['iso-8859-1' => '160'], @@ -254,8 +255,8 @@ sub tabinput { } } - if ($input =~ m{ \A (?:wing|web)dings \z }ix) { - require "Encode/\u$input.pm"; + if ($input =~ m{ \A (?:wing|web)dings \d* \z }ix) { + eval "require Encode::\u$input"; } if ($input =~ m{ \A u ([0-9a-f]+) (?:-([0-9a-f]+))? \z }ix) {