2003-03-03 06:18:58 +08:00
<sect1 id= "x-setup" >
<?dbhtml filename="xfree86-setup.html" dir="x"?>
2003-10-02 23:28:50 +08:00
<title > XFree86 Components</title>
2003-03-03 06:18:58 +08:00
<sect2 >
2003-10-02 23:28:50 +08:00
<title > Checking Direct Rendering Infrastructure (<acronym > DRI</acronym> ) Installation</title>
<para > <acronym > DRI</acronym> is a framework for allowing software to access graphics hardware
in a safe and efficient manner. It is installed in
<application > XFree86</application> by default if
you have a supported video card. To check if <acronym > DRI</acronym> is installed properly,
2003-03-03 06:18:58 +08:00
check the log file <filename > /var/log/XFree86.0.log</filename> for statements
like:</para>
<para > <screen > (II) R128(0): Direct rendering enabled</screen> </para>
2003-10-02 23:28:50 +08:00
<para > From an <command > xterm</command> , run <command > glxinfo</command> and look for the phrase:</para>
<screen > direct rendering: Yes</screen>
2003-03-03 06:18:58 +08:00
2003-10-02 23:28:50 +08:00
<para > You can also run the test program <command > glxgears</command> .
2003-03-03 06:18:58 +08:00
This program brings up a window with three gears turning. The
2003-10-02 23:28:50 +08:00
<command > xterm</command> will display how many frames were drawn every
2003-03-03 06:18:58 +08:00
five seconds so this is a reasonable benchmark. The window is scalable, and
the frames drawn per second is highly dependent on the size of
the window.</para>
2003-10-02 23:28:50 +08:00
<para > For troubleshooting problems, check the <acronym > DRI</acronym> Users Guide at
2003-03-03 06:18:58 +08:00
<userinput > <ulink url= "http://dri.sourceforge.net/doc/DRIuserguide.html" /> </userinput> .
</para>
</sect2>
<!-- ================================================== -->
<sect2 >
2003-10-02 23:28:50 +08:00
<title > Adding <application > TrueType</application> fonts to
<application > XFree86</application> </title>
2003-03-03 06:18:58 +08:00
2003-10-02 23:28:50 +08:00
<para > <application > TrueType</application> font support is built into
<application > XFree86</application> . The following items need to
2003-03-03 06:18:58 +08:00
be completed to make the fonts available.</para>
<itemizedlist >
<listitem > <para > Establish a directory for the fonts and move any
2003-10-02 23:28:50 +08:00
<application > TrueType</application> fonts you want into that directory.</para> </listitem>
2003-03-03 06:18:58 +08:00
<listitem > <para > Create the <filename > fonts.scale</filename> and
2003-10-02 23:28:50 +08:00
<filename > fonts.dir</filename> files in the
<application > TrueType</application> font
2003-03-03 06:18:58 +08:00
directory.</para> </listitem>
2003-10-02 23:28:50 +08:00
<listitem > <para > Ensure the <application > TrueType</application> module is loaded in
2003-03-03 06:18:58 +08:00
<filename > XF86Config</filename> .</para> </listitem>
<listitem > <para > Ensure the <parameter > FontPath</parameter> in
2003-10-02 23:28:50 +08:00
<filename > XF86Config</filename> contains the
<application > TrueType</application> font
2003-03-03 06:18:58 +08:00
directory.</para> </listitem>
</itemizedlist>
2003-10-02 23:28:50 +08:00
<sect3 > <title > Establish a <application > TrueType</application> font directory</title>
2003-03-03 06:18:58 +08:00
2003-10-02 23:28:50 +08:00
<para > The build of <application > XFree86</application> as given above
automatically creates a <application > TrueType</application>
font directory: <filename class= "directory" > /usr/X11R6/lib/X11/fonts/TTF</filename> . This
directory already has some <application > TrueType</application> fonts and is set up correctly.
If this directory is satisfactory, copy any other
<application > TrueType</application> fonts you want
2003-03-03 06:18:58 +08:00
into that directory. If not, create a new directory, preferably in
2003-10-02 23:28:50 +08:00
the <filename class= "directory" > /usr/X11R6/lib/X11/fonts/</filename> directory and put
your <application > TrueType</application> fonts there.</para> </sect3>
2003-03-03 06:18:58 +08:00
<sect3 > <title > Create <filename > fonts.scale</filename> and
<filename > fonts.dir</filename> </title>
2003-10-02 23:28:50 +08:00
<para > Now change to the directory where you have your
<application > TrueType</application> fonts and run
<screen > <userinput > <command > mkfontscale & &
mkfontdir</command> </userinput> </screen> </para> </sect3>
2003-03-03 06:18:58 +08:00
2003-10-02 23:28:50 +08:00
<sect3 > <title > Ensure <application > TrueType</application> is loaded in <filename > XF86Config</filename> </title>
2003-03-03 06:18:58 +08:00
<para > The "Module" section should look like:
<screen > Section "Module"
...
Load "freetype"
...
EndSection</screen> </para> </sect3>
<sect3 > <title > Ensure the <parameter > FontPath</parameter> in
2003-10-02 23:28:50 +08:00
<filename > XF86Config</filename> points to the
<application > TrueType</application> font directory</title>
2003-03-03 06:18:58 +08:00
<para > The "Files" section should look like
<screen > Section "Files"
...
2003-10-04 00:43:11 +08:00
FontPath "/usr/X11R6/lib/X11/fonts/<replaceable > [TrueTypeDir]</replaceable> /"
2003-03-03 06:18:58 +08:00
...
EndSection</screen> </para>
2003-03-08 13:51:34 +08:00
</sect3>
<sect3 > <title > Update the font cache files</title>
<para > Finally, to update all the font
cache files specified in <filename > /etc/fonts/fonts.conf</filename> , run
2003-10-02 23:28:50 +08:00
<screen > <userinput > <command > fc-cache</command> </userinput> </screen>
2003-03-08 13:51:34 +08:00
</para>
2003-03-03 06:18:58 +08:00
2003-10-02 23:28:50 +08:00
<para > <application > XFree86</application> will now be able to use
<application > TrueType</application> fonts when it is restarted.
2003-03-03 06:18:58 +08:00
You can check to see if the new fonts are available with the
2003-10-02 23:28:50 +08:00
<command > xlsfonts</command> or <command > xfontsel</command>
2003-03-08 13:51:34 +08:00
program.</para>
2003-10-02 23:28:50 +08:00
<note > <para > You should re-run <command > mkfontscale</command> and
<command > mkfontdir</command> any time you add or delete
<application > TrueType</application> fonts.
You should also rerun <command > fc-cache</command> each time
2003-03-08 13:51:34 +08:00
you add or remove any fonts.</para> </note>
</sect3>
2003-03-03 06:18:58 +08:00
</sect2>
<!-- ================================================== -->
<sect2 >
<title > Setting up keyboards</title>
2003-10-04 00:43:11 +08:00
<para > In this version of <application > XFree86</application> , it has been reported that non-Latin
keyboard layouts do not include Latin configurations as was previous
practice. To set up a keyboard for Latin and non-Latin input,
2003-03-03 06:18:58 +08:00
change the XkbLayout keyboard driver option in the InputDevice section
of the <filename > XF86Config</filename> file. For example:</para>
<para > <screen > Section "InputDevice"
2003-03-05 10:37:52 +08:00
Identifier "Keyboard0"
Driver "Keyboard"
Option "XkbModel" "pc105"
Option "XkbLayout" "en_US,ru"
Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"
2003-03-03 06:18:58 +08:00
EndSection</screen> </para>
2003-03-05 10:37:52 +08:00
<para > In this example, you can use the Alt-Shift combination to switch
2003-10-02 23:28:50 +08:00
between keyboard layouts and use the Scroll Lock <acronym > LED</acronym> to indicate when
2003-03-05 10:37:52 +08:00
the second layout is active.</para>
2003-03-03 06:18:58 +08:00
</sect2>
<!-- ================================================== -->
<sect2 >
2003-10-03 04:01:04 +08:00
<title > Setting up XDM</title>
<para > <command > xdm</command> provides a graphical logon capability and is
2003-03-03 06:18:58 +08:00
normally set up in <filename > /etc/inittab</filename> . Most of the information
2003-10-03 04:01:04 +08:00
you need to customize <command > xdm</command> is found in its man page. To
2003-10-05 05:32:30 +08:00
execute <command > xdm</command> during bootup, change the initdefault level to 5 and add the following lines to <filename > /etc/inittab</filename> :</para>
2003-03-03 06:18:58 +08:00
2003-10-03 04:01:04 +08:00
<para > <screen > <userinput > # Run xdm as a separate service
x:5:respawn:/usr/X11R6/bin/xdm -nodaemon</userinput> </screen> </para>
2003-03-03 06:18:58 +08:00
</sect2>
<!-- ================================================== -->
<sect2 >
2003-10-03 04:01:04 +08:00
<title > Using <application > XFree86</application> Resources</title>
<para > There are many options that can be set in
<application > XFree86</application> and <application > X</application> clients via
2003-03-03 06:18:58 +08:00
resources. Typically resources are set in the <filename > ~/.Xresources</filename>
file.</para>
<para > The layout of the <filename > ~/.Xresources</filename> file consists
if a list of specifications in the form of</para>
<para > <screen > object.subobject[.subobject...].attribute: value</screen> </para>
<para > Typically, components of a resource specification are linked together
2003-04-08 08:53:28 +08:00
by either <emphasis > tight</emphasis> , represented by a dot (.),
2003-03-03 06:18:58 +08:00
or <emphasis > loose</emphasis> , represented by an asterisk (*), bindings.
A tight binding indicates that the components on either side of the dot must
be directly next to each other as defined in a specific implementation. An
asterisk is a wildcard character that means that any number of levels in
a defined hierarchy can be between the components.
For example, XFree86 offers two new cursors: redglass and whiteglass. To
use one of these resources, you need to add the following line:</para>
<para > <screen > Xcursor.theme: whiteglass</screen> </para>
2003-04-08 08:53:28 +08:00
<para > However, you can specify the background for all clients with:</para>
2003-03-03 06:18:58 +08:00
<para > <screen > *background: blue</screen> </para>
<para > More specific resource variables will override less specific names. </para>
<para > Resource definitions can be found in the man pages for each
respective client.</para>
2003-10-03 04:01:04 +08:00
<para > In order to load your resources, the <command > xrdb</command>
2003-03-03 06:18:58 +08:00
program must be
called with the appropriate parameters. Typically, the first time
resources are loaded, you use:</para>
2003-10-03 04:01:04 +08:00
<screen > <userinput > <command > xrdb -load < filename> </command> </userinput> </screen>
2003-03-03 06:18:58 +08:00
2003-10-03 04:01:04 +08:00
<para > To add resources to <application > XFree86</application> 's database in memory use:</para>
<screen > <userinput > <command > xrdb -merge < filename> </command> </userinput> </screen>
2003-03-03 06:18:58 +08:00
2003-10-03 04:01:04 +08:00
<para > The <command > xrdb</command> instruction is usually placed in
2003-03-03 06:18:58 +08:00
<filename > ~/.xinitrc</filename> or <filename > ~/.xsession</filename> .
2003-10-03 04:01:04 +08:00
To get more information, see the xrdb man page.</para>
2003-03-03 06:18:58 +08:00
</sect2>
</sect1>