Created
February 26, 2015 01:27
-
-
Save sarah-j-smith/e6adf564886aa1f001a1 to your computer and use it in GitHub Desktop.
GlyphDesigner Cocos2D SpriteBuilder bmftonts script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "Usage: $0 BmFontName" | |
exit 1 | |
fi | |
FONT_NAME="$1" | |
FONT_NAME=$(basename $FONT_NAME .GlyphProject) | |
if hash gdcl 2>/dev/null; then | |
echo "Found Glyph Designer command-line, creating fonts..." | |
else | |
echo "Glyph Designer command-line not found." | |
exit 1 | |
fi | |
mkdir -p "$FONT_NAME.bmfont" | |
FONT_SCALE="" | |
for SUBDIR in tablethd tablet phonehd phone; do | |
mkdir -p "$FONT_NAME.bmfont/resources-$SUBDIR" | |
if [ "$SUBDIR" = "tablet" -o "$SUBDIR" = "phonehd" ]; then | |
FONT_SCALE="-rfs 0.5" | |
elif [ "$SUBDIR" = "phone" ]; then | |
FONT_SCALE="-rfs 0.25" | |
fi | |
echo "gdcl $FONT_NAME.GlyphProject $FONT_NAME.bmfont/resources-$SUBDIR/$FONT_NAME $FONT_SCALE -fo PlainText-fnt" | |
gdcl $FONT_NAME.GlyphProject $FONT_NAME.bmfont/resources-$SUBDIR/$FONT_NAME $FONT_SCALE -fo PlainText-fnt | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Saved me some headaches, thanks