source: x/installing/x-setup.xml@ 922d7eea

10.0 10.1 11.0 11.1 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 krejzi/svn lazarus nosym perl-modules qt5new systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/test-20220226
Last change on this file since 922d7eea was 922d7eea, checked in by Igor Živković <igor@…>, 18 years ago

More corrections to fonts settings in X.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@2799 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 11.0 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="x-setup">
9<sect1info>
10<othername>$LastChangedBy$</othername>
11<date>$Date$</date>
12</sect1info>
13<?dbhtml filename="xfree86-setup.html"?>
14<title>X Window System Components</title>
15
16<sect2>
17<title>Checking Direct Rendering Infrastructure (<acronym>DRI</acronym>) Installation</title>
18<para><acronym>DRI</acronym> is a framework for allowing software to access graphics hardware
19in a safe and efficient manner. It is installed in
20<application>X</application> by default if
21you have a supported video card. To check if <acronym>DRI</acronym> is installed properly,
22check the log file <filename>/var/log/XFree86.0.log</filename> or
23<filename>/var/log/Xorg.0.log</filename> for statements like:</para>
24
25<screen>(II) R128(0): Direct rendering enabled</screen>
26
27<para>From an <command>xterm</command>, run <command>glxinfo</command> and look for the phrase:</para>
28<screen>direct rendering: Yes</screen>
29
30<para>You can also run the test program <command>glxgears</command>.
31This program brings up a window with three gears turning. The
32<command>xterm</command> will display how many frames were drawn every
33five seconds, so this is a reasonable benchmark. The window is scalable, and
34the frames drawn per second is highly dependent on the size of
35the window.</para>
36
37<para>For troubleshooting problems, check the <acronym>DRI</acronym> Users Guide at
38<ulink url="http://dri.sourceforge.net/doc/DRIuserguide.html"/>.
39</para>
40</sect2>
41
42<!-- ================================================== -->
43
44<sect2>
45<title>Adding <application>TrueType</application> fonts to
46<application>X</application></title>
47
48<para><application>TrueType</application> font support is built into
49<application>X</application>. The following items need to
50be completed to make the fonts available.</para>
51
52<itemizedlist>
53
54<listitem><para>Establish a directory for the fonts and move any
55<application>TrueType</application> fonts you want into that directory.</para></listitem>
56
57<listitem><para>Download the fonts.</para></listitem>
58
59<listitem><para>Create the <filename>fonts.scale</filename> and
60<filename>fonts.dir</filename> files in the
61<application>TrueType</application> font
62directory.</para></listitem>
63
64<listitem><para>Ensure the <application>TrueType</application> module is loaded in the
65<filename>XF86Config</filename> or <filename>xorg.conf</filename>.</para></listitem>
66
67<listitem><para>Ensure the <parameter>FontPath</parameter> in
68<filename>XF86Config</filename> or <filename>xorg.conf</filename> contains the
69<application>TrueType</application> font directory.</para></listitem>
70
71<listitem><para>Update the font cache files</para></listitem>
72
73</itemizedlist>
74
75<sect3><title>Establish a <application>TrueType</application> font directory</title>
76
77<para>The build of <application>X</application> as given above
78automatically creates a <application>TrueType</application>
79font directory: <filename class="directory">/usr/X11R6/lib/X11/fonts/TTF</filename>. This
80directory already has some <application>TrueType</application> fonts and is set up correctly.
81If this directory is satisfactory, copy any other
82<application>TrueType</application> fonts you want
83into that directory. If not, create a new directory, preferably in
84the <filename class="directory">/usr/X11R6/lib/X11/fonts/</filename> directory and put
85your <application>TrueType</application> fonts there.</para></sect3>
86
87<sect3><title>Download the fonts</title>
88
89<para>There are two known high quality free font resources:
90<ulink url="ftp://ftp.gnu.org/savannah/files/freefont/"/> and <ulink
91url="http://corefonts.sourceforge.net/"/>. Copy the fonts (files with
92the <filename>.ttf</filename> suffix) to the directory you've just
93created.</para>
94
95</sect3>
96
97<sect3><title>Create <filename>fonts.scale</filename> and
98<filename>fonts.dir</filename></title>
99
100<para>Now change to the directory where you have your
101<application>TrueType</application> fonts and run:
102<screen><userinput><command>mkfontscale &amp;&amp;
103mkfontdir</command></userinput></screen></para></sect3>
104
105<sect3><title>Ensure <application>TrueType</application> is loaded in
106<filename>XF86Config</filename> or <filename>xorg.conf</filename></title>
107<para>The "Module" section should look like:
108<screen>Section "Module"
109 ...
110 Load "freetype"
111 ...
112EndSection</screen></para></sect3>
113
114<sect3><title>Ensure the <parameter>FontPath</parameter> in
115<filename>XF86Config</filename> or <filename>xorg.conf</filename> points to the
116<application>TrueType</application> font directory</title>
117<para>The "Files" section should look like:
118<screen>Section "Files"
119 ...
120 FontPath "/usr/X11R6/lib/X11/fonts/<replaceable>[TrueTypeDir]</replaceable>/"
121 ...
122EndSection</screen></para>
123</sect3>
124
125<sect3><title>Update the font cache files</title>
126
127<para>Ensure you have the following directory entries in
128<filename>/etc/fonts/local.conf</filename>, inside the fontconfig
129tags:</para>
130
131<screen><userinput><command>sed -i -e '/^&lt;\/fontconfig&gt;/i\
132&lt;dir&gt;/usr/X11R6/lib/X11/fonts/TTF&lt;/dir&gt;\
133&lt;dir&gt;/usr/X11R6/lib/X11/fonts/Type1&lt;/dir&gt;' /etc/fonts/local.conf</command></userinput></screen>
134
135<para>The <command>fc-cache</command> program will automatically search
136the above directories and all subdirectories for needed fonts.</para>
137
138<para>Finally, to update all the font
139cache files, run</para>
140<screen><userinput><command>fc-cache</command></userinput></screen>
141
142<para><application>X</application> will now be able to use
143<application>TrueType</application> fonts when it is restarted.
144You can check to see if the new fonts are available with the
145<command>xlsfonts</command> or <command>xfontsel</command>
146program.</para>
147
148<note><para>You should rerun <command>mkfontscale</command> and
149<command>mkfontdir</command> any time you add or delete
150<application>TrueType</application> fonts.
151You should also rerun <command>fc-cache</command> each time
152you add or remove any fonts.</para></note>
153
154</sect3>
155</sect2>
156
157<!-- ================================================== -->
158<sect2>
159<title>Setting up keyboards</title>
160<para>In this version of <application>X</application>, non-Latin
161keyboard layouts do not include Latin configurations as was previous
162practice. To set up a keyboard for Latin and non-Latin input,
163change the XkbLayout keyboard driver option in the InputDevice section
164of the <filename>XF86Config</filename> or <filename>xorg.conf</filename> file. For example:</para>
165
166<screen> Section "InputDevice"
167 Identifier "Keyboard0"
168 Driver "Keyboard"
169 Option "XkbModel" "pc105"
170 Option "XkbLayout" "en_US,ru"
171 Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"
172 EndSection</screen>
173
174<para>In this example, you can use the Alt-Shift combination to switch
175between keyboard layouts and use the Scroll Lock <acronym>LED</acronym> to indicate when
176the second layout is active.</para>
177</sect2>
178
179<!-- ================================================== -->
180<sect2>
181<title>Setting up fonts</title>
182
183<para>Users using character sets other than <acronym>ISO</acronym>-8859-1 have to
184make a few adjustments to their font settings in order to
185make sure that fonts with
186the correct encoding are used for "fixed", "variable", "10x20" and
187similar aliases:</para>
188
189<para>For Cyrillic alphabet, it is sufficient to put the following line
190into the top of the "Files" section in <filename>XF86Config</filename>
191or <filename>xorg.conf</filename>
192because this directory already contains the needed bitmap fonts and
193their aliases:</para>
194
195<screen>FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/"</screen>
196
197<para>For ISO-8859-<replaceable>[X]</replaceable> based locales, use the
198following command instead:</para>
199
200<screen><userinput><command>sed -i 's,iso8859-1\( \|$\),iso8859-<replaceable>[X]</replaceable>\1,g' \
201 /usr/X11R6/lib/X11/fonts/{75dpi,100dpi,misc}/fonts.alias</command></userinput></screen>
202
203</sect2>
204
205<!-- ================================================== -->
206<sect2>
207<title>Setting up XDM</title>
208<para><command>xdm</command> provides a graphical logon capability and is
209normally set up in <filename>/etc/inittab</filename>. Most of the information
210you need to customize <command>xdm</command> is found in its man page. To
211execute <command>xdm</command> during bootup, change the initdefault level to 5
212and add the following lines to <filename>/etc/inittab</filename>:</para>
213
214<para><screen><userinput># Run xdm as a separate service
215x:5:respawn:/usr/X11R6/bin/xdm -nodaemon</userinput></screen></para>
216
217<para>If Linux-PAM is installed on your system, you should
218create a PAM entry for xdm by duplicating the login entry
219using the following command:</para>
220
221<para><screen><userinput>cp /etc/pam.d/login /etc/pam.d/xdm</userinput></screen></para>
222
223</sect2>
224
225<!-- ================================================== -->
226<sect2>
227<title>Using <application>X</application> Resources</title>
228<para>There are many options that can be set in
229<application>X</application> and <application>X</application> clients via
230resources. Typically resources are set in the <filename>~/.Xresources</filename>
231file.</para>
232
233<para>The layout of the <filename>~/.Xresources</filename> file consists
234of a list of specifications in the form of</para>
235
236<screen>object.subobject[.subobject...].attribute: value</screen>
237
238<para>Components of a resource specification are linked together
239by either <emphasis>tight</emphasis>, represented by a dot (.),
240or <emphasis>loose</emphasis>, represented by an asterisk (*), bindings.
241A tight binding indicates that the components on either side of the dot must
242be directly next to each other as defined in a specific implementation. An
243asterisk is a wildcard character that means that any number of levels in
244a defined hierarchy can be between the components.
245For example, X offers two special cursors: redglass and whiteglass. To
246use one of these resources, you need to add the following line:</para>
247
248<screen>Xcursor.theme: whiteglass</screen>
249
250<para>However, you can specify the background for all clients with:</para>
251
252<screen>*background: blue</screen>
253
254<para>More specific resource variables will override less specific names. </para>
255
256<para>Resource definitions can be found in the man pages for each
257respective client.</para>
258
259<para>In order to load your resources, the <command>xrdb</command>
260program must be
261called with the appropriate parameters. Typically, the first time
262resources are loaded, you use:</para>
263
264<screen><userinput><command>xrdb -load &lt;filename&gt;</command></userinput></screen>
265
266<para>To add resources to <application>X</application>'s database in memory, use:</para>
267<screen><userinput><command>xrdb -merge &lt;filename&gt;</command></userinput></screen>
268
269<para>The <command>xrdb</command> instruction is usually placed in
270<filename>~/.xinitrc</filename> or <filename>~/.xsession</filename>.
271To get more information, see the xrdb man page.</para>
272</sect2>
273
274</sect1>
275
Note: See TracBrowser for help on using the repository browser.