Skip to content

Instantly share code, notes, and snippets.

@velitasali
Last active April 10, 2020 13:23
Show Gist options
  • Save velitasali/dc45ea43f48df6b18c38917cf74a3177 to your computer and use it in GitHub Desktop.
Save velitasali/dc45ea43f48df6b18c38917cf74a3177 to your computer and use it in GitHub Desktop.
The config that provides the most designer intended look for the Cantarell font-family on Linux
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "../fonts.dtd">
<fontconfig>
<!-- First, we apply the general rules -->
<match target="font">
<test name="family" compare="eq" ignore-blanks="true">
<string>Cantarell</string>
</test>
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign">
<bool>true</bool>
</edit>
<edit name="autohint" mode="assign">
<bool>true</bool>
</edit>
</match>
<!-- Then, we enable font hinting for Cantarell medium and bolder -->
<match target="font">
<test name="family" compare="eq" ignore-blanks="true">
<string>Cantarell</string>
</test>
<test name="weight" compare="more">
<const>regular</const>
</test>
<edit mode="assign" name="hintstyle">
<const>hintslight</const>
</edit>
</match>
<!-- Then, we disable font hinting for Cantarell regular and lighter -->
<match target="font">
<test name="family" compare="eq" ignore-blanks="true">
<string>Cantarell</string>
</test>
<test name="weight" compare="less">
<const>medium</const>
</test>
<edit mode="assign" name="hintstyle">
<const>hintnone</const>
</edit>
</match>
</fontconfig>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment