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:


πŸŽ€ 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 is 256.
  • -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 -p option 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, both gray AND grey are 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 is file.debug rather than file.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, -S and -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's font.persistent object, which can be stored only in an .sfd file. 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 the init-graphics attribute 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 .sfd or .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 is py. Alternatively, set the environment variable XGRIDFIT_OUTPUT_LANG to "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 .sfd or .ttf.
  • -O file, --output-script=file β€” Name of the script file to be output by Xgridfit, rather than the default, which replaces .xgf in the input file with .py.
  • -p value, --push-break=value β€” The number of values that can be pushed with a single PUSHB or PUSHW instruction. The default is 255, except when the output language is ff (-l ff); then the default is 20.
  • -P yes|no, --combine-prep=yes|no β€” Combine the Xgridfit pre-program with the prep table already present in the font (merge-mode only; default is yes).
  • --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 be 24 or greater.
  • -S name, --output-base=name β€” Save the script for each glyph in a separate file named name_glyphname.py β€” or .pe or .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 is 25, 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 default xmllint is used for validation; run xgfconfig to 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 -S option is present and the -o option 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 πŸŽ€βœ¨