Skip to content

Instantly share code, notes, and snippets.

@damieng

damieng/zx-font-convert.sh

Last active Aug 15, 2020
Embed
What would you like to do?
ZX Spectrum font conversion script
#!/bin/bash
fl5reg="HKCU\Software\FontLab\Studio 5\Directories"
for i in "$@"
do
name="${i%.*}"
echo Processing $name
mkdir -p Spectrum
mkdir -p PC
mkdir -p BBC
pw.exe preview "$i" . >> /dev/null
optipng -o7 "${name}.png" --quiet
psf="PC/${name}.psf"
vfb="PC/${name}.vfb"
zx2psf "$i" "${psf}" --mode=move1 --graphics=none
psf2bdf "${psf}" "${name}.bdf" --fontname="${name}"
pw.exe zxtofzxp "$i" .
mv *.fzx Spectrum/
mv *.bdf PC/
cp /mnt/d/zxo/_Templates/Template.vfb "${vfb}"
cd PC
wincur="$(wslpath -w "`pwd`")"
cd ..
reg.exe add "${fl5reg}" /f /v "BitmapFonts" /t REG_SZ /d "${wincur}"
"/mnt/c/Program Files (x86)/Fontlab/Studio 5/Studio 5.exe" "${vfb}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment