Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using the stylish addon and it works great. However I would like to substitute a specific font - say Arial - with another of my choice every time it is found instead of setting a global font (which I don't like as I just want to substitute Arial) or using a stylish rule for every page. Is it possible to do this? Maybe with a greasemonkey script?

share|improve this question

You'd need greasemonkey, not just stylish. The script would have to look at computed styles for every element, and account for the fact that Arial can be accessed by several names.

Another angle is to reconfigure Arial to be replaced by another font. This is more foolproof and less resource intensive.

Assuming you're on linux, put this in ~/.fonts.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
 <match target="pattern"><!-- Replace Arial -->
  <test qual="any" name="family"><string>Arial</string></test>
  <edit name="family" mode="assign_replace"><string>A better font</string></edit>
share|improve this answer
but then it would remap arial to a better font on every app in your desktop – barraponto Feb 9 '10 at 15:32
I have tried with ~/.fonts.conf but I couldn't get it working -- no matter what fonts I try to substitute, it seems to make no difference. – Matteo Riva Mar 5 '10 at 18:59
I put assign_replace instead of assign. What you saw was probably an interaction with /etc/fonts/conf.d/30-metric-aliases.conf – Tobu Mar 27 '10 at 19:46

I follow this, and then set

@font-face {
        font-family: "Arial";
        src: local("Segoe UI Semibold")

in a Stylist addons.

share|improve this answer
This works for machine fonts, but unfortunately not for web fonts which are already specified by @font-face on the website. Until now I haven't found a way to override these. – letmaik May 2 '13 at 16:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .