TTF2PK(1)
π TTF2PK β bestie edition π
okay so real talk, this is the manual page for ttf2pk, a member of the General Commands Manual squad, and she's here to turn your TrueType fonts into TeX's PK format. no cap. let's get into it π¦
β¨ NAME β¨
ttf2pk β convert a TrueType font into TeX's PK format π
πΈ SYNOPSIS πΈ
ttf2pk [-q] [-n] font-name resolution
ttf2pk -t [-q] font-name
ttf2pk --version | --help
π DESCRIPTION π
so like, this program converts a TrueType font into a PK file, and then β slay β the font it made can be used with TeX or LaTeX. it's giving pipeline icon.
CJKV subfonts (that's Chinese/Japanese/Korean/old Vietnamese, iykyk) as created by ttf2tfm are also supported. we love inclusive behavior π
and heads up bestie, ttf2pk always assumes 10pt as the design size for the written TeX font. that's just the vibe, it's not negotiable, periodt.
π₯ PARAMETERS π₯
-qβ this optional switch makesttf2pkgo quiet. she suppresses any informational output, except warning and error messages. so like, she stops chatting but she will absolutely still tell you if something's wrong π-nβ use only.pkas the extension instead of.<resolution>pk. short and sweet.-tβ test for the existence of font-name. returns0on success and prints out the corresponding line of a map file (default:ttfonts.map), provided the-qswitch isn't set. a little vibe check for your font π«Άfont-nameβ the TeX name of the font.ttf2pklooks this name up in a map file (see below, bestie) for further information on how to process the font.resolutionβ the resolution, given in dots per inch. currently the horizontal resolution is equal to the vertical resolution. and the design size? always assumed to be 10pt. iconic consistency.--versionβ shows the current version ofttf2pkand the used file search library (e.g.kpathsea). receipts β¨--helpβ shows usage information.
environment variables for file searching are described in the manual page of ttf2tfm. go read that one too, no skips π
π THE CONFIGURATION FILE π
ttf2pk uses a small configuration file called ttf2pk.cfg. in each line it contains a keyword with its value, separated by whitespace. comment lines can start with any of the following characters: *, #, ;, and %. leading whitespace is ignored. so chill of her honestly.
currently, only one keyword, map, is recognized in this file; it takes a map file name as a parameter. if no extension is given to the map file name, .map is appended. no whitespace is allowed in the map file name β not even a lil one, she's strict about it π
the map keyword can be given more than once to specify multiple map files. and here's the cute part: if the map file name is prepended by a plus sign, it is added to the list of map files to be used. example:
map foo
map +bar
this makes ttf2pk first read foo.map, then bar.map. order matters, bestie, it's a whole storyline π
if the configuration file is not found, ttf2pk tries to use ttfonts.map instead. she always has a backup plan π
π¦ MAP FILES π¦
parameters specified to ttf2tfm are preserved for ttf2pk in map files β ttf2tfm writes out to standard output, as the last line, a proper entry for a map file. so thoughtful of her.
as an example, a call to
ttf2tfm arial -p T1.enc -s 0.25 -P 1 -E 0 arials
will produce the following line:
arials arial Slant=0.25 Pid=1 Eid=0 Encoding=T1.enc
see ttf2tfm(1) and afm2tfm(1) of the dvips package for a detailed description of encoding files. do your homework, it's worth it π
here a listing of the various ttf2tfm parameters and the corresponding entries in a map file:
-sβSlant-eβExtend-pβEncoding-fβFontindex-PβPid-EβEid-nβPS=Yes-NβPS=Only-RβReplacement-xβRotate=Yes-yβY-Offset
single replacement glyph names given to ttf2tfm with -r old-glyphname new-glyphname are directly specified with old-glyphname=new-glyphname. they will be ignored if in subfont mode or if no encoding file is given. so don't come crying to her if you skip the encoding file, she warned you π
one additional parameter in a map file is unique to ttf2pk: Hinting, which can take the values On or Off. some fonts (e.g. the CJK part of cyberbit.ttf) are rendered incorrectly if hinting is activated. default is On (you can also use Yes, No, 1, and 0). so many ways to say the same thing, she's flexible like that π
for a description of subfonts (i.e., entries of the form <namestem>@<sfd-filename>@) please refer to ttf2tfm(1).
the format of a map file is simple, lowkey elegant. each line defines a font; first comes the TeX font name, then its TrueType font file name, followed by the parameters in any order. case is significant (even for parameter names) β so Slant is not slant, do not play with her π₯ β and the parameters are separated from its values by an equal sign, with whitespace possibly surrounding it. ttf2pk reads in all map files line by line in the order given in the configuration file, continuing until the TeX font specified on the command line is found, otherwise the program exits with error code 2. thus you can use any character invalid in a TeX font name to start a comment line. clever, right? β¨
you can use \ as the final character of a line to indicate that the input is continued on the next line. the backslash and the following newline character will be removed. line continuation, we stan π«Ά
β οΈ ttf2pk will abort if it can't find or read the TeX font metrics file of the given TeX font name. like, full stop, no font for you π
β RETURN VALUE β
if the call was successful, 0 will be returned. in case of error, the return value is 1. and finally, if the font can't be found in the map files, 2 is returned. this simplifies the inclusion of ttf2pk into scripts like mktexpk for automatic font generation. numbers doing numbers things, we love a predictable queen π
π SEE ALSO π
π AVAILABILITY π
ttf2pk is part of the FreeType 1 package, a high quality TrueType rendering library. she's got pedigree π
β¨
π AUTHORS π
- Werner LEMBERG
<wl@gnu.org> - FrΓ©dΓ©ric LOYER
<loyer@ensta.fr>
and that's the whole page bestie!! this one's a FreeType2 version, dated 04-May-2011 β go convert some fonts and be the main character of your own TeX document πππ
π¦ where this page comes from
- arch rolling: texlive-doc 2026.1-1 Β· GPL
- debian bookworm: texlive-binaries 2022.20220321.62855-5.1+deb12u2
- epel 10: texlive-ttfutils 13:20240311-10.el10_3 Β· LPPL-1.3c
- epel 9: texlive-ttfutils 9:20200406-38.el9 Β· LPPL
- fedora 43: texlive-ttfutils 11:svn66186-93.fc43 Β· LPPL-1.3c
- fedora 43: texlive-ttfutils 11:svn66186-95.fc43.1 Β· LPPL-1.3c
- fedora 44: texlive-ttfutils 12:svn77830-105.fc44 Β· LPPL-1.3c
- fedora 44: texlive-ttfutils 12:svn77830-111.fc44 Β· LPPL-1.3c
- opensuse-leap 16.0: texlive-ttfutils-doc 2025.221.svn73908-160000.3.1 Β· LPPL-1.0
- 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
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms