[BACK]Return to index.html CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / htdocs / docs / x

File: [cvs.NetBSD.org] / htdocs / docs / x / index.html (download) (as text)

Revision 1.14, Wed Jan 13 08:24:03 2010 UTC (14 years, 2 months ago) by tonnerre
Branch: MAIN
Changes since 1.13: +1 -1 lines

2010 update to make all the diffs go away.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="generator" content="Website XSL Stylesheet V2.6.0">
<link rel="home" href="../../." title="Welcome to The NetBSD Project: Of course it runs NetBSD.">
<link rel="up" href="../../docs/." title="NetBSD Documentation">
<link rel="previous" href="../../docs/vmware.html" title="NetBSD Documentation: Running VMWare on NetBSD">
<link rel="next" href="../../donations/." title="Donations to The NetBSD Foundation">
<link rel="first" href="../../docs/Hardware/." title="Hardware Documentation">
<link rel="stylesheet" href="../../global.css" type="text/css">
    

    <title>NetBSD Documentation: The X Window System</title>
  </head>
<body class="website"><div class="webpage">
<a name="docs-x-index"></a><div id="top"><a href="#mainContent" class="doNotDisplay doNotPrint">Skip to main content.</a></div>
<div id="header">
<div class="topNavigation">
<span>» </span><a href="../../docs/guide/en/">
	  The Guide</a> |
	<a href="http://man.NetBSD.org/">Manual pages</a> |
	<a href="../../mailinglists/">
	  Mailing lists</a> and
	<a href="http://mail-index.NetBSD.org/">Archives</a> |
	<a href="http://cvsweb.NetBSD.org/">CVS repository</a> |
	<a href="http://www.NetBSD.org/cgi-bin/sendpr.cgi?gndb=netbsd">Report</a>
	or 
	<a href="../../support/query-pr.html">
	  query</a> a bug |
	<a href="../../docs/software/packages.html">
	  Software Packages
	</a>
</div>
<div class="centralHeader">
<a href="../../"><img alt="[NetBSD Logo]" width="506" height="90" src="../../images/NetBSD-headerlogo.png"></a><div class="headerTools"><div id="headerSearch"><form method="get" action="http://www.google.com/custom">
<input class="whiteOnBlack" type="text" name="q" onfocus="if(this.value==this.defaultValue ) this.value='';" size="12" maxlength="255" value="Search"><input type="hidden" name="cof" value="L:http://www.NetBSD.org/images/NetBSD-smaller.png;LH:200;LW:200;AH:center;AWFID:4f6b0499f0f58d2c;"><input type="hidden" name="domains" value="NetBSD.org"><input type="hidden" name="sitesearch" value="www.NetBSD.org"><input type="submit" value="Search">
</form></div></div>
</div>
<div class="navBar">
<span class="doNotDisplay">
	  Navigation:
	</span><a href="../../">
	  Home</a> ü	<a href="../../about/">
	  About</a> ü	<a href="../../gallery/">
	  Gallery</a> ü	<a href="../../releases/">
	  Download</a> ü	<a href="../../docs/">
	  Documentation</a> ü	<a href="../../support/">
	  Support</a> ü	<a href="../../community/">
	  Community</a> ü	<a href="../../ports/">
	  Ports</a>
</div>
</div>
<div id="content"><div class="fullWidth"><div class="rowOfBoxes">
<h1>NetBSD Documentation: The X Window System</h1>
<h3 class="title"><a name="running-x">Running X</a></h3>
<ul>
<li><a href="#wsmouse">How to get the mouse working with XFree?</a></li>
<li><a href="#x-keyboard-maps">Changing the keyboard mapping from 'US' under X</a></li>
<li><a href="#x-keyboard-nocaps">How do I make the Caps key another Control key</a></li>
<li><a href="#xf86_corrupts_on_rage_128">XF86_SVGA corrupts glyphs on Rage 128 if accelerated</a></li>
<li><a href="#slow_when_compiling">X is very slow when compiling under NetBSD 1.3.x</a></li>
<li><a href="#bypassing_xdm">How to bypass xdm</a></li>
<li><a href="#startx_not_found">When I type 'startx' I get the message: startx: Command not found. What's wrong?</a></li>
<li><a href="#xinit_not_found">Unable to run X - 'xinit: not found'</a></li>
<li><a href="#startx_fails">startx fails -'X connection to: 0.0 broken'</a></li>
<li><a href="#xconsole">Console output (such as from 'su') garbles X display.</a></li>
<li><a href="#wheel-mouse">How do I get my mouse wheel to work?</a></li>
<li><a href="#xfree86-docs">XFree86 Documentation</a></li>
<li><a href="#which_version">Which version of XFree86 am I running?</a></li>
<li><a href="#anti_aliased">How to setup anti-aliased fonts on NetBSD for X11</a></li>
<li><a href="#fc-cache">Xft using applications eat CPU cycles, but don't appear
	to do anything!</a></li>
<li><a href="#font-error">'No fonts found' - what does this mean?</a></li>
<li><a href="#x_wm">How do I change the default window manager?</a></li>
</ul>
<h3 class="title"><a name="compiling-programs">Compiling programs</a></h3>
<ul>
<li><a href="#compile_fails_xm">Compile fails - 'unable to locate libXm'</a></li>
<li><a href="#compile_fails_xpm">Compile fails - 'unable to locate xpm.h', or '-lXpm: no match'</a></li>
<li><a href="#compile_basic">Compile fails to link: Undefined symbol '_XOpenDisplay'</a></li>
</ul>
<hr>
<h3 class="title">Running X</h3>
	<h4 class="title">
<a name="wsmouse"></a>How to get the mouse working with XFree? (<a href="#running-x">top</a>)
  </h4>

	<p>Assuming you're using the default wscons console driver,
	  make sure you adjust the mouse protocol and device properly
	  in the XF86Config file's "Pointer" section:</p>

	  <pre class="programlisting">Section "Pointer"
   ###Protocol       "PS/2"                    # Linux
   ###Device         "/dev/mouse"              # Linux
   ##Protocol        "busmouse"                # NetBSD 1.4.x
   ##Device          "/dev/pms0"               # NetBSD 1.4.x
   Protocol          "wsmouse"                 # NetBSD 1.5 or later
   Device            "/dev/wsmouse"            # NetBSD 1.5 or later
EndSection</pre>

	<p>If you don't use wscons (as is the default on 1.4.x
	  systems), use <code class="filename">/dev/pms0</code>
	  and the "busmouse" protocol for a PS/2 mouse.</p>

	<p>Protocol "PS/2" is still supported for older kernels,
	  you'll have to use Device "<code class="filename">/dev/pms0</code>"
	  with the opms mouse driver in the kernel for that,
	  though. Useful for X-Servers that don't support the wscons
	  protocol (like XFree V4 or Linux/FreeBSD X server
	  binaries).</p>
      
	<h4 class="title">
<a name="x-keyboard-maps"></a>Changing the keyboard mapping from 'US' under X (<a href="#running-x">top</a>)
  </h4>

	<p>XFree 3.x maps the keyboard with an english map per
	  default. To change this to e.g. german, make sure the
	  following is in your XF86Config file:</p>

	<pre class="programlisting">#       XkbDisable
#       XkbKeymap   "xfree86(us)"

        XkbModel        "pc102"
        XkbLayout       "de" XkbVariant      "nodeadkeys"</pre>

	<p>To get e.g. a german keyboard in XFree 4.x, put the
	  following into your XF86Config's "InputDevices"
	  section:</p>

	<pre class="programlisting">Options		"XkbLayout"	"de"</pre>

	<p>Configuring the keyboard for the console under wscons is
	  described <a class="ulink" href="../guide/en/chap-cons.html#chap-cons-wscons-wskbd-keymaps" target="_top">elsewhere</a>.</p>
      
	<h4 class="title">
<a name="x-keyboard-nocaps"></a>How do I make the Caps key another Control key (<a href="#running-x">top</a>)
  </h4>

	<p>For XFree 3.x (as shipped with NetBSD 1.l5), add
	  &#8220;<span class="quote"><code class="code">XkbOptions "ctrl:nocaps"</code></span>&#8221; if you
	  want the caps-lock key become a second control-key. If you
	  want to use the "Windows" keys on your keyboard, you can get
	  some useful keysyms for them by using 
	  &#8220;<span class="quote"><code class="code">XkbModel "pc105"</code></span>&#8221; instead.</p>

	<p>XFree 4.x uses a different config file format. For it,
	  put
	  </p>
<pre class="programlisting">Option "XkbOptions" "ctrl:nocaps"</pre>
<p>
	  into the "InputDevice" section of your XF86Config file.</p>
      
	<h4 class="title">
<a name="xf86_corrupts_on_rage_128"></a>XF86_SVGA corrupts glyphs on Rage 128 if accelerated (<a href="#running-x">top</a>)
  </h4>

	<p>To fix this make sure you have xsrc of at least
	  2000-01-13 (otherwise you will have to also apply the patch in PR
	  <a href="http://www.NetBSD.org/cgi-bin/query-pr-single.pl?number=9171" class="gnatspr">misc/9171</a>).
	  Then use </p>
<pre class="programlisting">Option "xaa_no_color_exp"</pre>
<p>
	  in the Device section of your
	  <code class="filename">XF86Config</code>.</p>
      
	<h4 class="title">
<a name="slow_when_compiling"></a>X is very slow when compiling under NetBSD 1.3.x (<a href="#running-x">top</a>)
  </h4>

	<p>A <a class="ulink" href="ftp://ftp.NetBSD.org/pub/NetBSD/misc/patches/1.3schedpatch" target="_top">patch</a>
	  for the NetBSD 1.3 series is available which will
	  significantly improve the interactive performance under X
	  while compiling or performing other tasks.</p>
      
	<h4 class="title">
<a name="bypassing_xdm"></a>How to bypass xdm (<a href="#running-x">top</a>)
  </h4>

	<p>If <a href="http://netbsd.gw.com/cgi-bin/man-cgi?xdm+1+NetBSD-current">xdm(1)</a> is enabled but you are unable to login
	  for some reason, possibly because there is no root password,
	  and you do not have virtual consoles enabled (or they are
	  not yet supported on your port), you can either press ^C at
	  the immediately after the boot messages indicate xdm is
	  starting, or:</p>

	  <div class="itemizedlist"><ul type="disc">
<li>Boot to single user mode - Usually this is
	      accomplished by passing '-s' at the end of the boot
	      command.</li>
<li>Start the shell - Press <code class="code">ENTER</code> when
	      prompted for the shell.</li>
<li>Check and mount the disks using <a href="http://netbsd.gw.com/cgi-bin/man-cgi?fsck+8+NetBSD-current">fsck(8)</a> and
	      <a href="http://netbsd.gw.com/cgi-bin/man-cgi?mount+8+NetBSD-current">mount(8)</a> - <code class="code">fsck -p ; mount -vat ffs</code>
</li>
<li>Set term terminal type -
	      <code class="code">TERM=<span class="emphasis"><em>vt100</em></span> ; export TERM</code>
	      Note: you may need to use a different terminal type such
	      as 'pc3' or 'sun'.</li>
<li>Fix problem - Edit
	      <code class="filename">/etc/rc.conf</code> to disable xdm, run
	      <a href="http://netbsd.gw.com/cgi-bin/man-cgi?passwd+1+NetBSD-current">passwd(1)</a> to set root's password, or take whatever
	      other corrective action is needed</li>
</ul></div>
      
	<h4 class="title">
<a name="startx_not_found"></a>When I type '<span class="bold"><strong><code class="code">startx</code></strong></span>' I get the message: <code class="code">startx: Command not found.</code> What's wrong? (<a href="#running-x">top</a>)
  </h4>
	<p>You need to add the location of the X binaries to your
	  shell's <code class="code">path</code> variable. For <a href="http://netbsd.gw.com/cgi-bin/man-cgi?csh+1+NetBSD-current">csh(1)</a> and its
	  derivatives, add <code class="filename">/usr/X11R6/bin</code>
	  to the line in your <code class="filename">.cshrc</code> file which
	  sets the <code class="code">path</code> variable. For <code class="code">sh</code> and
	  its derivatives, you'll need to modify you
	  <code class="filename">.profile</code> instead.</p>
      
	<h4 class="title">
<a name="xinit_not_found"></a>Unable to run X - '<span class="bold"><strong>xinit: not found</strong></span>' (<a href="#running-x">top</a>)
  </h4>

	<p>You need <code class="filename">/usr/X11R6/bin</code> in your
	  path. As root add '<span class="bold"><strong><code class="code">set path = ( $path /usr/X11R6/bin )</code></strong></span>'
	  to <code class="filename">/etc/csh.cshrc</code>, and start a new
	  shell.</p>
      
	<h4 class="title">
<a name="startx_fails"></a>startx fails -'<span class="bold"><strong>X connection to: 0.0 broken</strong></span>' (<a href="#running-x">top</a>)
  </h4>

	<p>To see the error messages in this case, run:

	  </p>
<div class="itemizedlist"><ul type="disc">
<li>If your shell is <a href="http://netbsd.gw.com/cgi-bin/man-cgi?csh+1+NetBSD-current">csh(1)</a> or 
	      <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/shells/tcsh/README.html" target="_top"><code class="filename">shells/tcsh</code></a>:
	      <pre class="programlisting">startx &gt;&amp; ~/x.log</pre>
</li>
<li>If your shell is <a href="http://netbsd.gw.com/cgi-bin/man-cgi?sh+1+NetBSD-current">sh(1)</a>, <a href="http://netbsd.gw.com/cgi-bin/man-cgi?ksh+1+NetBSD-current">ksh(1)</a>, or similar:
	      <pre class="programlisting">startx &gt; ~/x.log 2&gt;&amp;1</pre>
</li>
</ul></div>
<p>
	  Then view <code class="filename">~/x.log</code></p>
      
	<h4 class="title">
<a name="xconsole"></a>Console output (such as from 'su') garbles X display. (<a href="#running-x">top</a>)
  </h4>

	<p>The system is outputting a line to the console
	  indicating something has happened (such as 'su'). You should
	  really run <a href="http://netbsd.gw.com/cgi-bin/man-cgi?xconsole+1+NetBSD-current">xconsole(1)</a> or one 'xterm -C' to capture
	  this console output.</p>

	<p>You may need to ensure your kernel is compiled with the
	  following enabled:
	  </p>
<pre class="programlisting">options  UCONSOLE  # allow anyone to steal the virtual console</pre>
<p>
	  See <a class="ulink" href="../kernel/#how_to_build_a_kernel" target="_top">How to build a kernel</a>
	  for details on how to build your own kernels.</p>

	<p>If you're logged in as root, and get annoying
	  <code class="code">portmap</code> notices, you may wish to look at the
	  <a class="ulink" href="../misc/#portmap-messup" target="_top">FAQ entry</a>
	  on how to turn those messages off.</p>
      
	<h4 class="title">
<a name="wheel-mouse"></a>How do I get my mouse wheel to work? (<a href="#running-x">top</a>)
  </h4>

	<p>If you use a Microsoft IntelliMouse, Logitech Wheel
	  Mouse (cordless our not) or something similar that has a
	  scroll wheel, and you want to use the wheel under NetBSD,
	  first make a kernel that includes the "pmsi" driver, and
	  make sure "wsmouse" uses it. Something like this should
	  occur in your <a href="http://netbsd.gw.com/cgi-bin/man-cgi?dmesg+8+NetBSD-current">dmesg(8)</a> output:

	  </p>
<pre class="programlisting">pmsi0 at pckbc0 (aux slot)
wsmouse0 at pmsi0</pre>
<p>
	  If you are running XFree86 3.x (as shipped with NetBSD 1.5.2
	  and earlier), ensure your <code class="filename">/etc/XF86Config</code>
	  contains:
	  </p>
<pre class="programlisting">Section "Pointer"
    Protocol    "wsmouse"
    Device      "/dev/wsmouse"
    ZAxisMapping 4 5
EndSection</pre>
<p>
	  If you are running XFree86 4.x, ensure your
	  <code class="filename">/etc/X11/XF86Config</code> contains:
	  </p>
<pre class="programlisting">Section "InputDevice"
    Identifier  "Mouse0"
    Driver      "mouse"
    Option      "Protocol"      "wsmouse"
    Option      "Device"        "/dev/wsmouse"
    Option      "Buttons"       "5"
    Option      "ZAxisMapping"  "4 5"
EndSection</pre>
<p>
	  That's enough to make xterms scroll. For other apps, you'll
	  need to edit your <code class="filename">~/.Xdefaults</code>. See 
	  <a class="ulink" href="http://koala.ilog.fr/colas/mouse-wheel-scroll/" target="_top">Colas Nahaboo X mouse wheel scroll page</a>
	  for details on a lot of applications that can be made
	  working.</p>

      
	<h4 class="title">
<a name="xfree86-docs"></a><a class="ulink" href="http://www.xfree86.org/sos/resources.html" target="_top">XFree86 Documentation</a> (<a href="#running-x">top</a>)
  </h4>
      
	<h4 class="title">
<a name="which_version"></a>Which version of XFree86 am I running? (<a href="#running-x">top</a>)
  </h4>

	<p>To quickly tell which version of the X server you are
	  running, you can use <a href="http://netbsd.gw.com/cgi-bin/man-cgi?xdpyinfo+1+NetBSD-current">xdpyinfo(1)</a>. E.g.:
	  </p>
<pre class="programlisting">$ xdpyinfo | grep release
vendor release number:    335</pre>
<p>

	  In the case of XFree86, this tells us that the server
	  version is 3.3.5.</p>
      
<h4 class="title">
<a name="anti_aliased"></a>How to setup anti-aliased fonts on NetBSD for X11 (<a href="#running-x">top</a>)
  </h4>

<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
The paths below should be adjusted appropriately if using 
<a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/xpkgwedge/README.html" target="_top"><code class="filename">pkgtools/xpkgwedge</code></a>.
</p>
</div>

<div class="orderedlist"><ol type="1">
<li>
<p>
Install the
<a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/ms-ttf/README.html" target="_top"><code class="filename">fonts/ms-ttf</code></a> package from pkgsrc.
If you use the pkgsrc version of X, install also the
<a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/mkfontscale/README.html" target="_top"><code class="filename">fonts/mkfontscale</code></a> and
<a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/fontconfig/README.html" target="_top"><code class="filename">fonts/fontconfig</code></a> packages.
</p>
</li>
<li>

<p>
If using the XFree86 shipped with NetBSD, you may consider
using <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/fontconfig/README.html" target="_top"><code class="filename">fonts/fontconfig</code></a> from pkgsrc
as it offers more tweaking options.  Set the variable <code class="varname">
 PREFER.fontconfig</code> to pkgsrc in the <code class="filename">/etc/mk.conf
</code> file to ensure that the pkgsrc version is used in
 favour of the shipped (or native) version:
  </p>
<pre class="programlisting">
  PREFER.fontconfig=pkgsrc
  </pre>
<p>
</p>

<p>
  You may also want to instruct fontconfig to never use
  <span class="emphasis"><em>bitmap fonts</em></span> again:
  </p>
<pre class="programlisting">
  # cd /usr/pkg/etc/fontconfig/conf.d
  # ln -s ../../../share/examples/fontconfig/conf.avail/70-no-bitmaps.conf .
  </pre>
<p>
</p>

<p>
You may wish to replace the native fontconfig libraries entirely,
which is useful should you have any previously-compiled binaries
that used it.
  </p>
<pre class="programlisting">
  # cd /usr/X11R6/lib
  # mv libfontconfig.so.1.0 libfontconfig.so.1.0.old
  # rm libfontconfig.so.1
  # ln -s ../../pkg/lib/libfontconfig.so.1 .
  # cd /usr/X11R6/bin
  # mv fc-cache fc-cache.old
  # mv fc-list fc-list.old
  </pre>
<p>
</p>

</li>
<li>
<p>
To configure fontconfig, add the following line to your
local.conf.  This file is generally found in
<code class="filename">/etc/fonts/local.conf</code>.
If you installed the fonts/fontconfig package, you will
<span class="bold"><strong>also</strong></span> need to add the line to
<code class="filename">/usr/pkg/etc/fonts/local.conf</code>
(or replace one with a symbolic link to another):
  </p>
<pre class="programlisting">
  &lt;dir&gt;/usr/pkg/lib/X11/fonts/TTF&lt;/dir&gt;
  </pre>
<p>
</p>

<p>
The <code class="filename">local.conf</code> file may look like this:
  </p>
<pre class="programlisting">
  &lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt;
  &lt;fontconfig&gt;
  &lt;dir&gt;/usr/pkg/lib/X11/fonts/TTF&lt;/dir&gt;
  &lt;/fontconfig&gt;
  </pre>
<p>
</p>

<p>
You can also add other directories containing fonts to the
<code class="filename">local.conf</code> file. The following lines are
for using teTeX-3.0 and ghostscript fonts:
  </p>
<pre class="programlisting">
  &lt;dir&gt;/usr/pkg/share/texmf-dist/fonts/&lt;/dir&gt;
  &lt;dir&gt;/usr/pkg/share/ghostscript/fonts&lt;/dir&gt;
  </pre>
<p>  
 </p>

</li>
<li>
<p>
  Rebuild the font cache for applications that use fontconfig
  </p>
<pre class="programlisting">
  # fc-cache -v
  </pre>
<p>
Depending on your hardware this may take a long time.
</p>
</li>
<li>
<p>
Run the following commands:
  </p>
<pre class="programlisting">
  # mkfontscale /usr/pkg/lib/X11/fonts/TTF
  # mkfontdir /usr/pkg/lib/X11/fonts/TTF
  </pre>
<p>
There should now be the files <code class="filename">fonts.dir</code> and
 <code class="filename">fonts.scale</code> in the TTF font directory.
</p>
</li>
<li>
<p>Configure the X server:
  </p>
<div class="itemizedlist"><ul type="disc">
<li>
  <p> In the &#8220;<span class="quote">Module</span>&#8221; section, make sure that the following exists:
  </p>
<pre class="programlisting">
  Load "type1"
  Load "freetype"
  </pre>
<p>
  </p>
  </li>
<li>
  <p>
  In the &#8220;<span class="quote">Files</span>&#8221; section, verify the order of
  the font paths. Verify that the TTF and Type1
  font paths are before the rest:
    </p>
<pre class="programlisting">
    FontPath   "/usr/X11R6/lib/X11/fonts/local/"
    FontPath   "/usr/pkg/lib/X11/fonts/TTF"
    FontPath   "/usr/X11R6/lib/X11/fonts/Type1/"
    FontPath   "/usr/X11R6/lib/X11/fonts/misc/"
    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/"
    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/"</pre>
<p>
  </p>

  <p>
  To apply the changes to the current X session, instead of
  restarting X, run the following command
    </p>
<pre class="programlisting">
    # xset fp rehash
    </pre>
<p>
    This will examine newly added font paths for changes.
  </p>

  <p>
  Instead of adding &#8220;<span class="quote">FontPath</span>&#8221; directives to the X configuration file,
  you can run the following commands from
  <code class="filename">~/.xinitrc</code>
  (or <code class="filename">~/.xsession</code>) file:
    </p>
<pre class="programlisting">
    xset +fp /usr/X11R6/lib/X11/fonts/Type1
    xset +fp /usr/pkg/lib/X11/fonts/TTF
    xset +fp /usr/X11R6/lib/X11/fonts/local
    </pre>
<p>
  </p>

  </li>
</ul></div>
<p>
</p>
</li>
<li>
<p>That's it! Run the following commands to test the configuration.
  </p>
<pre class="programlisting">
  $ xterm -ls -fg gray -bg black -ls -fa 'Courier New:bold' -fs 10
  </pre>
<p>
</p>

<p>
Run the command <strong class="userinput"><code>fc-list</code></strong> it should list
the fonts available, and shouldn't dump core!
</p>

<p>
While the xterm command from above only tests the fontconfig part, the following
command will test the XLFD-style access:
  </p>
<pre class="programlisting">
  $ xterm -fn '-monotype-Courier New-medium-r-normal--0-0-0-0-m-0-iso8859-1'
</pre>
<p>
</p>

<p>
Another test is that the following should show multiple fonts:
  </p>
<pre class="programlisting">
  $ xlsfonts | grep -i 'courier new'
  </pre>
<p>
</p>

</li>
<li>
<p>
  You can find other TTF font packages under pkgsrc/fonts.
  For example <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/vera-ttf/README.html" target="_top"><code class="filename">fonts/vera-ttf</code></a>
</p>
</li>
</ol></div>


	<h4 class="title">
<a name="fc-cache"></a>Xft using applications eat CPU cycles, but don't appear
	to do anything! (<a href="#running-x">top</a>)
  </h4>

	<p>It is possible that the application in question is
	  computing the font information that should have been
	  prepared by fc-cache - re-run '<code class="code">fc-cache -v</code>' to
	  make sure the information in the cache is up-to-date.</p>
      
	<h4 class="title">
<a name="font-error"></a>'No fonts found' - what does this mean? (<a href="#running-x">top</a>)
  </h4>

	<pre class="programlisting">No fonts found; this probably means that the fontconfig
library is not correctly configured. You may need to
edit the fonts.conf configuration file. More information
about fontconfig can be found in the <a href="http://netbsd.gw.com/cgi-bin/man-cgi?fontconfig+3+NetBSD-current">fontconfig(3)</a> manual
page and on <a class="ulink" href="http://fontconfig.org" target="_top">http://fontconfig.org</a></pre>

	<p>You haven't run '<code class="code">fc-cache -v</code>' like the
	  <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/fontconfig/README.html" target="_top"><code class="filename">fonts/fontconfig</code></a>
	  <a class="ulink" href="ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/fonts/fontconfig/MESSAGE" target="_top">MESSAGE</a>
	  suggests during installation. For details, see
	  '<code class="code">pkg_info -D fontconfig</code>' and <a class="ulink" href="#anti_aliased" target="_top">above</a>.</p>
      
	<h4 class="title">
<a name="x_wm"></a>How do I change the default window manager? (<a href="#running-x">top</a>)
  </h4>

	<p>First thing to do is to install the window manager you
	  prefer. You can find a lot of them, ready to install, in
	  pkgsrc's <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/wm/README.html" target="_top"><code class="filename">wm</code></a> category. After
	  a successful installation, figure out how is the
	  binary named. It will usually match package's name.</p>

	<p>Once you know how to execute the window manager, you
	  have to configure your X session to start it up. We will be
	  using twm in our examples (which comes with X), whose binary
	  is named <code class="code">twm</code>:</p>

	<div class="itemizedlist"><ul type="disc">
<li>If you are using <a href="http://netbsd.gw.com/cgi-bin/man-cgi?startx+1+NetBSD-current">startx(1)</a>, edit the
	    <code class="filename">~/.xinitrc</code> file and
	    append the following line to it:
	    <code class="code">exec twm</code>
</li>
<li>If you are using <a href="http://netbsd.gw.com/cgi-bin/man-cgi?xdm+1+NetBSD-current">xdm(1)</a>, edit the
	    <code class="filename">~/.xsession</code> file and append the 
	    following line to it:
	    <code class="code">exec twm</code>
</li>
</ul></div>

	<p>You can see that the content for each file is the same,
	  so you may want to create a link between them.</p>
      <hr>
<h3 class="title">Compiling programs</h3>
	<h4 class="title">
<a name="compile_fails_xm"></a>Compile fails - 'unable to locate libXm' (<a href="#compiling-programs">top</a>)
  </h4>

	<p>Xm does not come with the standard X11 environment. It is
	  part of <a class="ulink" href="http://www.opengroup.org/desktop/motif/" target="_top">Motif</a>,
	  which is a commercial graphical user interface.</p>

	<p>A freeware implementation of Motif called <a class="ulink" href="http://www.lesstif.org/" target="_top">Lesstif</a> is also available.
	  It is available as part of the <a class="ulink" href="../software/packages.html" target="_top">NetBSD packages collection</a>,
	  under <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/x11/lesstif/README.html" target="_top"><code class="filename">x11/lesstif</code></a>.</p>
      
	<h4 class="title">
<a name="compile_fails_xpm"></a>Compile fails - 'unable to locate xpm.h', or '-lXpm: no match' (<a href="#compiling-programs">top</a>)
  </h4>

	<p><code class="filename">xpm.h</code> is part of the X PixMap
	  library, used by many programs to allow more multi (than
	  two) colour icons.
	  It is available as part of the <a class="ulink" href="../software/packages.html" target="_top">NetBSD packages collection</a>,
	  under <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/graphics/xpm/README.html" target="_top"><code class="filename">graphics/xpm</code></a></p>
      
	<h4 class="title">
<a name="compile_basic"></a>Compile fails to link: Undefined symbol '_XOpenDisplay' (<a href="#compiling-programs">top</a>)
  </h4>

	<p>If it is a third party item of software, you should
	  check if a version is available via the <a class="ulink" href="../software/packages.html" target="_top">NetBSD packages collection</a>.
	  If you are writing you own code you need to ensure you link
	  against the necessary X libraries. In this case, add
	  <code class="code">-L/usr/X11R6 -lX11</code> to the end of your link 
	  line.</p>
      <hr>Back to em><a href="../">NetBSD Documentation</a></em>
</div></div></div>
<div class="navfoot"></div>
<div id="footer"><div id="footerContent"><center>
<span class="footfeed"><a href="http://www.NetBSD.org/cgi-bin/feedback.cgi">
	  Contact</a> |
      </span><span class="footcopy"><a href="../../about/disclaimer.html">
      Disclaimer</a> |

      <span class="copyright">Copyright 1994-2010 The NetBSD Foundation, Inc. </span>ALL RIGHTS RESERVED.<br>NetBSD<sup>/sup> is a registered trademark of The NetBSD
	Foundation, Inc.</span>
</center></div></div>
</div></body>
</html>