Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
my fonts.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<dir>~/.fonts</dir>
<alias>
<family>serif</family>
<prefer>
<family>Source Serif Pro</family>
<family>IPAMincho</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Source Sans Pro</family>
<family>Source Han Sans JP</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Source Code Pro</family>
</prefer>
</alias>
<alias>
<family>cursive</family>
<prefer>
<family>Comic Neue</family>
</prefer>
</alias>
<!-- fuck helvetica -->
<match>
<test name="family">
<string>Helvetica</string>
</test>
<edit binding="same" mode="assign" name="family">
<string>Source Sans Pro</string>
</edit>
</match>
<!-- define font family for some fonts fontconfig doesn't know about -->
<alias>
<family>Source Code Pro</family>
<default>
<family>monospace</family>
</default>
</alias>
<alias>
<family>Droid Sans Mono</family>
<default>
<family>monospace</family>
</default>
</alias>
<alias>
<family>PowerlineSymbols</family>
<default>
<family>monospace</family>
</default>
</alias>
<alias>
<family>Comic Neue</family>
<default>
<family>cursive</family>
</default>
</alias>
<!-- by default fontconfig assumes any unrecognized font is sans-serif, so -->
<!-- the fonts above now have /both/ families. fix this. -->
<!-- note that "delete" applies to the first match -->
<match>
<test compare="eq" name="family">
<string>sans-serif</string>
</test>
<test compare="eq" name="family">
<string>monospace</string>
</test>
<edit mode="delete" name="family"/>
</match>
<match>
<test compare="eq" name="family">
<string>sans-serif</string>
</test>
<test compare="eq" name="family">
<string>cursive</string>
</test>
<edit mode="delete" name="family"/>
</match>
<!-- comic neue is missing a few glyphs and fontconfig thinkgs it's -->
<!-- unsuitable for english text, oops! fix this forcibly. -->
<!-- once the font is fixed, the above rule is good enough -->
<match>
<test compare="contains" name="lang">
<string>en</string>
</test>
<test name="family">
<string>cursive</string>
</test>
<edit mode="delete_all" name="lang"/>
<edit mode="prepend" name="family">
<string>Comic Neue</string>
</edit>
</match>
<!-- Replace Comic Sans with Comic Neue bold -->
<match>
<test name="family">
<string>Comic Sans MS</string>
</test>
<edit binding="same" mode="assign" name="family">
<string>Comic Neue</string>
</edit>
<edit binding="weak" mode="assign" name="style">
<string>Bold</string>
</edit>
</match>
<!-- Hinting and subpixel rendering -->
<match target="font">
<edit mode="assign" name="rgba">
<const>rgb</const>
</edit>
<edit mode="assign" name="hinting">
<bool>true</bool>
</edit>
<edit mode="assign" name="hintstyle">
<const>hintslight</const>
</edit>
<edit mode="assign" name="lcdfilter">
<const>lcddefault</const>
</edit>
<edit mode="assign" name="antialias">
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="rgba">
<const>rgb</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hinting">
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hintstyle">
<const>hintslight</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="antialias">
<bool>true</bool>
</edit>
</match>
</fontconfig>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment