Skip to content

Instantly share code, notes, and snippets.

@gbishop
Created November 21, 2012 14:00
Show Gist options
  • Save gbishop/4124987 to your computer and use it in GitHub Desktop.
Save gbishop/4124987 to your computer and use it in GitHub Desktop.
Replace sans-serif and Arial fonts with Ubuntu
<!--?xml version="1.0"?>-->
<!--DOCTYPE fontconfig SYSTEM "fonts.dtd">-->
<!-- ~/.fonts.conf for per-user font configuration -->
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>Ubuntu</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Ubuntu Mono</family>
</prefer>
</alias>
<match>
<test name="family"><string>Arial</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Ubuntu</string>
<string>Arial</string>
</edit>
</match>
<match>
<test name="family"><string>helvetica</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Ubuntu</string>
<string>Helvetica</string>
</edit>
</match>
</fontconfig>
@gbishop
Copy link
Author

gbishop commented Nov 21, 2012

The default sans-serif font and Arial commonly used by web sites render capital I (eye) and lowercase l (ell) indistinguishably. I got burned by a shortened link from goo.gl and started looking into what I could do to fix it. I put the above in ~/.fonts.conf and it replaces sans-serif and Arial with Ubuntu.

@gbishop
Copy link
Author

gbishop commented Nov 21, 2012

When I wrote the above comment, I noticed that Helvetica had same problem so I'm replacing it also. I wonder if one Match clause could do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment