source: x/installing/x-setup.xml@ df4e00d

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.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 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 df4e00d was 646d9189, checked in by Igor Živković <igor@…>, 20 years ago

moved fontconfig x directories setup to x-setup page

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

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