Installing and invoking Xgridfit
Installation
At the moment there is no installer for any system other than Linux. On a Linux system, open a shell, change to the xgridfit-0.6 directory, become root, and type
make install
If you want to install the documentation as well, instead type
make install-all
Running
Open your Xgridfit program file and make sure it contains an <infile> element containing the name of the FontForge source file (.sfd) or TrueType file (.ttf) to which instructions are to be added. If you want your output file to be saved under a different name, make sure your program contains an <outfile> element containing the name of the file (.sfd or .ttf) to be output. Now invoking Xgridfit is simply a matter of typing xgridfit on the command line, with the name of the program file (the extension should be .xgf or .xml) as a parameter, e.g.
$ xgridfit Junicode-Bold.xgf
If all goes well, Xgridfit will produce a script named Junicode-Bold.pe. If the file named in the <infile> element is present, you may simply run your script in FontForge:
$ fontforge -script Junicode-Bold.pe
The script produced by Xgridfit will open the .sfd or .ttf file, add cvt, fpgm and prep tables, add instructions to each glyph, and either save an .sfd file or generate a TrueType (.ttf) font.
You may also invoke your favorite XSLT processor directly, in which case you will have access to several useful parameters. Here Xgridfit is run with xsltproc, a command-line program packaged with libxslt and found in most recent Linux distributions:
xsltproc -o Junicode-Bold.pe \ --stringparam infile Junicode-Bold.sfd \ --stringparam outfile Junicode-Bold.ttf \ --param max-twilight-points 29 \ --param max-storage 128 \ /usr/local/share/xgridfit/lib/xgridfit.xsl Junicode-Bold.xgf
For the meanings of the various parameters, see the parameters section of this documentation. Remember that a parameter always overrides an equivalent value set via a <default> element in your program.
Here are illustrations of how to use Xgridfit with various XSLT processors. (If you run Xgridfit under Windows or the Mac you will need to do things differently; but the parameters will be the same.) First Saxon:
java -jar /usr/local/saxon/saxon.jar \ -o Junicode-Bold.pe \ Junicode-Bold.xgf \ /usr/local/share/xgridfit/lib/xgridfit.xsl
Xalan C++:
xalan -in Junicode-Bold.xgf \ -out Junicode-Bold.pe \ -xsl /usr/local/share/xgridfit/lib/xgridfit.xsl \ -param infile "'Junicode-Bold.sfd'" \ -param outfile "'Junicode-Bold.sfd'"
Xalan java:
java org.apache.xalan.xslt.Process -in Junicode-Bold.xgf \ -out "Junicode-Bold.pe" \ -xsl /usr/local/share/xgridfit/lib/xgridfit.xsl
If you like (and are feeling confident), you can skip generation of a FontForge script file and pass the output of an Xgridfit run directly to FontForge:
xsltproc /usr/local/share/xgridfit/lib/xgridfit.xsl \ Junicode-Bold.xgf | fontforge -script -
Note: The 4xslt processor does not work with Xgridfit: I do not know why. Other XSLT processors may or may not work: I can undertake to test only the major Open Source processors.