What is the PK file format?
A .pk file is a compressed bitmap font used in the TeX and LaTeX typesetting ecosystem. PK stands for "Packed," referring to the run-length encoding scheme used to store each glyph's monochrome bitmap efficiently. The format was designed by Tomas Rokicki in 1985 as a more compact replacement for Metafont's .GF (Generic Font) output.
.pk files are resolution-specific: a separate file exists for each combination of typeface and output DPI. For example, cmr10.300pk holds the Computer Modern Roman 10pt font rasterized at 300 dpi, while cmr10.600pk is the same face at 600 dpi. Modern TeX distributions such as TeX Live and MiKTeX generate .pk files on demand via mktexpk when DVI rendering requires a font not already cached.
The file begins with a two-byte preamble (0xF7 0x59) followed by design-size and DPI metadata, then a sequence of packed glyph records. Each record stores the character code, TFM width, bounding box dimensions, and RLE-compressed bitmap bits. A checksum field ties each glyph to its companion .tfm metric file.
For modern PDF-based LaTeX workflows, OpenType and Type 1 fonts are preferred. .pk files remain relevant for DVI-to-PostScript rendering pipelines in TeX Live and MiKTeX.
Security & safety
RISK: LOWBinary font data; no scripting or executable content. Safe to open with TeX tools.
Format details
in a nutshellPrograms that open PK files
Technical details
deep spec| Magic bytes | 0xF7 0x59 (preamble identifier; distinguishes PK from GF which uses 0xF7 0x80) |
| Encoding | Binary |
| Byte order | Big-endian |
| Compression | Run-length encoding (RLE) of monochrome glyph bitmaps; bounding-box optimization |
| Color depth | 1 bpp (monochrome only) |
| Typical file size | 10 KB - 500 KB per font at one resolution |
| Resolution encoding | DPI encoded in filename convention (e.g., cmr10.300pk = 300 dpi, cmr10.600pk = 600 dpi) |
| Checksum | Per-glyph checksum field matching the companion .tfm metric file |
| MIME type | application/x-tex-pk |
| Associated OS | Linux, macOS, Windows, Unix |
| Generated by | Metafont via gftopk utility, or on-demand by mktexpk in TeX Live / MiKTeX |
| Format origin | Tomas Rokicki, 1985 |
| DVI workflow role | Used in DVI-to-PostScript rendering; PDF-based TeX workflows prefer OpenType/Type 1 fonts |
| Released | 1985 (Tomas Rokicki, gftopk utility) |
| Latest version | format is stable since 1985; no version changes |
| Open standard | Yes · royalty-free |
| Specification | ctan.org |
PK conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about PK files.