GSFTOPK(1)

πŸ’– GSFTOPK(1) πŸ’–

okay bestie, this is the General Commands Manual page for GSFTOPK(1) and it is so useful once you get the vibe 🧚✨

✨ NAME ✨

gsftopk - render a ghostscript font in TeX pk form πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

gsftopk [-i path] [-q] [-t] [--debug=n] [--dosnames]
[--interpreter=path] [--mapline=line] [--mapfile=file] [--quiet]
[--test] [--help] [--version] font dpi

🌸 ARGUMENTS 🌸

  • font β€” the name of the font you want to make πŸ’…
  • dpi β€” the resolution you want, in dots per inch πŸ“ this can be a real number, so no stress if it's not a whole number 🫢

πŸ’œ DESCRIPTION πŸ’œ

okay so gsftopk is literally a program that calls up the ghostscript program gs(1) to render a font at whatever resolution you ask for πŸ”₯ it packs the characters into the pk file format and writes them to a file. that file's name is made from the font name plus the resolution, rounded to the nearest integer ✨ and the font can be pretty much any format Ghostscript accepts, including .pfa, .pfb, .gsf, and .ttf files 🌈

this is usually called by a script, like mktexpk, to make fonts on demand. it's giving automation 🧚

ngl the character widths come from the .tfm file, and that file has to exist somewhere in the standard search path πŸ“ it also needs to find the font in a map file (like psfonts.map, formatted the way dvips(1) expects) unless you use the --mapline option πŸ’€ the set of map files is set by the --mapfile option, or by the files config.ps, $HOME/.dvipsrc, and config.gsftopk (the same ones you'd get from dvips -Pgsftopk) πŸŽ€

here's the internal check part, because it's so cute: the pk "specials" jobname=font, mag=1, mode=modeless, and pixels_per_inch=dpi get added to the end of the output file ✨ this is done to follow the TeX Directory Standard (TDS) πŸ’–

πŸ‘‘ OPTIONS πŸ‘‘

  • --debug=n β€” sets the Kpathsea debug flags to the integer n πŸ”₯
  • --dosnames β€” uses a name like font.pk instead of font.dpipk πŸ“
  • -h, --help β€” prints a quick help synopsis and then exits 🫢
  • -i path, --interpreter=path β€” uses path as the Ghostscript interpreter πŸ’…
  • --mapfile=file β€” uses file to look up the map info for the font. this has to be the full name of the file, so no path searching tricks happen here πŸ¦‹
  • --mapline=line β€” uses line instead of hunting through a map file. the very first word of line has to match the font 🧚
  • -q, --quiet β€” runs quietly, so no messages get written to standard output 🀫
  • -t, --test β€” test run only! it returns zero status if the font can be found in the map file(s), and nonzero status if it can't. when you use this, the dpi argument is optional, since no font gets generated anyway πŸ’€
  • -v, --version β€” prints the version number and exits 🌸

🌈 ENVIRONMENT VARIABLES 🌈

  • DVIPSRC β€” the name of the file to read instead of $HOME/.dvipsrc. again, this should be the full name, no path searching involved πŸ“œ
  • GSFTOPKFONTS β€” see TFMFONTS πŸŽ€
  • GSFTOPKHEADERS β€” see TEXPSHEADERS πŸŽ€
  • PSHEADERS β€” see TEXPSHEADERS πŸŽ€
  • TEXCONFIG β€” a colon-separated list of paths to search for map files. an extra colon in the list brings in the compiled-in default paths right at that spot, and a double slash turns on recursive subdirectory searching at that point in the path πŸ”
  • TFMFONTS β€” a colon-separated list of paths to search for the .tfm file that goes with the font. double slashes and extra colons work just like they do for TEXCONFIG πŸ“ you can also set this with TFMFONTS or GSFTOPKFONTS, and those get checked in the order GSFTOPKFONTS, TFMFONTS, TFMFONTS. the first one that has a value wins πŸ‘‘
  • TEXPSHEADERS β€” a colon-separated list of paths to search for the Ghostscript driver file render.ps and any PostScript header or font files (.enc, .pfa, .pfb, .gsf, or .ttf files). double slashes and extra colons behave like they do for TEXCONFIG πŸ¦‹ you can also supply this with PSHEADERS or GSFTOPKHEADERS, which are checked in the order GSFTOPKHEADERS, TEXPSHEADERS, PSHEADERS. the first one with a value is the one used ✨
  • TFMFONTS β€” see TFMFONTS πŸ’…

🧚 CONFIGURATION 🧚

okay so gsftopk reads, in this order, the files config.ps, .dvipsrc, and config.gsftopk πŸ“œ this is how it figures out which map files to use and where to look for PostScript files πŸ’– config.ps and config.gsftopk get searched for using the TEXCONFIG environment variable, the Kpathsea configuration file, or the compiled-in default paths πŸ” .dvipsrc gets searched for in the user's home directory 🏠

these files use the same format as dvips (and they live in the same places too), and these are the entries gsftopk cares about:

  • H path β€” says the Ghostscript driver file render.ps and the PostScript header and font files should be searched for using path πŸŽ€
  • p file β€” says the list of map files gets erased and replaced by file πŸ”₯
  • p +file β€” says file gets added to the list of map files 🌈

all other entries get ignored, so don't stress about them 🫢

this works just like handling these options when you run dvips -Pgsftopk. for more details, check out the Kpathsea manual πŸ“š

πŸ’€ BUGS πŸ’€

⚠️ okay this one's a little spicy. gsftopk sometimes has trouble with fonts that have really complicated characters, like the Seal of the University of California πŸ™ˆ that's because it uses the charpath operator to figure out the bounding box of each character. if the character is too complicated, old versions of Ghostscript fail, and gsftopk terminates with an error message like this:
Call to gs stopped by signal 10

the number can change from system to system. it matches a bus error or a segmentation fault 😭 the best fix is to install a current version of ghostscript πŸ’…

if you don't want to do that, gsftopk can be told to use the bounding box that comes with the font (if the font has one) instead of finding a bounding box for each character πŸ¦‹ to do this, put this string in the font map file:

/usefontbbox true def

for example:

ucseal "/usefontbbox true def"

this won't change how dvips uses the font, btw 🌸

πŸ“ SEE ALSO πŸ“

gs(1), gftopk(1), tex(1), xdvi(1), dvips(1)

🫢 AUTHOR 🫢

Written by Paul Vojta. this program was inspired by Karl Berry's gsrenderfont πŸ’œ

🌈 MODIFICATIONS 🌈

Modified by Yves Arrouye to use Karl Berry's Kpathsea library ✨


and that's the tea, bestie πŸ’… the GSFTOPK(1) page from General Commands Manual, last updated 28 November 1998 πŸŽ€πŸ«Ά