/etc/fonts/local.conf
时间:2007-04-28 来源:chenyuehao
谢谢 linuxsir 的 quanliking, 参考 http://www.linuxsir.org/bbs/showthread.php?t=266659
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure system font access -->
<fontconfig>
<!--
Target dots per inch, change 96 to yours
-->
<match target="pattern" >
<edit name="dpi" mode="assign" >
<double>96</double>
</edit>
</match>
<!--
Enable sub-pixel rendering.
If you are using CRT, set rgb -> none
-->
<match target="font">
<edit name="rgba" mode="assign">
<const>none</const>
</edit>
</match>
<!--
Default Fonts setting
here autohint = ture / hinting = false is for free fonts in your system
we will use autohint = false / hinting = true for MS core fonts
-->
<match target="font" >
<edit name="antialias" mode="assign" >
<bool>true</bool>
</edit>
<edit name="autohint" mode="assign" >
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign" >
<bool>false</bool>
</edit>
<edit name="hintstyle" mode="assign" >
<const>hintfull</const>
</edit>
</match>
<!--
fonts alias settings
-->
<match target="pattern">
<test name="family">
<string>宋体</string>
</test>
<edit name="family" mode="assign">
<string>SimSun</string>
</edit>
</match>
<match target="pattern">
<test name="family">
<string>新宋体</string>
</test>
<edit name="family" mode="assign">
<string>NSimSun</string>
</edit>
</match>
<!--
Mark common families with their generics so we'll get
something reasonable
-->
<!--
Sans-serif faces
-->
<alias>
<family>Tahoma</family>
<family>Arial</family>
<family>Verdana</family>
<family>WenQuanYi Bitmap Song</family>
<family>SimSun</family>
<family>PMingLiU</family>
<family>Comic Sans MS</family>
<default>
<family>sans-serif</family>
</default>
</alias>
<!--
Serif faces
-->
<alias>
<family>Georgia</family>
<family>Times New Roman</family>
<family>WenQuanYi Bitmap Song</family>
<family>SimSun</family>
<family>PMingLiU</family>
<default>
<family>serif</family>
</default>
</alias>
<!--
Monospace faces
-->
<alias>
<family>Courier New</family>
<family>Andale Mono</family>
<family>NSimSun</family>
<family>MingLiU</family>
<default>
<family>monospace</family>
</default>
</alias>
<!--
Alias well known font names to MS TrueType fonts.
These substitute TrueType faces for similar Type1
faces to improve screen appearance.
-->
<alias>
<family>Times</family>
<prefer>
<family>Times New Roman</family>
</prefer>
<default>
<family>serif</family>
</default>
</alias>
<alias>
<family>Helvetica</family>
<prefer>
<family>Arial</family>
</prefer>
<default>
<family>sans-serif</family>
</default>
</alias>
<alias>
<family>Courier</family>
<prefer>
<family>Courier New</family>
</prefer>
<default>
<family>monospace</family>
</default>
</alias>
<!--
Provide required aliases for standard names
-->
<alias>
<family>sans-serif</family>
<prefer>
<family>Tahoma</family>
<family>Arial</family>
<family>Verdana</family>
<family>WenQuanYi Bitmap Song</family>
<family>SimSun</family>
<family>PMingLiU</family>
<family>Comic Sans MS</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Georgia</family>
<family>Times New Roman</family>
<family>WenQuanYi Bitmap Song</family>
<family>SimSun</family>
<family>PMingLiU</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Courier New</family>
<family>Andale Mono</family>
<family>NSimSun</family>
<family>MingLiU</family>
</prefer>
</alias>
<!--
SimSun english portion substitutionsubstitution
-->
<match target="pattern">
<test name="family" >
<string>SimSun</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Tahoma</string>
</edit>
</match>
<!--
NSimSun english portion substitutionsubstitution
-->
<match target="pattern">
<test name="family" >
<string>NSimSun</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Courier New</string>
</edit>
</match>
<!--
Courier substitution
-->
<match target="pattern">
<test name="family" >
<string>Courier</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Courier New</string>
</edit>
</match>
<!--
Bold Tahoma/Verdana substitution:
when its size more than 20px,substitution with Bold Arial
-->
<match target="pattern">
<test name="family" >
<string>Tahoma</string>
<string>Verdana</string>
</test>
<test name="weight" compare="more_eq">
<int>180</int>
</test>
<test name="pixelsize" compare="more_eq" >
<double>20</double>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Arial</string>
</edit>
</match>
<!--
Font size settings:
set the apposite font size,so it's easy to be read
-->
<match target="pattern" >
<test name="pixelsize" compare="more_eq" >
<double>8</double>
</test>
<test name="pixelsize" compare="less_eq" >
<double>12</double>
</test>
<edit name="pixelsize" mode="assign" >
<double>12</double>
</edit>
</match>
<!--
Artificial oblique for fonts without an italic or oblique version
-->
<match target="font">
<!-- check to see if the font is roman -->
<test name="slant">
<const>roman</const>
</test>
<!-- check to see if the pattern requested non-roman -->
<test target="pattern" name="slant" compare="not_eq">
<const>roman</const>
</test>
<!-- multiply the matrix to slant the font -->
<edit name="matrix" mode="assign">
<times>
<name>matrix</name>
<matrix>
<double>1</double><double>0.2</double>
<double>0</double><double>1</double>
</matrix>
</times>
</edit>
<!-- pretend the font is oblique now -->
<edit name="slant" mode="assign">
<const>oblique</const>
</edit>
</match>
<!--
Synthetic emboldening for fonts that do not have bold face available
-->
<match target="font">
<!-- check to see if the font is just regular -->
<test name="weight" compare="less_eq">
<int>100</int>
</test>
<!-- check to see if the pattern requests bold -->
<test target="pattern" name="weight" compare="more_eq">
<int>180</int>
</test>
<!-- set the embolden flag -->
<edit name="embolden" mode="assign">
<bool>true</bool>
</edit>
</match>
<!--
The dual-width Asian fonts (spacing=dual) are not rendered correctly,
apparently FreeType forces all widths to match. Trying to disable the
width forcing code by setting globaladvance=false alone doesn't help.
As a brute force workaround, also set spacing=proportional, i.e. handle
them as proportional fonts:
-->
<match target="font">
<test name="lang" compare="contains" >
<string>zh</string>
<string>ja</string>
<string>ko</string>
</test>
<edit name="spacing" mode="assign" >
<const>proportional</const>
</edit>
<edit name="globaladvance" mode="assign" >
<bool>false</bool>
</edit>
</match>
<!--
CJK antialias settings:
when font size (in pixel) between 8 and 20px
-->
<match target="font" >
<test name="lang" compare="contains" >
<string>zh</string>
<string>ja</string>
<string>ko</string>
</test>
<test name="pixelsize" compare="more_eq" >
<double>8</double>
</test>
<test name="pixelsize" compare="less_eq" >
<double>20</double>
</test>
<edit name="antialias" mode="assign" >
<bool>false</bool>
</edit>
<edit name="autohint" mode="assign" >
<bool>false</bool>
</edit>
<edit name="hinting" mode="assign" >
<bool>false</bool>
</edit>
</match>
<!--
CJK antialias settings:
when font size (in pixel) more than 20px, enable AA.
-->
<match target="font" >
<test name="lang" compare="contains" >
<string>zh</string>
<string>ja</string>
<string>ko</string>
</test>
<test name="pixelsize" compare="more_eq" >
<double>20</double>
</test>
<edit name="antialias" mode="assign" >
<bool>true</bool>
</edit>
<edit name="autohint" mode="assign" >
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign" >
<bool>true</bool>
</edit>
</match>
<!--
Italic CJK fonts,enable AA
-->
<match target="font">
<test name="lang" compare="contains" >
<string>zh</string>
<string>ja</string>
<string>ko</string>
</test>
<test name="slant" compare="not_eq">
<const>roman</const>
</test>
<edit name="antialias" mode="assign" >
<bool>true</bool>
</edit>
<edit name="autohint" mode="assign" >
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign" >
<bool>true</bool>
</edit>
</match>
<!--
Microsoft fonts settings
-->
<!--
default : smoothed and hinted
-->
<match target="font" >
<test name="foundry" >
<string>monotype</string>
<string>microsoft</string>
</test>
<edit name="antialias" mode="assign" >
<bool>true</bool>
</edit>
<edit name="autohint" mode="assign" >
<bool>false</bool>
</edit>
<edit name="hinting" mode="assign" >
<bool>true</bool>
</edit>
<edit name="hintstyle" mode="assign" >
<const>hintfull</const>
</edit>
</match>
<!--
Courier New:
both enable autohint and hinting looks very well.
-->
<match target="font" >
<test name="family" >
<string>Courier</string>
<string>Courier New</string>
</test>
<edit name="antialias" mode="assign" >
<bool>true</bool>
</edit>
<edit name="autohint" mode="assign" >
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign" >
<bool>true</bool>
</edit>
<edit name="hintstyle" mode="assign" >
<const>hintfull</const>
</edit>
</match>
<!--
Courier New font size
-->
<match target="font" >
<test name="family" >
<string>Courier New</string>
</test>
<test name="pixelsize" compare="less_eq" >
<double>14.7</double>
</test>
<edit name="pixelsize" mode="assign" >
<double>14.7</double>
</edit>
</match>
</fontconfig>
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure system font access -->
<fontconfig>
<!--
Target dots per inch, change 96 to yours
-->
<match target="pattern" >
<edit name="dpi" mode="assign" >
<double>96</double>
</edit>
</match>
<!--
Enable sub-pixel rendering.
If you are using CRT, set rgb -> none
-->
<match target="font">
<edit name="rgba" mode="assign">
<const>none</const>
</edit>
</match>
<!--
Default Fonts setting
here autohint = ture / hinting = false is for free fonts in your system
we will use autohint = false / hinting = true for MS core fonts
-->
<match target="font" >
<edit name="antialias" mode="assign" >
<bool>true</bool>
</edit>
<edit name="autohint" mode="assign" >
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign" >
<bool>false</bool>
</edit>
<edit name="hintstyle" mode="assign" >
<const>hintfull</const>
</edit>
</match>
<!--
fonts alias settings
-->
<match target="pattern">
<test name="family">
<string>宋体</string>
</test>
<edit name="family" mode="assign">
<string>SimSun</string>
</edit>
</match>
<match target="pattern">
<test name="family">
<string>新宋体</string>
</test>
<edit name="family" mode="assign">
<string>NSimSun</string>
</edit>
</match>
<!--
Mark common families with their generics so we'll get
something reasonable
-->
<!--
Sans-serif faces
-->
<alias>
<family>Tahoma</family>
<family>Arial</family>
<family>Verdana</family>
<family>WenQuanYi Bitmap Song</family>
<family>SimSun</family>
<family>PMingLiU</family>
<family>Comic Sans MS</family>
<default>
<family>sans-serif</family>
</default>
</alias>
<!--
Serif faces
-->
<alias>
<family>Georgia</family>
<family>Times New Roman</family>
<family>WenQuanYi Bitmap Song</family>
<family>SimSun</family>
<family>PMingLiU</family>
<default>
<family>serif</family>
</default>
</alias>
<!--
Monospace faces
-->
<alias>
<family>Courier New</family>
<family>Andale Mono</family>
<family>NSimSun</family>
<family>MingLiU</family>
<default>
<family>monospace</family>
</default>
</alias>
<!--
Alias well known font names to MS TrueType fonts.
These substitute TrueType faces for similar Type1
faces to improve screen appearance.
-->
<alias>
<family>Times</family>
<prefer>
<family>Times New Roman</family>
</prefer>
<default>
<family>serif</family>
</default>
</alias>
<alias>
<family>Helvetica</family>
<prefer>
<family>Arial</family>
</prefer>
<default>
<family>sans-serif</family>
</default>
</alias>
<alias>
<family>Courier</family>
<prefer>
<family>Courier New</family>
</prefer>
<default>
<family>monospace</family>
</default>
</alias>
<!--
Provide required aliases for standard names
-->
<alias>
<family>sans-serif</family>
<prefer>
<family>Tahoma</family>
<family>Arial</family>
<family>Verdana</family>
<family>WenQuanYi Bitmap Song</family>
<family>SimSun</family>
<family>PMingLiU</family>
<family>Comic Sans MS</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Georgia</family>
<family>Times New Roman</family>
<family>WenQuanYi Bitmap Song</family>
<family>SimSun</family>
<family>PMingLiU</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Courier New</family>
<family>Andale Mono</family>
<family>NSimSun</family>
<family>MingLiU</family>
</prefer>
</alias>
<!--
SimSun english portion substitutionsubstitution
-->
<match target="pattern">
<test name="family" >
<string>SimSun</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Tahoma</string>
</edit>
</match>
<!--
NSimSun english portion substitutionsubstitution
-->
<match target="pattern">
<test name="family" >
<string>NSimSun</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Courier New</string>
</edit>
</match>
<!--
Courier substitution
-->
<match target="pattern">
<test name="family" >
<string>Courier</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Courier New</string>
</edit>
</match>
<!--
Bold Tahoma/Verdana substitution:
when its size more than 20px,substitution with Bold Arial
-->
<match target="pattern">
<test name="family" >
<string>Tahoma</string>
<string>Verdana</string>
</test>
<test name="weight" compare="more_eq">
<int>180</int>
</test>
<test name="pixelsize" compare="more_eq" >
<double>20</double>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Arial</string>
</edit>
</match>
<!--
Font size settings:
set the apposite font size,so it's easy to be read
-->
<match target="pattern" >
<test name="pixelsize" compare="more_eq" >
<double>8</double>
</test>
<test name="pixelsize" compare="less_eq" >
<double>12</double>
</test>
<edit name="pixelsize" mode="assign" >
<double>12</double>
</edit>
</match>
<!--
Artificial oblique for fonts without an italic or oblique version
-->
<match target="font">
<!-- check to see if the font is roman -->
<test name="slant">
<const>roman</const>
</test>
<!-- check to see if the pattern requested non-roman -->
<test target="pattern" name="slant" compare="not_eq">
<const>roman</const>
</test>
<!-- multiply the matrix to slant the font -->
<edit name="matrix" mode="assign">
<times>
<name>matrix</name>
<matrix>
<double>1</double><double>0.2</double>
<double>0</double><double>1</double>
</matrix>
</times>
</edit>
<!-- pretend the font is oblique now -->
<edit name="slant" mode="assign">
<const>oblique</const>
</edit>
</match>
<!--
Synthetic emboldening for fonts that do not have bold face available
-->
<match target="font">
<!-- check to see if the font is just regular -->
<test name="weight" compare="less_eq">
<int>100</int>
</test>
<!-- check to see if the pattern requests bold -->
<test target="pattern" name="weight" compare="more_eq">
<int>180</int>
</test>
<!-- set the embolden flag -->
<edit name="embolden" mode="assign">
<bool>true</bool>
</edit>
</match>
<!--
The dual-width Asian fonts (spacing=dual) are not rendered correctly,
apparently FreeType forces all widths to match. Trying to disable the
width forcing code by setting globaladvance=false alone doesn't help.
As a brute force workaround, also set spacing=proportional, i.e. handle
them as proportional fonts:
-->
<match target="font">
<test name="lang" compare="contains" >
<string>zh</string>
<string>ja</string>
<string>ko</string>
</test>
<edit name="spacing" mode="assign" >
<const>proportional</const>
</edit>
<edit name="globaladvance" mode="assign" >
<bool>false</bool>
</edit>
</match>
<!--
CJK antialias settings:
when font size (in pixel) between 8 and 20px
-->
<match target="font" >
<test name="lang" compare="contains" >
<string>zh</string>
<string>ja</string>
<string>ko</string>
</test>
<test name="pixelsize" compare="more_eq" >
<double>8</double>
</test>
<test name="pixelsize" compare="less_eq" >
<double>20</double>
</test>
<edit name="antialias" mode="assign" >
<bool>false</bool>
</edit>
<edit name="autohint" mode="assign" >
<bool>false</bool>
</edit>
<edit name="hinting" mode="assign" >
<bool>false</bool>
</edit>
</match>
<!--
CJK antialias settings:
when font size (in pixel) more than 20px, enable AA.
-->
<match target="font" >
<test name="lang" compare="contains" >
<string>zh</string>
<string>ja</string>
<string>ko</string>
</test>
<test name="pixelsize" compare="more_eq" >
<double>20</double>
</test>
<edit name="antialias" mode="assign" >
<bool>true</bool>
</edit>
<edit name="autohint" mode="assign" >
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign" >
<bool>true</bool>
</edit>
</match>
<!--
Italic CJK fonts,enable AA
-->
<match target="font">
<test name="lang" compare="contains" >
<string>zh</string>
<string>ja</string>
<string>ko</string>
</test>
<test name="slant" compare="not_eq">
<const>roman</const>
</test>
<edit name="antialias" mode="assign" >
<bool>true</bool>
</edit>
<edit name="autohint" mode="assign" >
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign" >
<bool>true</bool>
</edit>
</match>
<!--
Microsoft fonts settings
-->
<!--
default : smoothed and hinted
-->
<match target="font" >
<test name="foundry" >
<string>monotype</string>
<string>microsoft</string>
</test>
<edit name="antialias" mode="assign" >
<bool>true</bool>
</edit>
<edit name="autohint" mode="assign" >
<bool>false</bool>
</edit>
<edit name="hinting" mode="assign" >
<bool>true</bool>
</edit>
<edit name="hintstyle" mode="assign" >
<const>hintfull</const>
</edit>
</match>
<!--
Courier New:
both enable autohint and hinting looks very well.
-->
<match target="font" >
<test name="family" >
<string>Courier</string>
<string>Courier New</string>
</test>
<edit name="antialias" mode="assign" >
<bool>true</bool>
</edit>
<edit name="autohint" mode="assign" >
<bool>true</bool>
</edit>
<edit name="hinting" mode="assign" >
<bool>true</bool>
</edit>
<edit name="hintstyle" mode="assign" >
<const>hintfull</const>
</edit>
</match>
<!--
Courier New font size
-->
<match target="font" >
<test name="family" >
<string>Courier New</string>
</test>
<test name="pixelsize" compare="less_eq" >
<double>14.7</double>
</test>
<edit name="pixelsize" mode="assign" >
<double>14.7</double>
</edit>
</match>
</fontconfig>
相关阅读 更多 +