Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -v
- #trap read debug
- b=1
- space=" "
- FONTFORGE_LANGUAGE=ff
- export PATH FONTFORGE_LANGUAGE
- export FONTFORGE_VERBOSE
- SAVEIFS=$IFS
- IFS=$(echo -en "\n\b")
- convert2otf2() {
- set -v
- #trap read debug
- #tiny ff pe script to grab family name. var saved to $FAMILY
- FAMILY=$(./rename_family.pe $1);
- PATHNAME=$(dirname $1); #echo "PATHNAME: $PATHNAME";
- FONTFILE=$(basename $1); #echo "FONTFILE: $FONTFILE";
- FIRSTLTR=${FAMILY:0:1};
- #make FIRSTLTR lowercase
- FIRSTLOW=${FIRSTLTR,,}; #echo "FIRSTLTR: $FIRSTLTR";
- FAMPATH="$PATHNAME/$FIRSTLOW/$FAMILY";
- if (test -f $1); then
- #multiple iif statement to check for letter directory and family directory unneeded.
- #mkdir will create parents if they don't exist.
- echo -n "checking existence of $FAMPATH ... ";
- if [ ! -d "$FAMPATH" ]; then
- echo "created new directory $FAMPATH!";
- mkdir -p $FAMPATH;
- else
- echo "$FAMPATH exists... skipping creation.";
- fi
- echo -n "CALLING FONTFORGE: ";
- echo "any2ttf.pe $1 $2 $FAMPATH";
- #sourcing any2tff.pe - probably not necessary since it's a fontforge script and not bash; can't hurt
- #source ./any2ttf.pe $1 $2 $FAMPATH;
- mv -n $1 $FAMPATH;
- fi
- }
- for i in *.{otf,ttf}; do
- echo "=============================================================";
- convert2otf2 $i;
- done
- IFS=$(echo -en "\n\b")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement