source: x/installing/x-setup.xml@ 9805d0f

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.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 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 9805d0f was 9805d0f, checked in by Andrew Benton <andy@…>, 18 years ago

Altered the default location where we install X windows fonts to /usr/share/fonts

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

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