Skip to content

Instantly share code, notes, and snippets.

@akx
Last active August 29, 2015 14:26
Show Gist options
  • Save akx/dc32140cbefae1ec84e9 to your computer and use it in GitHub Desktop.
Save akx/dc32140cbefae1ec84e9 to your computer and use it in GitHub Desktop.
#!/bin/bash
# This script builds (a subset of) the AlkuThree-Light font
# from source files made public by Opetushallitus (oph.fi).
# Whether or not this infringes on copyrights or other rights
# is anyone's guess.
#
# Prerequisites: wget & fontforge
# Optionally: fonttools (ttx) for repeatable builds
# (sha1 should probably be 5d2eba6728246b7050500b3c8cac4780f99f4728)
TTX=$(which ttx 2>/dev/null)
FFSCRIPT=$(mktemp)
echo '
http://www.oph.fi/download/169033_suomi_ruotsi_kirjaimet.pdf
http://www.oph.fi/download/169034_numerot.pdf
http://www.oph.fi/download/169035_inarinsaame.pdf
http://www.oph.fi/download/169036_koltansaame.pdf
http://www.oph.fi/download/169037_pohjoissaame.pdf
http://www.oph.fi/download/169038_romani.pdf
http://www.oph.fi/download/169039_malliteksti.pdf
' | wget --no-verbose -nc -nd -P AlkuThree-PDFs -i -
echo '
New()
i=1
while ( i<$argc )
MergeFonts($argv[i])
i = i+1
endloop
SetFontNames("AlkuThree-Light", "AlkuThree", "AlkuThree-Light", "Light", "-")
Generate("AlkuThree-Light.otf")
' > $FFSCRIPT && fontforge -nosplash -script $FFSCRIPT AlkuThree-PDFs/*.pdf && rm $FFSCRIPT
if [[ -f $TTX ]]; then
$TTX -x head -x FFTM -o AlkuThree-Light.ttx AlkuThree-Light.otf
$TTX -o AlkuThree-Light.otf AlkuThree-Light.ttx
rm AlkuThree-Light.ttx
fi
sha1sum *.otf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment