Thoughtful, detailed coverage of the Mac, iPhone, and iPad, plus the TidBITS Content Network for Apple consultants.

Fix Your Fonts in Safari 6

As those who have installed Safari 6 (which comes with OS X 10.8 Mountain Lion) have discovered, the capability to set the browser’s default proportional font and the default fixed-width font has vanished from Safari’s preferences. As a result, some sites — specifically those that don’t set their own fonts using CSS (Cascading Style Sheets) — have begun appearing in Times and Courier, regardless of the default font settings a user may have set in a previous version of Safari.

Two solutions are available. The first is for users to create a default CSS file that Safari can use. This document, a text file with the file extension .css, can be stored anywhere; users simply need to point to it from the Style Sheet setting in Safari’s Advanced preferences. The contents of such a CSS document might look something like this:

body { font-family: "Lucida Grande"; }
code, tt { font-family: "Consolas"; font-size: 90%; }

With the style sheet in place, after Safari is quit and relaunched it uses the specified fonts for body text and code text if a page’s HTML and CSS don’t specify otherwise.

However, one can also set Safari’s default fonts with shell commands using Terminal. Even though the user interface for setting these defaults has vanished, Safari still has them. The magic shell command is defaults and it takes four uses of it to set the defaults that one formerly set in Safari’s preferences. All one needs to do is open Terminal and issue the appropriate commands on the command line, and then quit and relaunch Safari.

For example, here is how I set my default fonts to Lucida Grande (proportional) and Consolas (fixed-width). First is the command to set the proportional font family (each of these is a single line):

defaults write 'Lucida Grande'

Next is the command to set that font’s default size:

defaults write 14

Then one issues a similar command for the fixed-width font:

defaults write 'Consolas'

And another for the fixed-width font size:

defaults write 11

Granted, opening Terminal and pasting esoteric commands instead of using a graphical interface is not a usability win, but at least you need not be forced to view Times when you want Lucida Grande!

(A brief aside. I like to tweak how pages look, so although I can use Terminal to try out different default font and size combinations, I have found it more convenient to make a TextExpander shell script snippet that I can use to set and reset font defaults. The shell script snippet uses the same syntax as the Terminal commands but can be edited and invoked far more quickly. Plus, it makes a satisfying “pop” sound when it’s done.)


Backblaze is unlimited, unthrottled backup for Macs at $5/month.
Web access to files means your data is always available. Restore
by Mail allows you to recover files via a hard drive or USB.
Start your 15-day trial today! <>

Comments about Fix Your Fonts in Safari 6
(Comments are closed.)

Silly workaround. Apple should put this feature back. Until they do, it's Chrome for me.
Michael E. Cohen  An apple icon for a TidBITS Staffer 2012-08-14 18:18
That the problem exists is silly. That there is a simple solution, albeit geeky, is not.
If the problem is silly, then any "solution" for it is silly.
Michael E. Cohen  An apple icon for a TidBITS Staffer 2012-08-15 19:47
That's just silly.
So moving to Chrome is silly, as well.
Steve Nicholson  2012-08-14 20:40
That sure seems like a bug to me: rdar://12100578.
Michael E. Cohen  An apple icon for a TidBITS Staffer 2012-08-14 20:46
Thanks for filing.
Tom Knoff  2012-08-14 22:30
Never new this until now, TidBits is a great site to test your css on!
Why is Apple removing valuable features? First Save as… (people in design and creative fields *really* need this as part of the creative and production process) and now Safari crippling. Is this intentional, incompetence, or poor user experience leadership?

Continued use of Chrome and Firefox and Snow Leopard indeed.