Skip to content

Instantly share code, notes, and snippets.

@zenozeng
Created January 19, 2014 10:50
Show Gist options
  • Save zenozeng/8503207 to your computer and use it in GitHub Desktop.
Save zenozeng/8503207 to your computer and use it in GitHub Desktop.
马大神的fontconfig
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file for local customizations -->
<fontconfig>
<!-- overall settings: autohint(slight), hinting, antialias, sub-pixel(rgb) -->
<match target="font">
<edit mode="assign" name="embeddedbitmap">
<bool>true</bool>
</edit>
<edit mode="assign" name="autohint">
<bool>true</bool>
</edit>
<edit mode="assign" name="hintstyle">
<const>hintslight</const>
</edit>
<edit mode="assign" name="antialias">
<bool>true</bool>
</edit>
<edit mode="assign" name="rgba">
<const>rgb</const>
</edit>
<edit mode="assign" name="lcdfilter">
<const>lcddefault</const>
</edit>
</match>
<!-- match font -->
<!-- disable hint for bold -->
<match target="font">
<test name="weight" compare="more">
<const>medium</const>
</test>
<edit name="autohint" mode="assign">
<bool>false</bool>
</edit>
</match>
<!-- fix CJK global advance -->
<match target="font">
<test target="pattern" name="lang" compare="contains">
<string>zh</string>
</test>
<edit name="spacing">
<const>proportional</const>
</edit>
<edit name="globaladvance">
<bool>false</bool>
</edit>
</match>
<match target="font">
<test target="pattern" name="lang" compare="contains">
<string>ja</string>
</test>
<edit name="spacing">
<const>proportional</const>
</edit>
<edit name="globaladvance">
<bool>false</bool>
</edit>
</match>
<match target="font">
<test target="pattern" name="lang" compare="contains">
<string>ko</string>
</test>
<edit name="spacing">
<const>proportional</const>
</edit>
<edit name="globaladvance">
<bool>false</bool>
</edit>
</match>
<!-- force hinting for (P)MingLiU -->
<match target="font">
<test name="family" compare="contains">
<string>MingLiU</string>
</test>
<edit name="autohint">
<bool>false</bool>
</edit>
<edit name="hinting">
<bool>true</bool>
</edit>
<edit mode="assign" name="hintstyle">
<const>hintfull</const>
</edit>
</match>
<!-- disable autohint & antialias for some bitmap fonts -->
<match target="font">
<test name="family" compare="contains">
<string>宋体</string>
</test>
<test compare="less_eq" name="pixelsize" >
<double>16</double>
</test>
<edit mode="assign" name="autohint" >
<bool>false</bool>
</edit>
<edit mode="assign" name="antialias" >
<bool>false</bool>
</edit>
<edit mode="assign" name="hinting" >
<bool>true</bool>
</edit>
<edit mode="assign" name="hintstyle" >
<const>hintfull</const>
</edit>
</match>
<match target="font">
<test name="family" compare="contains">
<string>SimSun</string>
</test>
<test compare="less_eq" name="pixelsize" >
<double>16</double>
</test>
<edit mode="assign" name="autohint" >
<bool>false</bool>
</edit>
<edit mode="assign" name="antialias" >
<bool>false</bool>
</edit>
<edit mode="assign" name="hinting" >
<bool>true</bool>
</edit>
<edit mode="assign" name="hintstyle" >
<const>hintfull</const>
</edit>
</match>
<match target="font">
<test name="family">
<string>AR PL ShanHeiSun Uni</string>
</test>
<test compare="less_eq" name="pixelsize" >
<double>16</double>
</test>
<edit mode="assign" name="autohint" >
<bool>false</bool>
</edit>
<edit mode="assign" name="antialias" >
<bool>false</bool>
</edit>
<edit mode="assign" name="hinting" >
<bool>true</bool>
</edit>
<edit mode="assign" name="hintstyle" >
<const>hintfull</const>
</edit>
</match>
<match target="font">
<test name="family">
<string>AR PL New Sung</string>
</test>
<test compare="less_eq" name="pixelsize" >
<double>16</double>
</test>
<edit mode="assign" name="autohint" >
<bool>false</bool>
</edit>
<edit mode="assign" name="antialias" >
<bool>false</bool>
</edit>
<edit mode="assign" name="hinting" >
<bool>true</bool>
</edit>
<edit mode="assign" name="hintstyle" >
<const>hintfull</const>
</edit>
</match>
<!-- match pattern -->
<!-- replace some ugly English fonts -->
<!-- <match target="pattern">
<test name="family" compare="contains">
<string>宋体</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>DejaVu Serif</string>
<string>Droid Serif</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="contains">
<string>SimSun</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>DejaVu Serif</string>
<string>Droid Serif</string>
</edit>
</match>
<match target="pattern">
<test name="family" compare="contains">
<string>MingLiU</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>DejaVu Serif</string>
<string>Droid Serif</string>
</edit>
</match>
<match target="pattern">
<test name="family">
<string>AR PL ShanHeiSun Uni</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>DejaVu Serif</string>
<string>Droid Serif</string>
</edit>
</match>
<match target="pattern">
<test name="family">
<string>AR PL New Sung</string>
</test>
<edit binding="strong" mode="prepend" name="family">
<string>DejaVu Serif</string>
<string>Droid Serif</string>
</edit>
</match>-->
<!-- replace some ugly chinese fonts -->
<match target="pattern">
<test name="family">
<string>AR PL ShanHeiSun Uni</string>
</test>
<test compare="more_eq" name="pixelsize" >
<double>12</double>
</test>
<test compare="less_eq" name="pixelsize" >
<double>16</double>
</test>
<edit name="family" mode="assign" binding="same">
<string>WenQuanYi Bitmap Song</string>
</edit>
</match>
<match target="pattern">
<test name="family">
<string>AR PL New Sung</string>
</test>
<test compare="more_eq" name="pixelsize" >
<double>12</double>
</test>
<test compare="less_eq" name="pixelsize" >
<double>16</double>
</test>
<edit name="family" mode="assign" binding="same">
<string>WenQuanYi Bitmap Song</string>
</edit>
</match>
<!--change 'fixed' to 'monospace'-->
<match target="pattern">
<test name="family" qual="any">
<string>fixed</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>monospace</string>
</edit>
</match>
<!-- created by WenQuanYi FcDesigner v0.5 -->
<match>
<test name="family"><string>sans-serif</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>DejaVu Sans</string>
<string>WenQuanYi Micro Hei</string>
<string>WenQuanYi Zen Hei</string>
<string>Liberation Sans</string>
<string>Droid Sans</string>
</edit>
</match>
<match>
<test name="family"><string>serif</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>DejaVu Serif</string>
<string>AR PL UMing CN</string>
<string>AR PL SungtiL GB</string>
<string>WenQuanYi Zen Hei Sharp</string>
<string>AR PL UMing TW</string>
<string>Liberation Serif</string>
<string>Bitstream Charter</string>
<string>Droid Serif</string>
</edit>
</match>
<match>
<test name="family"><string>monospace</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>WenQuanYi Zen Hei Mono</string>
<string>WenQuanYi Micro Hei Mono</string>
<string>DejaVu Sans Mono</string>
<string>Droid Sans Mono</string>
<string>WenQuanYi Zen Hei Sharp</string>
<string>AR PL UMing TW</string>
</edit>
</match>
</fontconfig>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment