Skip to content

Instantly share code, notes, and snippets.

@thomedes
Forked from pestilence669/figlet_demo.sh
Created February 15, 2017 12:38
Show Gist options
  • Save thomedes/c8c3cde1f8cf5228db998f0dc3c15c18 to your computer and use it in GitHub Desktop.
Save thomedes/c8c3cde1f8cf5228db998f0dc3c15c18 to your computer and use it in GitHub Desktop.
Show a message using all available fonts for figlet
#!/bin/bash
# vim: set ts=4 sw=4 noet fileencoding=utf-8:
fontDir=`figlet -I2`
if [[ $# -eq 0 ]]; then
echo "usage: $(basename $0) [message] -- print given message for every available font in figlet"
exit 0
fi
for fontType in `figlet -I5`; do
ext=${fontType%[0-9]} # flf2 = .flf, tlf2 = .tlf
for font in `ls $fontDir/*.$ext 2>/dev/null`; do
printf ':%.s' {1..80} # line separators
echo -e "\n$(basename ${font%.$ext})\n"
figlet -f $font $@
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment