up vote 1 down vote favorite
share [g+] share [fb]

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?

link|improve this question

46% accept rate
feedback

1 Answer

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>
link|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
feedback

Your Answer

 
or
required, but never shown

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