Does anyone know a good way to batch process fonts into UFO format? I don't have RoboFont so unfortunately that's not an option.
Thanks
Did you find a problem with FontForge? For me the script
---- fnt2ufo ---- #!/usr/bin/env fontforge -lang=ff Open($1); Generate($1:r + ".ufo"); Quit(0); ---- cut here ---
appears to work. With linux or OS X, a simple
find . -name "*.otf" -exec fnt2ufo {} \;
should do the job for all otf font files in the current directory and subdirectories. If that is not fast enough (due to one call to fontforge for each file) you can reduce the number of calls to one reusing some code of http://fontforge.org/scripting-tutorial.html
Now I remember that you have been using the github version of FontForge. If so, and if FontForge.app is in /Applications then save the following lines in a file, say sfnt2ufo
#!/Applications/FontForge.app/Contents/Resources/opt/local/bin/fontforge -lang=ff Open($1); Generate($1:r + ".ufo");
Then execute the command
chmod 755 sfnt2ufo
and put the file sfnt2ufo somewhere in your path (one of the folders listed when you type echo $PATH). Then, and only then, you can execute (in any folder)
find . -iname "*.[ot]tf" -exec sfnt2ufo {} \;
to process all ttf and otf files or simply use
sfnt2ufo <fontfile>
to get the corresponding ufo of one particular font file.
I just tried on a MacBook Air with no programmer tool installed (no X code), just XQuartz and github FontForge and applications from the mac store. The input was 486 western fonts from Adobe Type Classics (something of about 10 years ago). It took about 2 minutes to generate the ufo, but FontForge would not process back some of the UFO files, telling it could not process the features in the ufo and scrapping them.
More that two months afterwards! You are lucky I did not scrap those files. Here is the answer I had prepared for your post.
----
Here is a trace searching for a particular problem in the .fea files that were generated
find . -name "*.fea" -exec grep 'by[ ]*;' {} \; | sort | uniq -c
102 sub [\uniF661 ]' [\slash \fraction \uni2215 ]' [\uniF661 ]' by ;
12 sub [\uniF661 ]' [\slash \fraction ]' [\uniF661 ]' by ;
128 sub [\zero ]' [\slash \fraction ]' [\zero ]' by ;
This found all feature files and searched in them for lines where 'by ;' is written. There is a total of 102 + 12 +128 =242 lines. Those are the 242 lines that cause the problem with the 242 ufo files.
After executing
find . -name "*.fea" -exec sed -i .orig '/by[ ]*;/d' {} \;
to remove those lines, FontForge accepted the ufo files as input without scrapping the features.
Please post the exact error message so I can get this fixed :)
Here is the stderr file that was generated when reading in the .ufo file for Utopia Standard Regular
Copyright (c) 2000-2012 by George Williams. See AUTHORS for contributors.
License GPLv3+: GNU GPL version 3 or later
with many parts BSD . Please read LICENSE.
Executable based on sources from 12:29 EST 18-Jul-2013-ML-NoPython-D.
Library based on sources from 12:29 EST 18-Jul-2013.
Based on source from git with hash:f8dc0063ea93c64e70e5ab1402a840e8c9801cc8
No substitution specified on line 583 of /Users/boyer/Desktop/Western Fonts/Utopia Std Opticals/UtopiaStd-Regular.ufo/feature.fea
There were errors when parsing the feature file and the features have not been applied
Line 583 is
sub [\uniF661 ]' [\slash \fraction \uni2215 ]' [\uniF661 ]' by ;
There are many ways my friend. However, if you know the coding well you can do this. Batch processing a font to UFO format requires certain steps that should be coded carefully. You can contact through me this and all your doubts will be over. http://www.windows10versions.com
Captured from web.archive.org on 15 Apr 2015. view this capture