GNOME Bugzilla – Bug 644126
Please provide a rule to rebuild the fonts
Last modified: 2012-09-17 07:41:40 UTC
Hi, I am going to package the Cantarell fonts for Debian and in the course of this have noticed that the Makefile does not provide a convenient rule to rebuild the fonts from source, just one to install them. Please add a rule that help to reproduce the bulding of the opentype font files from the fontforge sources. - Fabian
That would be fab, indeed (pun intended ;).
Created attachment 224305 [details] [review] Rebuild the otf fonts from sfd sources. I have attached a patch which (1) re-creates the otf fonts from the sfd sources with a fontforge scripts as soon as the sources have changed and (2) modifies the existing fontforge script to take into account the procedure described in the "Developer Information" chapter in the README file. Allow me a few remarks on the latter. The relevant paragraph from README reads as follows: " The build process is simple; the Spiro and temp layers are removed, in the case of TTF files all layers are converted to Quadratic from Cubic, and then all glyphs have the Simplify, Add Extrema, Round to Int, and Correct Direction operations applied. " 1) The script does not explictely remove the Spiro and Temp layers (I did not find a script function for this), but I have checked manually that only the Fore layer is actually exported by Generate(). This can be checked e.g. by the glyph '3' which is on position U+0032 (DIGIT TWO) in the Temp layer and by the TILDE glyph (U+007E) which is on a higher position in the Spiro layer and on the center line in the Fore layer. 2) The script does not even attempt to generate TTF files, mostly because of git ed9b60e0. But even if this ever gets reconsidered, it should be as simple as s/otf/ttf/ in the script. Fontforge knows which font format to produce by the file extension given to Generate() and will automatically convert the splines to quadratic if needed. I can extend the script to support both formats, if desired. all the other steps are applied as described in the README file. - Fabian
This is pretty rad, thank you. Eventually we might even depend on this and not version control the generated fonts, but let's not hard depend on fontforge at the moment.
Just for the records, the Fontforge Scripting Tutorial [1] calls Simplify(128+32+8,1.5) i.e. with additional parameters [2] and also adds ScaleToEm(1000) [3] to the chain. Maybe we should consider including them in the generate.sh script as well. - Fabian [1] http://fontforge.org/scripting-tutorial.html#Complexities [2] http://fontforge.org/scripting-alpha.html#Simplify [3] http://fontforge.org/scripting-alpha.html#ScaleToEm