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?
Best Answer
As of Safari 12, all options for doing so have been removed:
defaults
keys are no longer respected@font-face
definitions are limited to a built-in whitelist oflocal()
values, ignoring any other fonts installed on the system, which is part of a broad package of anti-fingerprinting measuresTaken together, this means there is no way to change the defaults away from Times for
serif
, Helvetica forsans-serif
, and Courier formonospace
.The only thing you can still do is create a user stylesheet to style various elements directly. So for example you could change the default font family from
serif
tosans-serif
:Or you can even still name specific locally installed non-system fonts:
Unfortunately while this works reasonably well for changing the default document font, it is complicated to use the same approach to restyle every element that defaults to a monospace font. I am not sure CSS can even fully emulate the default behaviour for such elements at all – whereas it was previously easy to do so by using either
defaults
or a user stylesheet with a@font-face
rule formonospace
(which simply redefined whatmonospace
meant without touching the default styling itself, and so allowed the default behaviour to apply to that other font).I viscerally dislike reading large amounts of text set in Courier, so it looks like in the future I will have to use another browser to read RFCs…