OS X font weirdness

I’ve suddenly noticed something… odd… with the fonts on my machine. They only seem to act up when viewing PDFs. For example, when I look at the syllabus for my class I should see this, but instead I see this.

The Times New Roman in the main body has been replaced by some sans-serif font, and the ligature characters are weird. It’s not always the main body, though. Sometimes the Large/bold header at the top changes, and sometimes the large section headers change to the sans-serif font, but all three parts can change separately. I can reload the page and get a different combination every time my browser renders it again.

I tried flushing my font cache as advised by a page I found online, and it doesn’t seem to be happening quite so often now, but it’s still pretty consistently acting up when I look at PDFs in Safari.

WTF? And how do I fix it?

It might be the PDF’s fault. Did the maker of the PDF embed the fonts? If not, your system is just going ahead and substituting what font it thinks is the closest to the missing font. Which may not be all that close in some critical dimension, like width.

Welcome to my world. twitch

That doesn’t remotely explain that my system renders it differently every time I reload the file.

Do you get the same result if you try to view the PDF in the standalone Reader rather than within your browser?

Ditto. Use Acrobat Reader and test it.

I haven’t installed Acrobat Reader. I use Preview for documents on my hdd (or the at-a-glance viewer in Finder) and Safari for documents on the web. I also open PDFs using TeXShop while I’m making them (as I wrote this one). The font weirdness shows up sporadically on all of them.

Have you run Font Book? It does some font integrity checking.

No. I should just run it? Do something in particular in it?

Yeah, I think just launching it checks all the currently loaded fonts.
There are some commercial font utilities if all else fails.

I just launched Font Book. To validate fonts, select all fonts in the list, then run the File, Validate Fonts command. I found that several dozen fonts, mostly copied over from the Windows world, had ‘minor’ errors; when I looked more closely, the error list mentioned ‘duplicate fonts’. What the significance of this warning is, I don’t know.

The help for Font Book also mentions doing similar tasks from the command line.

Ran it, still loading funny sometimes in Preview.

No problems found, either minor or major.

OK, do this:
Create a new “test” user.
Log in as this new user, and see if you can replicate the problem.
If the problem goes away, something is whacked in your particular user space, and not fundamentally with the System.

I saw the exact same symptoms back when I was using an older pdf viewer called TeXniscope. It’s been a while since I had the problem, but my recollection was that I had to

(1) flush the font cache (as mentioned in the OP) and
(2) stop using TeXniscope, because it was corrupting the cache every time I used it.

IIRC, this problem arose when I switched to Leopard. TeXniscope was already woefully out-of-date and unmaintained at that point, and something about the update to 10.5 created a conflict with how it dealt with fonts. You, in contrast, seem to be using only standard, well-maintained viewers. Just in case, though, I suggest flushing the font cache (again) and then avoiding one of your normal pdf viewers. See if the problem doesn’t recur until you start to use a particular viewer.

I did just get Leopard earlier in the summer (new computer, delayed buying new OS until I had it), and I haven’t been writing much since then.

TeXniscope is used with TeX files, I take it? The first place I really noticed this was TeXshop. I’d banged out a slightly updated CV back in June, and it was when I opened that file (to get at its template) this morning when I noticed the font weirdness. I haven’t seen any other PDF font weirdness since I got the computer (and Leopard and a new install of TeXshop) in May.

Might there be something wrong with tetex?

Yeah, I was using TeXniscope to preview TeX files. I miss it because it integrated nicely with my preferred (and similarly obsolete) text editor, AlphaX.
With TeXniscope/AlphaX, I could sync between source and preview. Nowadays, I use Skim/AlphaX, which lets me sync from preview to source, but not back again. I know that TeXShop lets you go both ways, but I’m too attached to how AlphaX lets me format the source text, not to mention all the keyboard shortcuts for various LaTeX commands.

If you suspect the TeX installation itself, you can try switching between TeXLive and gwTeX. That didn’t turn out to be the problem in my case, though, and I had exactly the same symptom.