I have been using a great open-source python script by GitHub user @hanikesn (see below) that converts a single WOFF file back into OTF format via command line (Terminal on Mac OS X).
As it is now, I drag-and-drop the script to Terminal, then drag-and-drop a WOFF file to Terminal, press Enter, and the script creates an OTF in the same directory. The script can be invoked manually, but I find it much easier and much faster to drag-and-drop. However as a typographer, I work with large font-families, some of them have over 100 styles each, so I need a batch conversion tool. I know there are some tools online, but these usually have a size limit unless you pay for the service, and the results are never as consistent as this script. Besides, I would like to have an offline tool.
I would like to modify it to run on a directory (folder of WOFFs) rather than a single file. Ideally I would like to drag-and-drop the script into terminal, and then drag-and-drop a folder. The script should only attempt to convert files with the .woff extension.
When I asked the creator of the script, he said "This can easily be done with a simple one line shell script:
for file in *.woff; do woff2otf.py $file; done
However I don't know how to implement this. I am not a programmer, but I've had to work with some basic python scripting in my typography projects. So, please explain it to me like I'm 5.
cd /path/to/your/directory
and then paste that shell command there. That's it. – Ethbenbash yourscriptname
. Filewoff2otf.py
should reside in the same path. And you may modify a bit this script - putpython
afterdo
keyword to be sure. – Ethbenzsh
installed but reset Terminal shell tobash
. I putwoff2otf.py
in the same directory as you said, and typed for file incd /path/to/fonts/and/woff2otf.py
and pasted shell command. Output says-bash: syntax error near unexpected token do
and no conversion took place. – Adalbertoadalheid.sh
file and using it as part of the process, rather than pasting it as you first suggested? 3) if so, can you explain where I should put the.sh
script & how to use it? – Adalbertoadalheid