#!/bin/bash

# print-letter: displays large letters

#
# CONFIGURATION SECTION BEGINS HERE
#

SIGN="X"	# any sign you like

#
# CONFIGURATION SECTION ENDS HERE
#

text="$1"

L[32]="                    "
L[65]=" $SIGN$SIGN $SIGN  $SIGN$SIGN$SIGN$SIGN$SIGN$SIGN  $SIGN$SIGN  $SIGN"
L[66]="$SIGN$SIGN$SIGN $SIGN  $SIGN$SIGN$SIGN$SIGN $SIGN  $SIGN$SIGN$SIGN$SIGN "
L[67]=" $SIGN$SIGN$SIGN$SIGN   $SIGN   $SIGN    $SIGN$SIGN$SIGN"
L[68]="$SIGN$SIGN$SIGN $SIGN  $SIGN$SIGN  $SIGN$SIGN  $SIGN$SIGN$SIGN$SIGN "
L[69]="$SIGN$SIGN$SIGN$SIGN$SIGN   $SIGN$SIGN$SIGN $SIGN   $SIGN$SIGN$SIGN$SIGN"
L[70]="$SIGN$SIGN$SIGN$SIGN$SIGN   $SIGN$SIGN$SIGN $SIGN   $SIGN   "
L[71]=" $SIGN$SIGN$SIGN$SIGN   $SIGN $SIGN$SIGN$SIGN  $SIGN $SIGN$SIGN$SIGN"
L[72]="$SIGN  $SIGN$SIGN  $SIGN$SIGN$SIGN$SIGN$SIGN$SIGN  $SIGN$SIGN  $SIGN"
L[73]="$SIGN$SIGN$SIGN  $SIGN   $SIGN   $SIGN  $SIGN$SIGN$SIGN "
L[74]="   $SIGN   $SIGN   $SIGN   $SIGN$SIGN$SIGN$SIGN "
L[75]="$SIGN  $SIGN$SIGN $SIGN $SIGN$SIGN  $SIGN $SIGN $SIGN  $SIGN"
L[76]="$SIGN   $SIGN   $SIGN   $SIGN   $SIGN$SIGN$SIGN$SIGN"
L[77]="$SIGN  $SIGN$SIGN$SIGN$SIGN$SIGN$SIGN  $SIGN$SIGN  $SIGN$SIGN  $SIGN"
L[78]="$SIGN  $SIGN$SIGN$SIGN $SIGN$SIGN  $SIGN$SIGN $SIGN$SIGN$SIGN  $SIGN"
L[79]=" $SIGN$SIGN $SIGN  $SIGN$SIGN  $SIGN$SIGN  $SIGN $SIGN$SIGN "
L[80]="$SIGN$SIGN$SIGN $SIGN  $SIGN$SIGN$SIGN$SIGN $SIGN   $SIGN   "
L[81]=" $SIGN$SIGN $SIGN  $SIGN$SIGN  $SIGN$SIGN $SIGN$SIGN $SIGN$SIGN "
L[82]="$SIGN$SIGN$SIGN $SIGN  $SIGN$SIGN$SIGN$SIGN $SIGN  $SIGN$SIGN  $SIGN"
L[83]=" $SIGN$SIGN$SIGN$SIGN    $SIGN$SIGN    $SIGN$SIGN$SIGN$SIGN "
L[84]="$SIGN$SIGN$SIGN$SIGN $SIGN   $SIGN   $SIGN   $SIGN  "
L[85]="$SIGN  $SIGN$SIGN  $SIGN$SIGN  $SIGN$SIGN  $SIGN $SIGN$SIGN$SIGN"
L[86]="$SIGN  $SIGN$SIGN  $SIGN$SIGN  $SIGN$SIGN  $SIGN $SIGN$SIGN "
L[87]="$SIGN  $SIGN$SIGN  $SIGN$SIGN  $SIGN$SIGN$SIGN$SIGN$SIGN$SIGN  $SIGN"
L[88]="$SIGN  $SIGN$SIGN  $SIGN $SIGN$SIGN $SIGN  $SIGN$SIGN  $SIGN"
L[89]="$SIGN  $SIGN$SIGN  $SIGN $SIGN$SIGN$SIGN   $SIGN$SIGN$SIGN$SIGN "
L[90]="$SIGN$SIGN$SIGN$SIGN   $SIGN $SIGN$SIGN $SIGN   $SIGN$SIGN$SIGN$SIGN"

LEFT=${text::1}
RIGHT=${text:1}

char2ascii() {
    printf "%d" "'$1"
}

LEFT=$(char2ascii $LEFT)
RIGHT=$(char2ascii $RIGHT)

if [ $LEFT -eq 0 ]
then
    LEFT=32
fi

if [ $RIGHT -eq 0 ]
then
    RIGHT=32
fi

if [ $LEFT -gt 96 ]
then
    LEFT=$(($LEFT - 32))
fi

if [ $RIGHT -gt 96 ]
then
    RIGHT=$(($RIGHT - 32))
fi

matrix="${L[$LEFT]}${L[$RIGHT]}"
matrix[1]="${matrix:0:4} ${matrix:20:4}"
matrix[2]="${matrix:4:4} ${matrix:24:4}"
matrix[3]="${matrix:8:4} ${matrix:28:4}"
matrix[4]="${matrix:12:4} ${matrix:32:4}"
matrix[5]="${matrix:16:4} ${matrix:36:4}"

for line in 1 2 3 4 5
do
    echo "${matrix[line]}"
done

