[feeb99a] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[ff769b8c] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[feeb99a] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
[3f72a148] | 8 | <sect1 id="x-setup" xreflabel="X Window System Components">
|
---|
| 9 | <?dbhtml filename="x-setup.html"?>
|
---|
[feeb99a] | 10 |
|
---|
[84b64f2] | 11 | <sect1info>
|
---|
| 12 | <othername>$LastChangedBy$</othername>
|
---|
| 13 | <date>$Date$</date>
|
---|
| 14 | </sect1info>
|
---|
[0bfe309a] | 15 |
|
---|
[84b64f2] | 16 | <title>X Window System Components</title>
|
---|
[0bfe309a] | 17 |
|
---|
[3f72a148] | 18 | <sect2 role="configuration" id='xconfig'>
|
---|
| 19 | <title>Configuring The X Window System</title>
|
---|
| 20 |
|
---|
| 21 | <para>If you've installed the X Window System in any prefix other
|
---|
| 22 | than <filename>/usr</filename>, as the
|
---|
| 23 | <systemitem class="username">root</systemitem> user, add
|
---|
| 24 | <filename class="directory">
|
---|
| 25 | <replaceable></usr/X11R6></replaceable>/lib</filename> to
|
---|
| 26 | the <filename>/etc/ld.so.conf</filename> file and run
|
---|
[96ffdca] | 27 | <command>ldconfig</command>. Additionally, while still the
|
---|
[3f72a148] | 28 | <systemitem class="username">root</systemitem> user, ensure
|
---|
| 29 | <filename class="directory">
|
---|
| 30 | <replaceable></usr/X11R6></replaceable>/bin</filename>
|
---|
| 31 | and <filename class="directory">
|
---|
| 32 | <replaceable></usr/X11R6></replaceable>/lib/pkgconfig</filename>
|
---|
| 33 | are added to your <envar>PATH</envar> and <envar>PKG_CONFIG_PATH</envar>
|
---|
| 34 | environment variables, respectively. Instructions for doing this are
|
---|
| 35 | described in the section <xref linkend='postlfs-config-profile'/>.</para>
|
---|
| 36 |
|
---|
| 37 | <para>As the <systemitem class="username">root</systemitem> user
|
---|
| 38 | create a basic X Window System configuration file with the following
|
---|
| 39 | commands:</para>
|
---|
| 40 |
|
---|
| 41 | <para>For <application>Xorg</application>:</para>
|
---|
| 42 | <screen><userinput>cd ~ &&
|
---|
| 43 | Xorg -configure</userinput></screen>
|
---|
| 44 |
|
---|
| 45 | <para>For <application>XFree86</application>:</para>
|
---|
| 46 | <screen><userinput>cd ~ &&
|
---|
| 47 | XFree86 -configure</userinput></screen>
|
---|
| 48 |
|
---|
| 49 | <indexterm zone="x-setup xconfig">
|
---|
| 50 | <primary sortas="e-etc-X11-xorg-conf">/etc/X11/xorg.conf</primary>
|
---|
| 51 | </indexterm>
|
---|
| 52 |
|
---|
| 53 | <indexterm zone="x-setup xconfig">
|
---|
| 54 | <primary sortas="e-etc-X11-XF86Config">/etc/X11/XF86Config</primary>
|
---|
| 55 | </indexterm>
|
---|
| 56 |
|
---|
| 57 | <para>The screen will go black and you may hear some clicking of the
|
---|
| 58 | monitor. This command will create a file in your
|
---|
| 59 | home directory, <filename>xorg.conf.new</filename> for
|
---|
| 60 | <application>Xorg</application>, or <filename>XF86Config.new</filename>
|
---|
| 61 | for <application>XFree86</application>.</para>
|
---|
| 62 |
|
---|
| 63 | <para>Edit the newly created configuration file to suit your system. The
|
---|
[96ffdca] | 64 | details of the files are located in the <filename>xorg.conf.5x</filename>
|
---|
| 65 | and <filename>XF86Config.5x</filename> man
|
---|
[3f72a148] | 66 | pages. Some things you may want to do are:</para>
|
---|
| 67 |
|
---|
| 68 | <itemizedlist>
|
---|
| 69 | <listitem>
|
---|
| 70 | <para>Section "Files". Change the order of the font paths searched.
|
---|
| 71 | You may want to put 100dpi fonts ahead of 75dpi fonts if your system
|
---|
| 72 | normally comes up closer to 100 dots per inch. You may want to remove
|
---|
| 73 | some font directories completely.</para>
|
---|
| 74 | </listitem>
|
---|
| 75 | <listitem>
|
---|
| 76 | <para>Section "Module". If you are going to install NVidia
|
---|
| 77 | drivers, remove the "dri" line.</para>
|
---|
| 78 | </listitem>
|
---|
| 79 | <listitem>
|
---|
| 80 | <para>Sections "InputDevice". You may want to change the
|
---|
| 81 | keyboard autorepeat rate by adding
|
---|
| 82 | <option>Option "Autorepeat" "250 30"</option>.</para>
|
---|
| 83 | </listitem>
|
---|
| 84 | <listitem>
|
---|
| 85 | <para>Section "Monitor". Specify the <option>VertRefresh</option>
|
---|
| 86 | and <option>HorizSync</option> values if the system does not
|
---|
| 87 | automatically detect the monitor and its values.</para>
|
---|
| 88 | </listitem>
|
---|
| 89 | <listitem>
|
---|
| 90 | <para>Section "Device". You may want to set some of the options
|
---|
| 91 | available for your selected video driver. A description of the driver
|
---|
| 92 | parameters is in the man page for your driver.</para>
|
---|
| 93 | </listitem>
|
---|
| 94 | <listitem><para>Section "Screen". Add a DefaultDepth statement such as:
|
---|
| 95 | <option>DefaultDepth 24</option>. In the SubSection for your
|
---|
| 96 | default depth, add a modes line such as:
|
---|
| 97 | <option>Modes "1600x1200" "1280x1024" "1024x768"</option>. The first
|
---|
| 98 | mode listed will normally be the starting resolution.</para>
|
---|
| 99 | </listitem>
|
---|
| 100 | </itemizedlist>
|
---|
| 101 |
|
---|
| 102 | <para>Test the system with one of the following commands:</para>
|
---|
| 103 |
|
---|
| 104 | <para>For <application>Xorg</application>:</para>
|
---|
| 105 | <screen><userinput>X -config ~/xorg.conf.new</userinput></screen>
|
---|
| 106 |
|
---|
| 107 | <para>For <application>XFree86</application>:</para>
|
---|
| 108 | <screen><userinput>XFree86 -xf86config ~/XF86Config.new</userinput></screen>
|
---|
| 109 |
|
---|
| 110 | <para>You will only get a gray background with an X-shaped mouse cursor,
|
---|
| 111 | but it confirms the system is working. Exit with
|
---|
| 112 | <keycap>Control+Alt+Backspace</keycap>. If the system does not work, take
|
---|
| 113 | a look at <filename>/var/log/Xorg.0.log</filename> or
|
---|
| 114 | <filename>/var/log/XFree86.0.log</filename> to see what went
|
---|
| 115 | wrong.</para>
|
---|
| 116 |
|
---|
| 117 | <para>As the <systemitem class="username">root</systemitem> user, create
|
---|
| 118 | the configuration directory and move the configuration file to the new
|
---|
| 119 | directory:</para>
|
---|
| 120 |
|
---|
| 121 | <para>For <application>Xorg</application>:</para>
|
---|
| 122 | <screen role="root"><userinput>install -v -m755 -D ~/xorg.conf.new /etc/X11/xorg.conf</userinput></screen>
|
---|
| 123 |
|
---|
| 124 | <para>For <application>XFree86</application>:</para>
|
---|
| 125 | <screen role="root"><userinput>install -v -m755 -D ~/XF86Config.new /etc/X11/XF86Config</userinput></screen>
|
---|
| 126 |
|
---|
[04c940c3] | 127 | <para>As a convenience, Xorg-&xorg7-version; users should populate the
|
---|
[7be99f2c] | 128 | <filename class="directory">/etc/X11</filename> directory with symlinks
|
---|
| 129 | to various configuration directories that were located in
|
---|
| 130 | <filename class="directory">/etc/X11</filename> with previous
|
---|
| 131 | versions of <application>Xorg</application>. This step is not needed
|
---|
| 132 | for users of Xorg-&xorg-version; or XFree86. Exectute the following
|
---|
| 133 | commands as the <systemitem class="username">root</systemitem>
|
---|
| 134 | user:</para>
|
---|
| 135 |
|
---|
| 136 | <screen><userinput role="root">mkdir $XORG_PREFIX/lib/X11/twm &&
|
---|
| 137 | ln -svt /etc/X11 \
|
---|
| 138 | $XORG_PREFIX/lib/X11/{app-defaults,twm,xkb,fs,lbxproxy,proxymngr} \
|
---|
| 139 | $XORG_PREFIX/lib/X11/{rstart,xdm,xinit,xserver,xsm}</userinput></screen>
|
---|
| 140 |
|
---|
[3f72a148] | 141 | <para>As the <systemitem class="username">root</systemitem> user, create
|
---|
| 142 | <filename>.xinitrc</filename>:</para>
|
---|
| 143 |
|
---|
| 144 | <screen><userinput>cat > ~/.xinitrc << "EOF"
|
---|
| 145 | <literal># Begin .xinitrc file
|
---|
| 146 | xterm -g 80x40+0+0 &
|
---|
| 147 | xclock -g 100x100-0+0 &
|
---|
| 148 | twm</literal>
|
---|
| 149 | EOF</userinput></screen>
|
---|
| 150 |
|
---|
| 151 | <para>This provides an initial screen with a small clock that is
|
---|
| 152 | managed by a simple window manager, Tab Window Manager. For details of
|
---|
| 153 | <command>twm</command>, see the man page.</para>
|
---|
| 154 |
|
---|
[7be99f2c] | 155 | <indexterm zone="x-setup xconfig">
|
---|
| 156 | <primary sortas="e-AA.xinitrc">~/.xinitrc</primary>
|
---|
| 157 | </indexterm>
|
---|
| 158 |
|
---|
[3f72a148] | 159 | <note>
|
---|
[e257101] | 160 | <para>Both the default, and the BLFS configuration for
|
---|
| 161 | <application>Xorg</application> include <application>xterm</application>.
|
---|
| 162 | <application>Xorg</application>'s modular distribution no longer includes
|
---|
[3f72a148] | 163 | <application>xterm</application>, and
|
---|
| 164 | as a result, the <command>startx</command> command will fail if you have
|
---|
| 165 | not installed <xref linkend="xterm2"/> when using the modular X Window
|
---|
[e257101] | 166 | System. You can remove the <application>xterm</application> line in the
|
---|
| 167 | above config file to test the xserver, or install one of the other
|
---|
| 168 | terminal emulators and make appropriate changes.</para>
|
---|
[3f72a148] | 169 | </note>
|
---|
| 170 |
|
---|
| 171 | <para>When needed, the X Window System creates the directory
|
---|
| 172 | <filename class='directory'>/tmp/.ICE-unix</filename> if it does not
|
---|
| 173 | exist. If this directory is not owned by
|
---|
| 174 | <systemitem class="username">root</systemitem>,
|
---|
| 175 | the X Window System delays startup by a few seconds and also
|
---|
| 176 | appends a warning to the logfile. This also affects startup of other
|
---|
| 177 | applications. To improve performance, it is advisable to manually create
|
---|
| 178 | the directory before the X Window System uses it. Add the file creation
|
---|
| 179 | to <filename>/etc/sysconfig/createfiles</filename> that is sourced by
|
---|
| 180 | the <filename>/etc/rc.d/init.d/cleanfs</filename> startup script.</para>
|
---|
| 181 |
|
---|
| 182 | <screen role="root"><userinput>cat >> /etc/sysconfig/createfiles << "EOF"
|
---|
| 183 | /tmp/.ICE-unix dir 1777 root root
|
---|
| 184 | EOF</userinput></screen>
|
---|
| 185 |
|
---|
| 186 | <indexterm zone="x-setup xconfig">
|
---|
| 187 | <primary
|
---|
| 188 | sortas="e-etc-sysconfig-createfiles">/etc/sysconfig/createfiles</primary>
|
---|
| 189 | </indexterm>
|
---|
| 190 |
|
---|
| 191 | <para>Start <application>X</application> with:</para>
|
---|
| 192 |
|
---|
| 193 | <screen><userinput>startx</userinput></screen>
|
---|
| 194 |
|
---|
| 195 | <para>and a basic functional <application>X Window
|
---|
| 196 | System</application> should be displayed.</para>
|
---|
| 197 |
|
---|
| 198 | <para>For a list of the package contents and a description of the commands,
|
---|
| 199 | see the sections in the <xref linkend='xfree86-contents'/>.</para>
|
---|
| 200 |
|
---|
| 201 | </sect2>
|
---|
| 202 |
|
---|
[84b64f2] | 203 | <sect2 id='dri'>
|
---|
| 204 | <title>Checking Direct Rendering Infrastructure (DRI) Installation</title>
|
---|
[feeb99a] | 205 |
|
---|
[84b64f2] | 206 | <indexterm zone="x-setup dri">
|
---|
| 207 | <primary sortas="g-DRI">DRI</primary>
|
---|
| 208 | </indexterm>
|
---|
[feeb99a] | 209 |
|
---|
[84b64f2] | 210 | <para>DRI is a framework for allowing software to access graphics hardware
|
---|
| 211 | in a safe and efficient manner. It is installed in
|
---|
| 212 | <application>X</application> by default if you have a supported video card.
|
---|
| 213 | To check if DRI is installed properly, check the log file
|
---|
| 214 | <filename>/var/log/XFree86.0.log</filename> or
|
---|
| 215 | <filename>/var/log/Xorg.0.log</filename> for statements like:</para>
|
---|
| 216 |
|
---|
| 217 | <screen><literal>(II) R128(0): Direct rendering enabled</literal></screen>
|
---|
| 218 |
|
---|
| 219 | <para>From an <command>xterm</command>, run <command>glxinfo</command>
|
---|
| 220 | and look for the phrase:</para>
|
---|
[310960e4] | 221 |
|
---|
[7f2584b7] | 222 | <screen><computeroutput>direct rendering: Yes</computeroutput></screen>
|
---|
[feeb99a] | 223 |
|
---|
[84b64f2] | 224 | <para>You can also run the test program <command>glxgears</command>.
|
---|
| 225 | This program brings up a window with three gears turning. The
|
---|
| 226 | <command>xterm</command> will display how many frames were drawn every
|
---|
| 227 | five seconds, so this is a reasonable benchmark. The window is scalable,
|
---|
| 228 | and the frames drawn per second is highly dependent on the size of
|
---|
| 229 | the window.</para>
|
---|
[0bfe309a] | 230 |
|
---|
[84b64f2] | 231 | <indexterm zone="x-setup dri">
|
---|
| 232 | <primary sortas="b-glxgears">glxgears</primary>
|
---|
| 233 | </indexterm>
|
---|
[0bfe309a] | 234 |
|
---|
[84b64f2] | 235 | <indexterm zone="x-setup dri">
|
---|
| 236 | <primary sortas="b-glxinfo">glxinfo</primary>
|
---|
| 237 | </indexterm>
|
---|
[0bfe309a] | 238 |
|
---|
[84b64f2] | 239 | <para>For troubleshooting problems, check the DRI Users Guide at
|
---|
| 240 | <ulink url="http://dri.sourceforge.net/doc/DRIuserguide.html"/>.</para>
|
---|
[0bfe309a] | 241 |
|
---|
[84b64f2] | 242 | </sect2>
|
---|
[feeb99a] | 243 |
|
---|
| 244 | <!-- ================================================== -->
|
---|
| 245 |
|
---|
[84b64f2] | 246 | <sect2 id='fonts'>
|
---|
[43d8a509] | 247 | <title>Setting up Fonts</title>
|
---|
[84b64f2] | 248 |
|
---|
[43d8a509] | 249 | <para>There are two font systems in the
|
---|
| 250 | <application>X Window System</application>. The first is the
|
---|
| 251 | core X font protocol, and the second is Xft. Toolkits that use the core
|
---|
| 252 | X font protocol include Xt, Xaw, Motif clones and GTK+-1.2. Toolkits that
|
---|
| 253 | use Xft include GTK+-2 and Qt and use <application>Fontconfig</application>
|
---|
| 254 | for control. Both font systems should be configured for proper font
|
---|
| 255 | coverage in the <application>X Window System</application>.</para>
|
---|
[84b64f2] | 256 |
|
---|
| 257 | <indexterm zone="x-setup fonts">
|
---|
| 258 | <primary sortas="e-etc-X11-xorg-conf">/etc/X11/xorg.conf</primary>
|
---|
| 259 | </indexterm>
|
---|
| 260 |
|
---|
| 261 | <indexterm zone="x-setup fonts">
|
---|
| 262 | <primary sortas="e-etc-X11-XF86Config">/etc/X11/XF86Config</primary>
|
---|
| 263 | </indexterm>
|
---|
| 264 |
|
---|
| 265 | <sect3>
|
---|
[43d8a509] | 266 | <title>Core X Font Protocol</title>
|
---|
[84b64f2] | 267 |
|
---|
[43d8a509] | 268 | <indexterm zone="x-setup fonts">
|
---|
| 269 | <primary sortas="g-core-x-font">Core X Font Protocol</primary>
|
---|
[84b64f2] | 270 | </indexterm>
|
---|
| 271 |
|
---|
[43d8a509] | 272 | <para>The core X font protocol finds fonts from the server configuration
|
---|
| 273 | file (<filename>xorg.conf</filename> or <filename>XF86Config</filename>).
|
---|
[96ffdca] | 274 | If no font paths exist in the configuration file, the server will fall
|
---|
[43d8a509] | 275 | back to an internal hard-coded path. Assuming the prefix for your
|
---|
| 276 | <application>X</application> installation is
|
---|
| 277 | <filename class="directory">/usr/X11R6</filename>, the core fonts will
|
---|
| 278 | reside in subdirectories of <filename
|
---|
| 279 | class="directory">/usr/X11R6/lib/X11/fonts</filename>. For each
|
---|
| 280 | directory in the path, the server reads three files:</para>
|
---|
| 281 |
|
---|
| 282 | <itemizedlist>
|
---|
| 283 | <listitem>
|
---|
| 284 | <para><filename>fonts.dir</filename> - maps font files to font
|
---|
| 285 | names; updated with <command>mkfontdir</command></para>
|
---|
| 286 | </listitem>
|
---|
| 287 | <listitem>
|
---|
| 288 | <para><filename>fonts.alias</filename> - defines aliases (such as
|
---|
| 289 | "9x18") for existing fonts</para>
|
---|
| 290 | </listitem>
|
---|
| 291 | <listitem>
|
---|
| 292 | <para><filename>fonts.scale</filename> - lists scalable fonts;
|
---|
| 293 | updated with <command>mkfontscale</command></para>
|
---|
| 294 | </listitem>
|
---|
| 295 | </itemizedlist>
|
---|
| 296 |
|
---|
| 297 | <para>The core X fonts protocol uses names such as
|
---|
| 298 | <systemitem>-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1</systemitem>.
|
---|
| 299 | These fonts are rendered by the <application>X</application> server
|
---|
| 300 | without antialiasing. The server itself uses the "cursor" font for
|
---|
| 301 | painting the mouse cursor, and the protocol specification requires the
|
---|
| 302 | font "fixed" to be available.</para>
|
---|
| 303 |
|
---|
| 304 | <para>Scalable fonts, such as Type1 and TrueType, are read from
|
---|
| 305 | <filename>fonts.scale</filename> files by the server. The core X font
|
---|
| 306 | system uses the "freetype" module for non-antialiased rendering of these
|
---|
| 307 | fonts. Ensure that the "freetype" module is loaded in the
|
---|
| 308 | <filename>XF86config</filename> or <filename>xorg.conf</filename>
|
---|
| 309 | file by adding it to the "Module" section:</para>
|
---|
[84b64f2] | 310 |
|
---|
| 311 | <screen><literal>Section "Module"
|
---|
| 312 | ...
|
---|
| 313 | Load "freetype"
|
---|
| 314 | ...
|
---|
| 315 | EndSection</literal></screen>
|
---|
| 316 |
|
---|
[43d8a509] | 317 | <para>The character set used is part of the font name, e.g. "-iso8859-1".
|
---|
| 318 | It is important that applications which support a non-English interface
|
---|
| 319 | specify the character set correctly so that the proper glyphs are used.
|
---|
| 320 | This can be controlled through the <application>X</application>
|
---|
| 321 | resources, which will be described later.</para>
|
---|
| 322 |
|
---|
| 323 | <para>In some cases, applications rely upon the fonts named "fixed" or
|
---|
| 324 | something like "9x18". In these cases, it is important that the
|
---|
| 325 | <filename>fonts.alias</filename> file specifies the correct character
|
---|
| 326 | set. Users of ISO-8859-<replaceable>X</replaceable> encodings where
|
---|
| 327 | <replaceable>X</replaceable> != 1 should modify the
|
---|
| 328 | <filename>/usr/lib/X11/fonts/misc/fonts.alias</filename> file by
|
---|
| 329 | replacing the "iso8859-1" string with the proper encoding name. This is
|
---|
| 330 | accomplished by running the following command as the <systemitem
|
---|
| 331 | class="username">root</systemitem> user, substituting the proper value
|
---|
[c5c2654] | 332 | for <replaceable><X></replaceable>:</para>
|
---|
[43d8a509] | 333 |
|
---|
[c5c2654] | 334 | <screen role="root"><userinput>sed -i 's,iso8859-1\( \|$\),iso8859-<replaceable><X></replaceable>\1,g' \
|
---|
[db292f6] | 335 | /usr/lib/X11/fonts/{75dpi,100dpi,misc}/fonts.alias</userinput></screen>
|
---|
[43d8a509] | 336 |
|
---|
| 337 | <para>Users of Cyrillic fonts have properly defined aliases in
|
---|
| 338 | <filename>/usr/lib/X11/fonts/cyrillic/fonts.alias</filename>. However,
|
---|
| 339 | this file will not be used unless the <filename
|
---|
| 340 | class="directory">/usr/lib/X11/fonts/cyrillic</filename> directory is
|
---|
| 341 | first in the font search path. Otherwise, the
|
---|
| 342 | <filename>/usr/lib/X11/fonts/misc/fonts.alias</filename> file will be
|
---|
| 343 | used.</para>
|
---|
| 344 |
|
---|
[84b64f2] | 345 | </sect3>
|
---|
| 346 |
|
---|
[784ddf5] | 347 | <sect3 id="xft-font-protocol" xreflabel="Xft Font Protocol">
|
---|
[43d8a509] | 348 | <title>Xft Font Protocol</title>
|
---|
[84b64f2] | 349 |
|
---|
| 350 | <indexterm zone="x-setup fonts">
|
---|
[43d8a509] | 351 | <primary sortas="g-truetype">TrueType Fonts</primary>
|
---|
[84b64f2] | 352 | </indexterm>
|
---|
| 353 |
|
---|
[43d8a509] | 354 | <para>Xft provides antialiased font rendering through
|
---|
| 355 | <application>Freetype</application>, and fonts are controlled from the
|
---|
| 356 | client side using <application>Fontconfig</application>. The default
|
---|
| 357 | search path is <filename class="directory">/usr/share/fonts</filename>
|
---|
| 358 | and <filename class="directory">~/.fonts</filename>.
|
---|
| 359 | When installing <application>X</application>, symlinks were created from
|
---|
| 360 | the <filename class="directory">OTF</filename> and <filename
|
---|
| 361 | class="directory">TTF</filename> <application>X</application> font
|
---|
| 362 | directories to <filename
|
---|
| 363 | class="directory">/usr/share/fonts/X11-{OTF,TTF}</filename>. This
|
---|
| 364 | prevents <application>Fontconfig</application> from using the poorly
|
---|
| 365 | rendered Type1 fonts or the non-scalable bitmapped fonts.</para>
|
---|
| 366 |
|
---|
| 367 | <para><application>Fontconfig</application> searches directories in its
|
---|
| 368 | path recursively and maintains a cache of the font characteristics in
|
---|
| 369 | <filename>fonts.cache-1</filename> files in each directory. If the cache
|
---|
| 370 | appears to be out of date, it is ignored, and information is (slowly)
|
---|
| 371 | fetched from the fonts themselves. This cache
|
---|
| 372 | can be regenerated using the <command>fc-cache</command> command at any
|
---|
| 373 | time.</para>
|
---|
| 374 |
|
---|
| 375 | <para><application>Fontconfig</application> uses names such as
|
---|
| 376 | "Monospace 12" to define fonts. Applications generally use generic font
|
---|
| 377 | names such as "Monospace", "Sans" and "Serif".
|
---|
| 378 | <application>Fontconfig</application> resolves these names to a font that
|
---|
| 379 | has all characters that cover the orthography of the language indicated
|
---|
| 380 | by the locale settings. Knowledge of these font names is included in
|
---|
| 381 | <filename>/etc/fonts/fonts.conf</filename>.</para>
|
---|
| 382 |
|
---|
| 383 | <para>Standard scalable fonts that come with <application>X</application>
|
---|
| 384 | provide very poor Unicode coverage. You may notice in applications that
|
---|
| 385 | use <application>Xft</application> that some characters appear as a box
|
---|
| 386 | with four binary digits inside. In this case, a font set with the
|
---|
| 387 | available glyphs has not been found. Other times, applications that
|
---|
| 388 | don't use other font families by default and don't accept substitutions
|
---|
| 389 | from <application>Fontconfig</application> will display blank lines when
|
---|
| 390 | the default font doesn't cover the orthography of the user's language.
|
---|
| 391 | This happens, e.g., with <application>Fluxbox</application> in the
|
---|
| 392 | ru_RU.KOI8-R locale.</para>
|
---|
| 393 |
|
---|
| 394 | <para>In order to provide greater Unicode coverage, it is recommended
|
---|
| 395 | that you install these fonts:</para>
|
---|
| 396 |
|
---|
| 397 | <itemizedlist>
|
---|
| 398 | <listitem>
|
---|
| 399 | <para><ulink url="http://dejavu.sourceforge.net/">DejaVu fonts</ulink>
|
---|
| 400 | - These fonts are replacements for the Bitstream Vera fonts and
|
---|
| 401 | provide Latin-based scripts with accents and Cyrillic glyphs.
|
---|
| 402 | <application>Fontconfig</application> does not know about the DejaVu
|
---|
| 403 | fonts by default, so <filename>/etc/fonts/fonts.conf</filename> will
|
---|
| 404 | have to be edited for it to be recognized by the generic names such
|
---|
| 405 | as "Sans". This will be described below.</para>
|
---|
| 406 | </listitem>
|
---|
| 407 | <listitem>
|
---|
| 408 | <para><ulink
|
---|
| 409 | url="http://download.savannah.nongnu.org/releases/freefont/">FreeFont</ulink>
|
---|
| 410 | - This set of fonts covers nearly every non-CJK character, but is not
|
---|
| 411 | visually pleasing. <application>Fontconfig</application> will use it
|
---|
| 412 | as a last resort to substitute generic font family names.</para>
|
---|
| 413 | </listitem>
|
---|
| 414 | <listitem>
|
---|
| 415 | <para><ulink
|
---|
| 416 | url="http://corefonts.sourceforge.net/">Microsoft Core fonts</ulink>
|
---|
| 417 | - These fonts provide slightly worse Unicode coverage than FreeFont,
|
---|
| 418 | but are better hinted. Be sure to read the license before using
|
---|
| 419 | them. <application>Fontconfig</application> knows about them by
|
---|
| 420 | default.</para>
|
---|
| 421 | </listitem>
|
---|
| 422 | <listitem>
|
---|
| 423 | <para><ulink
|
---|
| 424 | url="http://cle.linux.org.tw/fonts/FireFly">Firefly New Sung font</ulink>
|
---|
| 425 | - This font provides Chinese coverage. However,
|
---|
[db292f6] | 426 | <application>Fontconfig</application> does not know about this font
|
---|
[43d8a509] | 427 | by default.</para>
|
---|
| 428 | </listitem>
|
---|
| 429 | <listitem>
|
---|
| 430 | <para><ulink
|
---|
| 431 | url="http://cle.linux.org.tw/fonts/Arphic">Arphic fonts</ulink> -
|
---|
| 432 | A similar set of Chinese fonts to the Firefly New Sung font.
|
---|
| 433 | <application>Fontconfig</application> knows about these fonts by
|
---|
| 434 | default and will substitute them for generic family names.</para>
|
---|
| 435 | </listitem>
|
---|
| 436 | <listitem>
|
---|
| 437 | <para><ulink
|
---|
| 438 | url="http://sourceforge.jp/projects/efont/">Kochi fonts</ulink> -
|
---|
| 439 | These provide Japanese characters, and
|
---|
| 440 | <application>Fontconfig</application> knows about these fonts by
|
---|
| 441 | default.</para>
|
---|
| 442 | </listitem>
|
---|
| 443 | <listitem>
|
---|
| 444 | <para><ulink
|
---|
| 445 | url="http://kldp.net/projects/baekmuk/">Baekmuk fonts</ulink>
|
---|
| 446 | - These fonts provide Korean coverage, and
|
---|
| 447 | <application>Fontconfig</application> knows about these fonts by
|
---|
| 448 | default.</para>
|
---|
| 449 | </listitem>
|
---|
| 450 | </itemizedlist>
|
---|
| 451 |
|
---|
| 452 | <para>The list above will not provide complete Unicode coverage. For
|
---|
| 453 | more information, please visit the <ulink
|
---|
| 454 | url="http://unifont.org/fontguide/">Unicode Font Guide</ulink>.</para>
|
---|
| 455 |
|
---|
| 456 | <para>As an example, consider the installation of the DejaVu fonts. From
|
---|
| 457 | the unpacked source directory, run the following commands as the
|
---|
| 458 | <systemitem class="username">root</systemitem> user:</para>
|
---|
| 459 |
|
---|
| 460 | <screen role="root"><userinput>install -v -d -m755 /usr/share/fonts/dejavu &&
|
---|
| 461 | install -v -m644 *.ttf /usr/share/fonts/dejavu &&
|
---|
| 462 | fc-cache -v /usr/share/fonts/dejavu</userinput></screen>
|
---|
| 463 |
|
---|
| 464 | <para>Earlier it was mentioned that <filename>/etc/fonts/fonts.conf</filename>
|
---|
| 465 | could be modified to use DejaVu using the default family names. Since
|
---|
[96ffdca] | 466 | DejaVu is a replacement for Bitstream Vera fonts, it can be substituted
|
---|
[43d8a509] | 467 | for that family. Visually inspect the <filename>fonts.conf</filename> to
|
---|
| 468 | see how fonts are grouped together under the generic family names and a
|
---|
| 469 | preference list is created. To replace Bitstream Vera with DejaVu, as the
|
---|
| 470 | <systemitem class="username">root</systemitem> user:</para>
|
---|
| 471 |
|
---|
| 472 | <screen role="root"><userinput>sed -i 's/<family>Bitstream Vera/<family>DejaVu/' /etc/fonts/fonts.conf</userinput></screen>
|
---|
[19bf3801] | 473 |
|
---|
[84b64f2] | 474 | <!--
|
---|
[646d9189] | 475 | <screen><userinput><command>sed -i -e '/^<\/fontconfig>/i\
|
---|
| 476 | <dir>/usr/X11R6/lib/X11/fonts/TTF</dir>\
|
---|
| 477 | <dir>/usr/X11R6/lib/X11/fonts/Type1</dir>' /etc/fonts/local.conf</command></userinput></screen>
|
---|
[19bf3801] | 478 | -->
|
---|
[1663c2b5] | 479 |
|
---|
| 480 | <para condition="html" role="usernotes">User Notes:
|
---|
| 481 | <ulink url='&blfs-wiki;/XWindowSystemComponents'/></para>
|
---|
| 482 |
|
---|
| 483 | </sect3>
|
---|
[feeb99a] | 484 |
|
---|
[84b64f2] | 485 | </sect2>
|
---|
[feeb99a] | 486 |
|
---|
| 487 | <!-- ================================================== -->
|
---|
[84b64f2] | 488 |
|
---|
| 489 | <sect2>
|
---|
| 490 | <title>Setting up Keyboards</title>
|
---|
| 491 |
|
---|
| 492 | <para>In this version of <application>X</application>, non-Latin
|
---|
| 493 | keyboard layouts do not include Latin configurations as was previous
|
---|
| 494 | practice. To set up a keyboard for Latin and non-Latin input, change
|
---|
| 495 | the XkbLayout keyboard driver option in the InputDevice section
|
---|
| 496 | of the <filename>XF86Config</filename> or <filename>xorg.conf</filename>
|
---|
| 497 | file. For example:</para>
|
---|
| 498 |
|
---|
| 499 | <screen><literal>Section "InputDevice"
|
---|
| 500 | Identifier "Keyboard0"
|
---|
| 501 | Driver "Keyboard"
|
---|
| 502 | Option "XkbModel" "pc105"
|
---|
| 503 | Option "XkbLayout" "en_US,ru"
|
---|
| 504 | Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"
|
---|
| 505 | EndSection</literal></screen>
|
---|
| 506 |
|
---|
| 507 | <para>In this example, you can use the <keycap>Alt+Shift</keycap>
|
---|
| 508 | combination to switch between keyboard layouts and use the Scroll Lock
|
---|
| 509 | LED to indicate when the second layout is active.</para>
|
---|
| 510 |
|
---|
| 511 | </sect2>
|
---|
[feeb99a] | 512 |
|
---|
| 513 | <!-- ================================================== -->
|
---|
| 514 |
|
---|
[84b64f2] | 515 | <sect2 id='xdm'>
|
---|
| 516 | <title>Setting up XDM</title>
|
---|
| 517 |
|
---|
| 518 | <para><command>xdm</command> provides a graphical logon capability and
|
---|
| 519 | is normally set up in <filename>/etc/inittab</filename>. Most of the
|
---|
| 520 | information you need to customize <command>xdm</command> is found in
|
---|
| 521 | its man page. To execute <command>xdm</command> during bootup, change
|
---|
| 522 | the initdefault level to 5 and add the following lines to
|
---|
| 523 | <filename>/etc/inittab</filename>:</para>
|
---|
[0bfe309a] | 524 |
|
---|
[84b64f2] | 525 | <indexterm zone="x-setup xdm">
|
---|
| 526 | <primary sortas="b-xdm">xdm</primary>
|
---|
| 527 | </indexterm>
|
---|
[feeb99a] | 528 |
|
---|
[84b64f2] | 529 | <screen><literal># Run xdm as a separate service
|
---|
| 530 | x:5:respawn:/usr/X11R6/bin/xdm -nodaemon</literal></screen>
|
---|
[feeb99a] | 531 |
|
---|
[84b64f2] | 532 | <para>If <application>Linux-PAM</application> is installed on your
|
---|
| 533 | system, you should create a PAM entry for <command>xdm</command> by
|
---|
| 534 | duplicating the <command>login</command> entry using the following
|
---|
| 535 | command:</para>
|
---|
[feeb99a] | 536 |
|
---|
[84b64f2] | 537 | <indexterm zone="x-setup xdm">
|
---|
| 538 | <primary sortas="e-etc-pam.d/xdm">/etc/pam.d/xdm</primary>
|
---|
| 539 | </indexterm>
|
---|
| 540 |
|
---|
[96ffdca] | 541 | <screen role="root"><userinput>cp -v /etc/pam.d/login /etc/pam.d/xdm</userinput></screen>
|
---|
[84b64f2] | 542 |
|
---|
| 543 | </sect2>
|
---|
[feeb99a] | 544 |
|
---|
| 545 | <!-- ================================================== -->
|
---|
| 546 |
|
---|
[84b64f2] | 547 | <sect2 id='x-resources'>
|
---|
| 548 | <title>Using X Resources</title>
|
---|
[feeb99a] | 549 |
|
---|
[84b64f2] | 550 | <para>There are many options that can be set in
|
---|
| 551 | <application>X</application> and <application>X</application>
|
---|
| 552 | clients via resources. Typically resources are set in the
|
---|
| 553 | <filename>~/.Xresources</filename> file.</para>
|
---|
[0bfe309a] | 554 |
|
---|
[84b64f2] | 555 | <para>The layout of the <filename>~/.Xresources</filename> file
|
---|
| 556 | consists of a list of specifications in the form of</para>
|
---|
[feeb99a] | 557 |
|
---|
[84b64f2] | 558 | <indexterm zone="x-setup x-resources">
|
---|
| 559 | <primary sortas="e-AA.xresources">~/.Xresources</primary>
|
---|
| 560 | </indexterm>
|
---|
[feeb99a] | 561 |
|
---|
[84b64f2] | 562 | <screen><literal>object.subobject[.subobject...].attribute: value</literal></screen>
|
---|
[feeb99a] | 563 |
|
---|
[84b64f2] | 564 | <para>Components of a resource specification are linked together by
|
---|
| 565 | either <emphasis>tight</emphasis>, represented by a dot (.), or
|
---|
| 566 | <emphasis>loose</emphasis>, represented by an asterisk (*), bindings.
|
---|
| 567 | A tight binding indicates that the components on either side of the
|
---|
| 568 | dot must be directly next to each other as defined in a specific
|
---|
| 569 | implementation. An asterisk is a wildcard character that means that
|
---|
| 570 | any number of levels in a defined hierarchy can be between the components.
|
---|
| 571 | For example, X offers two special cursors: redglass and whiteglass. To
|
---|
| 572 | use one of these resources, you need to add the following line:</para>
|
---|
[feeb99a] | 573 |
|
---|
[84b64f2] | 574 | <screen><literal>Xcursor.theme: whiteglass</literal></screen>
|
---|
[feeb99a] | 575 |
|
---|
[84b64f2] | 576 | <para>However, you can specify the background for all clients with:</para>
|
---|
[feeb99a] | 577 |
|
---|
[84b64f2] | 578 | <screen><literal>*background: blue</literal></screen>
|
---|
[feeb99a] | 579 |
|
---|
[84b64f2] | 580 | <para>More specific resource variables will override less specific
|
---|
| 581 | names.</para>
|
---|
[feeb99a] | 582 |
|
---|
[84b64f2] | 583 | <para>Resource definitions can be found in the man pages for each
|
---|
| 584 | respective client.</para>
|
---|
[feeb99a] | 585 |
|
---|
[84b64f2] | 586 | <para>In order to load your resources, the <command>xrdb</command>
|
---|
| 587 | program must be called with the appropriate parameters. Typically,
|
---|
| 588 | the first time resources are loaded, you use:</para>
|
---|
[310960e4] | 589 |
|
---|
[84b64f2] | 590 | <screen><userinput>xrdb -load <filename></userinput></screen>
|
---|
[feeb99a] | 591 |
|
---|
[84b64f2] | 592 | <para>To add resources to <application>X</application>'s database
|
---|
| 593 | in memory, use:</para>
|
---|
[feeb99a] | 594 |
|
---|
[84b64f2] | 595 | <screen><userinput>xrdb -merge <filename></userinput></screen>
|
---|
[0bfe309a] | 596 |
|
---|
[84b64f2] | 597 | <para>The <command>xrdb</command> instruction is usually placed in
|
---|
| 598 | <filename>~/.xinitrc</filename> or <filename>~/.xsession</filename>.
|
---|
| 599 | To get more information, see the <command>xrdb</command> man page.</para>
|
---|
[310960e4] | 600 |
|
---|
[84b64f2] | 601 | <indexterm zone="x-setup x-resources">
|
---|
| 602 | <primary sortas="b-xrdb">xrdb</primary>
|
---|
| 603 | </indexterm>
|
---|
[feeb99a] | 604 |
|
---|
[84b64f2] | 605 | </sect2>
|
---|
| 606 |
|
---|
| 607 | </sect1>
|
---|