Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ZX Spectrum font publishing
#!/bin/bash
#Requires 7z, bin2tap, custom FontTest.tap template and AWS-CLI. Tested on WSL.
for i in "$@"
do
name="${i%.*}"
zip="${name}.zip"
rm -rf "${zip}"
echo Creating previews
pw preview "$i" . >> /dev/null
tap="${name}.tap"
echo Creating ${tap}
rm -f *.tap
for f in *.ch8 ; do blk="${f%.*}" ; bin2tap 49152 "${blk:0:10}" "$f" ; done
cat ../FontTest.tap *.tap > tap.tmp
rm -f *.tap
mv tap.tmp "${tap}"
echo Packing $zip
psf="${name}.psf"
png="${name}.png"
tap="${name}.tap"
7z a "${zip}" '-x!*.vfb' >> /dev/null
7z a "${zip}" ../README.md >> /dev/null
echo Uploading...
aws s3 cp "${zip}" "s3://damieng-downloads/fonts/zx-origins/${zip}"
aws s3 cp . s3://damieng-resources/fonts/zx-origins/ --recursive --exclude "*" --include "*.png"
rm -rf "${zip}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.