TTF2PK(1)

πŸ“¦
version 77830 Β· 2 versions
, in arch rolling, debian bookworm, epel 10, epel 9, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu jammy, ubuntu noble

πŸ’– 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 makes ttf2pk go 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 .pk as the extension instead of .<resolution>pk. short and sweet.
  • -t β€” test for the existence of font-name. returns 0 on success and prints out the corresponding line of a map file (default: ttfonts.map), provided the -q switch isn't set. a little vibe check for your font 🫢
  • font-name β€” the TeX name of the font. ttf2pk looks 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 of ttf2pk and 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 πŸŒˆπŸ’–πŸŽ€