Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

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">
<fontconfig>
 <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>
 </match>
</fontconfig>
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
add comment

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. –  neo May 2 '13 at 16:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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