📄 x-fonts.html
字号:
are properly closed. The file begins with the usual XML header followed by a DOCTYPEdefinition, and then the <var class="LITERAL"><fontconfig></var> tag:</p><pre class="PROGRAMLISTING"> <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> </pre><p>As previously stated, all fonts in <tt class="FILENAME">/usr/X11R6/lib/X11/fonts/</tt>as well as <tt class="FILENAME">~/.fonts/</tt> are already made available to Xft-awareapplications. If you wish to add another directory outside of these two directory trees,add a line similar to the following to <ttclass="FILENAME">/usr/X11R6/etc/fonts/local.conf</tt>:</p><pre class="PROGRAMLISTING"><dir>/path/to/my/fonts</dir></pre><p>After adding new fonts, and especially new font directories, you should run thefollowing command to rebuild the font caches:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">fc-cache -f</kbd></pre><p>Anti-aliasing makes borders slightly fuzzy, which makes very small text more readableand removes ``staircases'' from large text, but can cause eyestrain if applied to normaltext. To exclude font sizes smaller than 14 point from anti-aliasing, include theselines:</p><pre class="PROGRAMLISTING"> <match target="font"> <test name="size" compare="less"> <double>14</double> </test> <edit name="antialias" mode="assign"> <bool>false</bool> </edit> </match> <match target="font"> <test name="pixelsize" compare="less" qual="any"> <double>14</double> </test> <edit mode="assign" name="antialias"> <bool>false</bool> </edit> </match></pre><p>Spacing for some monospaced fonts may also be inappropriate with anti-aliasing. Thisseems to be an issue with <b class="APPLICATION">KDE</b>, in particular. One possible fixfor this is to force the spacing for such fonts to be 100. Add the following lines:</p><pre class="PROGRAMLISTING"> <match target="pattern" name="family"> <test qual="any" name="family"> <string>fixed</string> </test> <edit name="family" mode="assign"> <string>mono</string> </edit> </match> <match target="pattern" name="family"> <test qual="any" name="family"> <string>console</string> </test> <edit name="family" mode="assign"> <string>mono</string> </edit> </match></pre><p>(this aliases the other common names for fixed fonts as <varclass="LITERAL">"mono"</var>), and then add:</p><pre class="PROGRAMLISTING"> <match target="pattern" name="family"> <test qual="any" name="family"> <string>mono</string> </test> <edit name="spacing" mode="assign"> <int>100</int> </edit> </match> </pre><p>Certain fonts, such as Helvetica, may have a problem when anti-aliased. Usually thismanifests itself as a font that seems cut in half vertically. At worst, it may causeapplications such as <b class="APPLICATION">Mozilla</b> to crash. To avoid this, consideradding the following to <tt class="FILENAME">local.conf</tt>:</p><pre class="PROGRAMLISTING"> <match target="pattern" name="family"> <test qual="any" name="family"> <string>Helvetica</string> </test> <edit name="family" mode="assign"> <string>sans-serif</string> </edit> </match> </pre><p>Once you have finished editing <tt class="FILENAME">local.conf</tt> make sure you endthe file with the <var class="LITERAL"></fontconfig></var> tag. Not doing this willcause your changes to be ignored.</p><p>The default font set that comes with X11 is not very desirable when it comes toanti-aliasing. A much better set of default fonts can be found in the <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/x11-fonts/bitstream-vera/pkg-descr"><ttclass="FILENAME">x11-fonts/bitstream-vera</tt></a> port. This port will install a <ttclass="FILENAME">/usr/X11R6/etc/fonts/local.conf</tt> file if one does not exist already.If the file does exist, the port will create a <ttclass="FILENAME">/usr/X11R6/etc/fonts/local.conf-vera</tt> file. Merge the contents ofthis file into <tt class="FILENAME">/usr/X11R6/etc/fonts/local.conf</tt>, and theBitstream fonts will automatically replace the default X11 Serif, Sans Serif, andMonospaced fonts.</p><p>Finally, users can add their own settings via their personal <ttclass="FILENAME">.fonts.conf</tt> files. To do this, each user should simply create a <ttclass="FILENAME">~/.fonts.conf</tt>. This file must also be in XML format.</p><p>One last point: with an LCD screen, sub-pixel sampling may be desired. This basicallytreats the (horizontally separated) red, green and blue components separately to improvethe horizontal resolution; the results can be dramatic. To enable this, add the linesomewhere in the <tt class="FILENAME">local.conf</tt> file:</p><pre class="PROGRAMLISTING"> <match target="font"> <test qual="all" name="rgba"> <const>unknown</const> </test> <edit name="rgba" mode="assign"> <const>rgb</const> </edit> </match> </pre><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> Depending on the sort of display, <var class="LITERAL">rgb</var> may needto be changed to <var class="LITERAL">bgr</var>, <var class="LITERAL">vrgb</var> or <varclass="LITERAL">vbgr</var>: experiment and see which works best.</p></blockquote></div><p>Anti-aliasing should be enabled the next time the X server is started. However,programs must know how to take advantage of it. At present, the Qt toolkit does, so theentire <b class="APPLICATION">KDE</b> environment can use anti-aliased fonts (see <ahref="x11-wm.html#X11-WM-KDE-ANTIALIAS">Section 5.7.3.2</a> on <bclass="APPLICATION">KDE</b> for details). GTK+ and <b class="APPLICATION">GNOME</b> canalso be made to use anti-aliasing via the ``Font'' capplet (see <ahref="x11-wm.html#X11-WM-GNOME-ANTIALIAS">Section 5.7.1.3</a> for details). By default,<b class="APPLICATION">Mozilla</b> 1.2 and greater will automatically use anti-aliasing.To disable this, rebuild <b class="APPLICATION">Mozilla</b> with the <ttclass="MAKEVAR">-DWITHOUT_XFT</tt> flag.</p></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="x-config.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="x-xdm.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">X11 Configuration</td><td width="34%" align="center" valign="top"><a href="x11.html" accesskey="U">Up</a></td><td width="33%" align="right" valign="top">The X Display Manager</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting <<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>>.<br />For questions about this documentation, e-mail <<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>>.</small></p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -