TWG | MacTeX | Donate | FAQ | Fonts | Help | References | Support | Acknowledgments | TUG
Many users of TeX are aware of the "font cache bug" in OS X. While typesetting a document, the output display suddenly develops problems. Exact symptoms vary --- sometimes half of the mathematical characters are missing, and sometimes the text mysteriously changes from Computer Modern to Helvetica. When the problem occurs, it is visible in many programs at once: Preview, TeXShop, LaTeXiT, TeXniscope, etc. But the pdf file displays correctly in Adobe Acrobat.
This problem is caused by a corrupt font cache. When GUI programs display pdf files, they call Apple's internal pdf routines. In turn, these routines call Apple's font routines to construct bitmaps for the outline fonts. These Apple routines store the bitmaps in a font cache to speed up future display. For reasons unknown until recently, this font cache can become corrupt; this is "triggered" by displaying a defective pdf file. After that trigger, display problems persist for all files. To fix the problem, the font cache needs to be rebuilt, as happens when the machine is rebooted.
In a heroic debugging campaign a couple of weeks ago, Melissa O'Neill, the author of the program PDF to Keynote, traced the bug to a particular line of code in pdftex. The details are available in documents linked below; suffice it to say that pdftex source code contained the symbol > in a spot where >= was required. The bug has been present in pdftex since 2004 on all computer platforms; it causes incorrect fonts to be embedded in pdf documents and then these documents trigger the bug. The defective code in pdftex is also used in dvips, so dvips has the same bug.
Subsequent debugging revealed that many fonts in TeX Live are also broken, with a related bug. When these fonts are used in a pdf document, that document can trigger the bug. Pdftex and dvips have been patched to correct this problem; when they embed one of the broken fonts, they automatically repair it.
To fix the bug, you need to install patched versions of pdftex and dvips in TeX Live 2008. You may be familiar with tlmgr or TeX Live Utility, two programs which update files in TeX Live 2008. But neither program updates binary files. Thus you need to install the package in the next section to fix the bug.
To fix the bug in TeX Live 2008, download and install the following small package:
The package will rename the existing dvips to "dvips-prepatch", rename the existing pdftex to "pdftex-prepath", and then install patched versions of pdftex and dvips. Note the pdftex is actually used in TeX Live for most tasks: PdfTeX, PdfLaTeX, LaTeX, etc. Donald Knuth's original program is only used for Plain TeX, but it outputs dvi files which are converted to postscript using dvips. So the majority of typesetting jobs use one of these two programs.
We do not provide an installer for other distributions. BasicTeX-2008 and a few other distributions use the TeX Live 2008 binaries and can be patched. To patch these distributions, download the following file, decompress it, and following the directions in the README file in the resulting folder:
The first document below explains the bug in more detail. The second provides a glimpse over the debuggers' shoulders as they unraveled the mystery of the bug: