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