Browse Source

Support running script from anywhere

References the programs fonts, no matter where the script is run from.
master
Matt Baer 7 years ago
parent
commit
6ca47e77d9
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      text-to-image.sh

+ 6
- 5
text-to-image.sh View File

@@ -45,14 +45,15 @@ esac

echo "Thanks. Generating image..."

font_reg=$HOME/.local/share/fonts/Lora-Regular.ttf
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
font_reg=$DIR/fonts/Lora-Regular.ttf
if [ "$font" = "mono" ]; then
font_reg=$HOME/.local/share/fonts/Hack-Regular.ttf
font_reg=$DIR/fonts/Hack-Regular.ttf
elif [ "$font" != "norm" ]; then
font_reg=$HOME/.local/share/fonts/OpenSans-Regular.ttf
font_reg=$DIR/fonts/OpenSans-Regular.ttf
fi
write_bold=$HOME/.local/share/fonts/Lora-Bold.ttf
write_reg=$HOME/.local/share/fonts/Lora-Regular.ttf
write_bold=$DIR/fonts/Lora-Bold.ttf
write_reg=$DIR/fonts/Lora-Regular.ttf

# Generate post text
if [ $(echo "$msg" | wc -m) -lt 40 ]; then


Loading…
Cancel
Save