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 integernπ₯--dosnamesβ uses a name likefont.pkinstead offont.dpipkπ-h,--helpβ prints a quick help synopsis and then exits π«Ά-i path,--interpreter=pathβ usespathas the Ghostscript interpreter π--mapfile=fileβ usesfileto 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β useslineinstead of hunting through a map file. the very first word oflinehas 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, thedpiargument 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β seeTFMFONTSπGSFTOPKHEADERSβ seeTEXPSHEADERSπPSHEADERSβ seeTEXPSHEADERSπ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.tfmfile that goes with the font. double slashes and extra colons work just like they do forTEXCONFIGπ you can also set this withTFMFONTSorGSFTOPKFONTS, and those get checked in the orderGSFTOPKFONTS,TFMFONTS,TFMFONTS. the first one that has a value wins πTEXPSHEADERSβ a colon-separated list of paths to search for the Ghostscript driver filerender.psand any PostScript header or font files (.enc,.pfa,.pfb,.gsf, or.ttffiles). double slashes and extra colons behave like they do forTEXCONFIGπ¦ you can also supply this withPSHEADERSorGSFTOPKHEADERS, which are checked in the orderGSFTOPKHEADERS,TEXPSHEADERS,PSHEADERS. the first one with a value is the one used β¨TFMFONTSβ seeTFMFONTSπ
π§ 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 filerender.psand the PostScript header and font files should be searched for usingpathπp fileβ says the list of map files gets erased and replaced byfileπ₯p +fileβ saysfilegets 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.gsftopksometimes has trouble with fonts that have really complicated characters, like the Seal of the University of California π that's because it uses thecharpathoperator to figure out the bounding box of each character. if the character is too complicated, old versions of Ghostscript fail, andgsftopkterminates 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 ππ«Ά
π¦ where this page comes from
- alpine 3.24: texlive-doc 2026.0-r0 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- arch rolling: texlive-doc 2026.1-1 Β· GPL
- centos-stream 10: texlive-gsftopk 13:20240311-6.el10 Β· GPL-1.0-or-later
- centos-stream 9: texlive-gsftopk 9:20200406-26.el9 Β· GPL+
- debian bookworm: texlive-binaries 2022.20220321.62855-5.1+deb12u2
- debian trixie: texlive-binaries 2024.20240313.70630+ds-6 Β· TeX-Live
- fedora 43: texlive-gsftopk 11:svn52851-93.fc43 Β· GPL-1.0-or-later
- fedora 43: texlive-gsftopk 11:svn52851-95.fc43.1 Β· GPL-1.0-or-later
- fedora 44: texlive-gsftopk 12:svn52851-105.fc44 Β· GPL-1.0-or-later
- fedora 44: texlive-gsftopk 12:svn52851-111.fc44 Β· GPL-1.0-or-later
- opensuse-leap 16.0: texlive-gsftopk-doc 2025.221.1.19.2svn52851-160000.3.1 Β· GPL-2.0-or-later
- ubuntu jammy: texlive-binaries 2021.20210626.59705-1build1
- ubuntu jammy: texlive-binaries 2021.20210626.59705-1ubuntu0.3
- ubuntu noble: texlive-binaries 2023.20230311.66589-9build3 Β· TeX-Live
- ubuntu questing: texlive-binaries 2024.20240313.70630+ds-6ubuntu2 Β· TeX-Live
- ubuntu resolute: texlive-binaries 2025.20250727.75242+ds-5build1 Β· TeX-Live
- ubuntu stonking: texlive-binaries 2026.20260303.78225+ds-5ubuntu1 Β· TeX-Live
- Copyright (c) 1993-1998 Paul Vojta
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms