Delete testFonts

This commit is contained in:
4G3NT 2023-06-17 04:44:00 -07:00 committed by GitHub
parent 5aeaec7551
commit 9e95de0b19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 75 deletions

View File

@ -1,75 +0,0 @@
#!/bin/sh
fontDir="/usr/share/figlet"
toiletFlag=
help=$(
cat << EOF
Usage:
$0 [-ht] [-d] [message]
OPTIONS
-h display this help
-t specify this option if you have toilet fonts aswell
-d font directory defaults to $fontDir
EOF
)
err()
{
red="\033[31m"
reset="\033[0m"
for arg in "$@"; do
printf "%berror%b: %s\n" "$red" "$reset" "$arg" >&2
done
}
while getopts ":htd:" opt; do
case "$opt" in
h)
echo "$help"
exit
;;
t)
toiletFlag=1
;;
d)
fontDir="$OPTARG"
[ -d "$fontDir" ] || {
err "directory '$fontDir' does not exist"
exit 2
}
;;
:)
err "option -$OPTARG requires an argument"
exit 2
;;
*)
err "invalid option -$OPTARG"
exit 2
;;
esac
done
shift $((OPTIND - 1))
msg="$1"
[ -z "$msg" ] && [ "$#" -eq 0 ] && {
echo "$help"
exit 1
}
if [ -n "$toiletFlag" ]; then
for i in "$fontDir"/*.flf "$fontDir"/*.tlf; do
[ "$i" = "./*.flf" ] && err "no fonts exist in directory" && exit 1
echo "Font: $(basename "$i" | sed 's,\.tlf,,g;s,\.flf,,g')"
figlet -f "$i" "$msg" 2> /dev/null
done
else
for i in "$fontDir"/*.flf; do
[ "$i" = "./*.flf" ] && err "no fonts exist in directory" && exit 1
echo "Font: $(basename "$i" | sed 's,\.flf,,g')"
figlet -f "$i" "$msg" 2> /dev/null
done
fi