I have a web application that uses the browser's default monospace font. It's set up that way so that the user can pick their own. In Chrome, this works well, as it's easy to set the default fonts, but in Safari, they removed the option.

Is there some way for users to set default fonts in Safari?

up vote 10 down vote accepted

There are still unexposed preferences for changing the default fonts and font sizes:

defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2StandardFontFamily Georgia
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DefaultFontSize 16
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2FixedFontFamily Menlo
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DefaultFixedFontSize 14

Another option is to add a rule like this to the default CSS file that can be seleced in Preferences > Advanced > Style sheet:

@font-face {
   font-family: monospace;
   src: local('Menlo');
}

It makes font-family: monospace and elements like <pre> and <code> default to Menlo.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.