Pigpen Cipher Encryption Pigpen Cipher Encryption

Your mission is simple: to write a program which receives text as input and outputs an ASCII representation of it in the Pigpen Cipher.

Input

ASCII-only (no Unicode) characters. You must be able to handle at least 16384 characters and 256 lines.

Output


Replace all characters which are not new lines or in ABCDEFGHIJKLMNOPQRSTUVWXYZ or abcdefghijklmnopqrstuvwxyz with spaces.
Case-insensitively, replace each letter with its encrypted form (see next section), inserting a trailing space on each of the three lines after each. Each encoded character is a 3*3 block of ASCII art. Replace spaces with 3*3 blocks of spaces.
All the characters should be on the same three lines (call these three lines one pigpen-line), unless there is a new line, which starts a new pigpen-line. Leave a normal line blank between pigpen-lines.


The Cipher

  |       | |       |
 .|       |.|       |.
--+ for J +-+ for K +-- for L

--+       +-+       +--
 .|       |.|       |.
--+ for M +-+ for N +-- for O

--+       +-+       +--
 .|       |.|       |.
  | for P | | for Q |   for R

(ABCDEFGHI are the same as JKLMNOPQR, but with the . replaced by a space)

\./
 V  for W (note the row of 3 spaces on the top)

 ^
/.\ for Z (note the 3 spaces on the bottom)


 \
 .&gt;
 /  for X (note the leading spaces)

 /
&lt;.
 \  for Y (note extra trailing spaces)

(STUV are like WXYZ, but with the . replaced by a space)


Example

The input "hEllo,wORLd" should produce:

+-+ +-+ |   |   +--         +-- +-- |   --+
| | | | |.  |.  |.      \./ |.  |.  |.    |
| | +-+ +-- +-- +--      V  +-- |   +-- --+


The base64 encoding of the above, with a trailing new line, is below. The md5sum is 6f8ff1fed0cca4dd0492f9728ea02e7b.

Ky0rICstKyB8ICAgfCAgICstLSAgICAgICAgICstLSArLS0gfCAgIC0tKwp8IHwgfCB8IHwuICB8
LiAgfC4gICAgICBcLi8gfC4gIHwuICB8LiAgICB8CnwgfCArLSsgKy0tICstLSArLS0gICAgICBW
ICArLS0gfCAgICstLSAtLSsK


Without a trailing new line, the md5sum is 581005bef7ee76e24c019d076d5b375f and the base64 is:

Ky0rICstKyB8ICAgfCAgICstLSAgICAgICAgICstLSArLS0gfCAgIC0tKwp8IHwgfCB8IHwuICB8


LiAgfC4gICAgICBcLi8gfC4gIHwuICB8LiAgICB8CnwgfCArLSsgKy0tICstLSArLS0gICAgICBW
ICArLS0gfCAgICstLSAtLSs=

Rules


Standard loopholes are forbidden.
This is code golf. Shortest code wins.
In languages which cannot accept multiple lines of input at a time (e.g. JavaScript with prompt()), use * (or some other character) as a line separator.


Erranda


The example was missing a few spaces (A space should consist of the trailing spaces of the previous character, if any, itself, and its own trailing spaces). This has now been fixed.
JavaScript (ES6) 312 327 340 372 446 

Not counting indentation white space and newlines - could be golfed more.
Using an '*' to mark new lines in input, as prompt accepts a single line.

console.log(prompt().split('*').map(s=&gt;
  [0,1,2].map(r=&gt;
  [...s].map(c=&gt;o+=n+
    '   \\1/ \\ /1\\ /  V  ^  1&gt;&lt;1 --++-++-- 1||1||1 '.substr(
    (c=(32|c.charCodeAt())-97)&lt;0|c&gt;25?0:c&lt;18
     ?27+3*'330441552030141252033144255'[f=8,c%9*3+r]
     :3*'482630015274'[f=21,c%4*3+r],3,n=' ')
  .replace(1,' .'[r&amp;c&gt;f])
  ,n='\n'),o=''
)&amp;&amp;o).join('\n'))


Test in FireFox/FireBug console

Input: ABCDEFGHI*JKLMNOPQR*STUV*WXYZ*HeLlO WoRlD!

  | | | |   --+ +-+ +-- --+ +-+ +--
  | | | |     | | | |     | | | |  
--+ +-+ +-- --+ +-+ +--   | | | |  

  | | | |   --+ +-+ +-- --+ +-+ +--
 .| |.| |.   .| |.| |.   .| |.| |. 
--+ +-+ +-- --+ +-+ +--   | | | |  

     \   /   ^ 
\ /   &gt; &lt;   / \
 V   /   \     

     \   /   ^ 
\./  .&gt; &lt;.  /.\
 V   /   \     

+-+ +-+ |   |   +--         +-- +-- |   --+    
| | | | |.  |.  |.      \./ |.  |.  |.    |    
| | +-+ +-- +-- +--      V  +-- |   +-- --+