XGRIDFIT(1)
β¨ XGRIDFIT(1) β¨
okay bestie, welcome to the xgridfit manual page β like, the actual one from the General Commands Manual section, bestie, no cap. Sit down, grab a strawberry π, we're learning today.
πΈ NAME πΈ
xgridfit β a program for gridfitting, aka "hinting," TrueType fonts. That's it, that's the whole vibe. π
π¦ SYNOPSIS π¦
xgridfit [options] file.{xgf or xml}...
β¨ DESCRIPTION β¨
So xgridfit is a simple program that implements an XML-based language for gridfitting β or "hinting" β TrueType fonts. It takes your XML source file and compiles it into tables and instructions that relate to the gridfitting of glyphs.
Big thing to know tho: xgridfit does NOT insert these elements into a font itself. It's not that girl. Instead it relies on FontForge, the Open Source font editor, to do that part. Teamwork, fr fr π«Ά
For each input file you put on the command line, the xgridfit command generates a script named file.py. Then you can run that script in FontForge like this:
$ fontforge -script file.py
OR β and this is the lowkey iconic part β you can skip generation of a script file entirely and just execute the script directly. (The FontForge Python bindings are required for this, no skipping that part bestie π):
$ xgridfit --execute file.xgf
Wanna know more about Xgridfit? Point your browser at either of these, they're literally right there:
file:///usr/share/doc/xgridfit/html/index.htmlhttp://xgridfit.sourceforge.net
π OPTIONS π
Heads up bestie: many of these options can ALSO be specified by "default" elements in the program file. BUT β and this is the rule β command-line options always override these defaults. Always. Periodt. π
-a value,--max-stack=valueβ Size of the TrueType stack. Default is256.-A,--auto-instrβ Auto-instruct all glyphs in the font before installing Xgridfit programming. Ngl this option has no effect except in merge-mode (option-m).-b value,--delta-break=valueβ Delta Break value: formerly the max number of delta pairs that could be placed on the stack with a single push instruction. As of version 1.11 it approximates that behavior by setting the-poption to twice the specified value. This option has no effect in Python mode (option-l py).-c yes|no,--compile-globals=yes|noβ Compile functions, control values, pre-program and maxp entries. Default is"yes".-C gray|grey|black|white,--color=gray|grey|black|whiteβ Use this color for rounded distances except where specified otherwise. Default is"gray". (yes, bothgrayANDgreyare valid, the duality of man π¦)--config=fileβ Read this configuration file instead of the default one. Main character energy, choosing your own config.-d,--debug-modeβ Run in debug mode. Output isfile.debugrather thanfile.py.-D,--delete-allβ Delete all instruction-related programming and data before installing Xgridfit programming. This option has no effect except in merge-mode (option-m). Otherwise, when the output language is Python, TrueType data is deleted except when--compile-globals=no.-eβ Display diagnostic messages (mainly for debugging Xgridfit).-E,--elapsed-timeβ Report the time (in seconds) used to run Xgridfit. Clock it β±οΈ-f,--executeβ Execute the generated script, and do not save it in a file. This option overrides-O, and it is incompatible with-d,-Sand-z. Pick a lane bestie.-F file,--data-file=fileβ In merge-mode, Xgridfit stores and reads information about the font's state. By default, this is stored in FontForge'sfont.persistentobject, which can be stored only in an.sfdfile. Use this option to store font information in a file instead.-g glyph+list,--glyph-select=glyph+listβ Compile only the specified glyphs, ignoring all others. The argument is a list of one or more glyph names, delimited by plus signs ("+"). The list must contain no spaces.-G yes|no,--init-graphics=yes|noβ Include or omit, at the beginning of each glyph program, a function call that initializes variables used to track the graphics state. The default is"yes."This option can be overridden with theinit-graphicsattribute on any glyph element.-h,--helpβ Display a help message and exit. The classic. π«Ά-H yes|no,--auto-hint=yes|noβ Auto-hint all glyphs in the font before auto-instructing. This option has no effect except when auto-instructing is requested (option-A).-i file,--infile=fileβ File to be input by the generated script. Must have extension.sfdor.ttf.-l py|ff,--language=py|ffβ Whether the output of Xgridfit should be a Python script or one in the native FontForge scripting language. The default ispy. Alternatively, set the environment variableXGRIDFIT_OUTPUT_LANGto"ff"or"py".-m,--merge-modeβ Run in merge-mode. Xgridfit produces a Python script that merges Xgridfit programming with TrueType programming already present in the font. It's giving collab π€-o file,--outfile=fileβ File to be output by the generated script. Must have extension.sfdor.ttf.-O file,--output-script=fileβ Name of the script file to be output by Xgridfit, rather than the default, which replaces.xgfin the input file with.py.-p value,--push-break=valueβ The number of values that can be pushed with a singlePUSHBorPUSHWinstruction. The default is255, except when the output language isff(-l ff); then the default is20.-P yes|no,--combine-prep=yes|noβ Combine the Xgridfit pre-program with thepreptable already present in the font (merge-mode only; default isyes).--processor=libxslt|lxml|xsltproc|saxon-6|saxon-9|xalan-j|xalan-c|4xsltβ Select a preferred XSLT processor. Xgridfit will use this one if possible.-q,--quietβ Run in quiet mode. Routine messages are suppressed. Shhh π€«-s value,--max-storage=valueβ Maximum places in TrueType storage area. This area is used to store variables, and also Xgridfit's own run-time data. The number must always be24or greater.-S name,--output-base=nameβ Save the script for each glyph in a separate file namedname_glyphname.pyβ or.peor.debug.--skip-validationβ Do not validate the Xgridfit program before compiling. Living dangerously, love that for you π-t value,--max-twilight=valueβ Maximum number of points in the Twilight zone. The default is25, but few fonts require so many.-T file,--temp-file=fileβ Name of a temporary file in which to store the result of XInclude processing: the compiler and/or validator is run against this file. If this option is used, the file is not deleted after processing; if it is not used, the file (named by Xgridfit) is deleted. This option is ignored when a temporary file is not needed.-v,--versionβ Print version number and exit.-Vβ Validate the Xgridfit program against a schema before compiling. Compilation is performed only if validation succeeds. By defaultxmllintis used for validation; runxgfconfigto choose another validator.--validator=libxml2|lxml|jing|msv|rnvβ Select a preferred Relax NG validator. Xgridfit will use this validator if possible.-x,--skip-compilationβ Do not compile. Validation is performed unless suppressed.-X,--no-xincludeβ Assume that XInclude processing is unnecessary; do not check.-z file,--output-outfile-script=fileβ When the-Soption is present and the-ooption or the<outfile>element has been used to make the output script save a font or FontForge source file, the output of the<outfile>script is saved in a separate script file. Xgridfit will supply a default name for this file, but this option lets you supply your own name.
π FILES π
/usr/share/xml/xgridfit/lib/*.xslβ All XSLT scripts of the Xgridfit program.
π SEE ALSO π
fontforge(1), xgfconfig(1), ttx2xgf(1), xgfupdate(1). Go read those too bestie, they're all in the family π«Ά
π AUTHOR π
xgridfit was written by Peter Baker <psb6m@virginia.edu>.
This manual page was written by Kestutis Biliunas <kebil@kaunas.init.lt>, for the Debian project (but may be used by others). Revised and OPTIONS section added by P. Baker.
okay that's the whole thing, you ate that π½οΈπ This edition of the page is dated 2009-12-18, and it's from the source/version line that lives at the bottom of the real thing. slay, go hint some fonts, mwah πβ¨
π¦ where this page comes from
- debian bookworm: xgridfit 2.3-4
- debian trixie: xgridfit 2.3-7
- ubuntu jammy: xgridfit 2.3-4build4
- ubuntu jammy: xgridfit 2.3-4ubuntu0.22.04.1
- ubuntu noble: xgridfit 2.3-4build4
- ubuntu noble: xgridfit 2.3-4ubuntu0.24.04.1
- ubuntu resolute: xgridfit 2.3-7build1
- ubuntu stonking: xgridfit 2.3-7build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms