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

Annotation of htdocs/docs/x/index.html, Revision 1.17

1.1       dsieger     1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
                      2: <html>
                      3: <head>
                      4: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
                      5: <meta name="generator" content="Website XSL Stylesheet V2.6.0">
                      6: <link rel="home" href="../../." title="Welcome to The NetBSD Project: Of course it runs NetBSD.">
                      7: <link rel="up" href="../../docs/." title="NetBSD Documentation">
                      8: <link rel="previous" href="../../docs/vmware.html" title="NetBSD Documentation: Running VMWare on NetBSD">
                      9: <link rel="next" href="../../donations/." title="Donations to The NetBSD Foundation">
                     10: <link rel="first" href="../../docs/Hardware/." title="Hardware Documentation">
1.11      dsieger    11: <link rel="stylesheet" href="../../global.css" type="text/css">
1.1       dsieger    12:
                     13:
                     14:     <title>NetBSD Documentation: The X Window System</title>
                     15:   </head>
                     16: <body class="website"><div class="webpage">
1.3       dsieger    17: <a name="docs-x-index"></a><div id="top"><a href="#mainContent" class="doNotDisplay doNotPrint">Skip to main content.</a></div>
                     18: <div id="header">
                     19: <div class="topNavigation">
1.6       dsieger    20: <span>» </span><a href="../../docs/guide/en/">
                     21:          The Guide</a> |
1.3       dsieger    22:        <a href="http://man.NetBSD.org/">Manual pages</a> |
1.8       kano       23:        <a href="../../mailinglists/">
1.6       dsieger    24:          Mailing lists</a> and
1.3       dsieger    25:        <a href="http://mail-index.NetBSD.org/">Archives</a> |
                     26:        <a href="http://cvsweb.NetBSD.org/">CVS repository</a> |
1.6       dsieger    27:        <a href="http://www.NetBSD.org/cgi-bin/sendpr.cgi?gndb=netbsd">Report</a>
                     28:        or
1.9       kano       29:        <a href="../../support/query-pr.html">
                     30:          query</a> a bug |
1.6       dsieger    31:        <a href="../../docs/software/packages.html">
                     32:          Software Packages
                     33:        </a>
1.3       dsieger    34: </div>
                     35: <div class="centralHeader">
1.16      spz        36: <a href="../../"><img alt="[NetBSD Logo]" width="506" height="90" src="../../images/NetBSD-headerlogo.png"></a><div class="headerTools"><div id="headerSearch">
                     37: <div id="header-cse-search-form" style="width: 24%;">Google custom search</div>
                     38: <script src="http://www.google.com/jsapi" type="text/javascript"></script><script type="text/javascript">
                     39:                  google.load('search', '1', {language : 'en'});
                     40:                  google.setOnLoadCallback(function() {
                     41:                    var header_customSearchControl = new google.search.CustomSearchControl('006277936787196004968:mbdhrauy1wm');
                     42:                    header_customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
                     43:                    var header_options = new google.search.DrawOptions();
                     44:                    header_options.enableSearchboxOnly("http://google.com/cse?cx=006277936787196004968:mbdhrauy1wm");
                     45:                    header_customSearchControl.draw('header-cse-search-form', header_options);
                     46:                  }, true);
                     47:                </script><link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css">
                     48: </div></div>
1.3       dsieger    49: </div>
                     50: <div class="navBar">
1.6       dsieger    51: <span class="doNotDisplay">
                     52:          Navigation:
                     53:        </span><a href="../../">
                     54:          Home</a> | 
                     55:        <a href="../../about/">
                     56:          About</a> | 
1.12      hubertf    57:        <a href="../../gallery/">
                     58:          Gallery</a> | 
1.6       dsieger    59:        <a href="../../releases/">
                     60:          Download</a> | 
                     61:        <a href="../../docs/">
                     62:          Documentation</a> | 
                     63:        <a href="../../support/">
                     64:          Support</a> | 
                     65:        <a href="../../community/">
                     66:          Community</a> | 
                     67:        <a href="../../ports/">
                     68:          Ports</a>
1.3       dsieger    69: </div>
                     70: </div>
                     71: <div id="content"><div class="fullWidth"><div class="rowOfBoxes">
                     72: <h1>NetBSD Documentation: The X Window System</h1>
1.16      spz        73: <div class="sect1">
1.15      snj        74: <div class="titlepage"></div>
1.16      spz        75:     <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.15      snj        76: <h3 class="title">Note</h3>Please see the NetBSD Guide's
                     77:      <a class="ulink" href="../guide/en/chap-x.html" target="_top">chapter on X</a> for more
                     78:      information about X.</div>
                     79:   </div>
1.1       dsieger    80: <h3 class="title"><a name="running-x">Running X</a></h3>
                     81: <ul>
                     82: <li><a href="#x-keyboard-nocaps">How do I make the Caps key another Control key</a></li>
                     83: <li><a href="#bypassing_xdm">How to bypass xdm</a></li>
                     84: <li><a href="#startx_not_found">When I type 'startx' I get the message: startx: Command not found. What's wrong?</a></li>
                     85: <li><a href="#xinit_not_found">Unable to run X - 'xinit: not found'</a></li>
                     86: <li><a href="#startx_fails">startx fails -'X connection to: 0.0 broken'</a></li>
                     87: <li><a href="#xconsole">Console output (such as from 'su') garbles X display.</a></li>
                     88: <li><a href="#xfree86-docs">XFree86 Documentation</a></li>
                     89: <li><a href="#which_version">Which version of XFree86 am I running?</a></li>
                     90: <li><a href="#anti_aliased">How to setup anti-aliased fonts on NetBSD for X11</a></li>
                     91: <li><a href="#fc-cache">Xft using applications eat CPU cycles, but don't appear
                     92:        to do anything!</a></li>
                     93: <li><a href="#font-error">'No fonts found' - what does this mean?</a></li>
                     94: <li><a href="#x_wm">How do I change the default window manager?</a></li>
                     95: </ul>
                     96: <h3 class="title"><a name="compiling-programs">Compiling programs</a></h3>
                     97: <ul>
                     98: <li><a href="#compile_fails_xm">Compile fails - 'unable to locate libXm'</a></li>
                     99: <li><a href="#compile_fails_xpm">Compile fails - 'unable to locate xpm.h', or '-lXpm: no match'</a></li>
                    100: <li><a href="#compile_basic">Compile fails to link: Undefined symbol '_XOpenDisplay'</a></li>
                    101: </ul>
                    102: <hr>
                    103: <h3 class="title">Running X</h3>
                    104:        <h4 class="title">
                    105: <a name="x-keyboard-nocaps"></a>How do I make the Caps key another Control key (<a href="#running-x">top</a>)
                    106:   </h4>
                    107:
                    108:        <p>For XFree 3.x (as shipped with NetBSD 1.l5), add
1.16      spz       109:          <span class="quote">&#8220;<span class="quote"><code class="code">XkbOptions "ctrl:nocaps"</code></span>&#8221;</span> if you
1.1       dsieger   110:          want the caps-lock key become a second control-key. If you
                    111:          want to use the "Windows" keys on your keyboard, you can get
                    112:          some useful keysyms for them by using
1.16      spz       113:          <span class="quote">&#8220;<span class="quote"><code class="code">XkbModel "pc105"</code></span>&#8221;</span> instead.</p>
1.1       dsieger   114:
                    115:        <p>XFree 4.x uses a different config file format. For it,
                    116:          put
                    117:          </p>
                    118: <pre class="programlisting">Option "XkbOptions" "ctrl:nocaps"</pre>
                    119: <p>
                    120:          into the "InputDevice" section of your XF86Config file.</p>
                    121:
                    122:        <h4 class="title">
                    123: <a name="bypassing_xdm"></a>How to bypass xdm (<a href="#running-x">top</a>)
                    124:   </h4>
                    125:
1.16      spz       126:        <p>If <a href="http://netbsd.gw.com/cgi-bin/man-cgi?xdm+1+NetBSD-5.1+i386">xdm(1)</a> is enabled but you are unable to login
1.1       dsieger   127:          for some reason, possibly because there is no root password,
                    128:          and you do not have virtual consoles enabled (or they are
                    129:          not yet supported on your port), you can either press ^C at
                    130:          the immediately after the boot messages indicate xdm is
                    131:          starting, or:</p>
                    132:
1.16      spz       133:          <div class="itemizedlist"><ul class="itemizedlist" type="disc">
                    134: <li class="listitem">Boot to single user mode - Usually this is
1.1       dsieger   135:              accomplished by passing '-s' at the end of the boot
                    136:              command.</li>
1.16      spz       137: <li class="listitem">Start the shell - Press <code class="code">ENTER</code> when
1.1       dsieger   138:              prompted for the shell.</li>
1.16      spz       139: <li class="listitem">Check and mount the disks using <a href="http://netbsd.gw.com/cgi-bin/man-cgi?fsck+8+NetBSD-5.1+i386">fsck(8)</a> and
                    140:              <a href="http://netbsd.gw.com/cgi-bin/man-cgi?mount+8+NetBSD-5.1+i386">mount(8)</a> - <code class="code">fsck -p ; mount -vat ffs</code>
1.1       dsieger   141: </li>
1.16      spz       142: <li class="listitem">Set term terminal type -
1.1       dsieger   143:              <code class="code">TERM=<span class="emphasis"><em>vt100</em></span> ; export TERM</code>
                    144:              Note: you may need to use a different terminal type such
                    145:              as 'pc3' or 'sun'.</li>
1.16      spz       146: <li class="listitem">Fix problem - Edit
1.1       dsieger   147:              <code class="filename">/etc/rc.conf</code> to disable xdm, run
1.16      spz       148:              <a href="http://netbsd.gw.com/cgi-bin/man-cgi?passwd+1+NetBSD-5.1+i386">passwd(1)</a> to set root's password, or take whatever
1.1       dsieger   149:              other corrective action is needed</li>
                    150: </ul></div>
                    151:
                    152:        <h4 class="title">
                    153: <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>)
                    154:   </h4>
                    155:        <p>You need to add the location of the X binaries to your
1.16      spz       156:          shell's <code class="code">path</code> variable. For <a href="http://netbsd.gw.com/cgi-bin/man-cgi?csh+1+NetBSD-5.1+i386">csh(1)</a> and its
1.1       dsieger   157:          derivatives, add <code class="filename">/usr/X11R6/bin</code>
                    158:          to the line in your <code class="filename">.cshrc</code> file which
                    159:          sets the <code class="code">path</code> variable. For <code class="code">sh</code> and
                    160:          its derivatives, you'll need to modify you
                    161:          <code class="filename">.profile</code> instead.</p>
                    162:
                    163:        <h4 class="title">
                    164: <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>)
                    165:   </h4>
                    166:
                    167:        <p>You need <code class="filename">/usr/X11R6/bin</code> in your
                    168:          path. As root add '<span class="bold"><strong><code class="code">set path = ( $path /usr/X11R6/bin )</code></strong></span>'
                    169:          to <code class="filename">/etc/csh.cshrc</code>, and start a new
                    170:          shell.</p>
                    171:
                    172:        <h4 class="title">
                    173: <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>)
                    174:   </h4>
                    175:
                    176:        <p>To see the error messages in this case, run:
                    177:
                    178:          </p>
1.16      spz       179: <div class="itemizedlist"><ul class="itemizedlist" type="disc">
                    180: <li class="listitem">If your shell is <a href="http://netbsd.gw.com/cgi-bin/man-cgi?csh+1+NetBSD-5.1+i386">csh(1)</a> or
1.1       dsieger   181:              <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/shells/tcsh/README.html" target="_top"><code class="filename">shells/tcsh</code></a>:
                    182:              <pre class="programlisting">startx &gt;&amp; ~/x.log</pre>
                    183: </li>
1.16      spz       184: <li class="listitem">If your shell is <a href="http://netbsd.gw.com/cgi-bin/man-cgi?sh+1+NetBSD-5.1+i386">sh(1)</a>, <a href="http://netbsd.gw.com/cgi-bin/man-cgi?ksh+1+NetBSD-5.1+i386">ksh(1)</a>, or similar:
1.1       dsieger   185:              <pre class="programlisting">startx &gt; ~/x.log 2&gt;&amp;1</pre>
                    186: </li>
                    187: </ul></div>
                    188: <p>
                    189:          Then view <code class="filename">~/x.log</code></p>
                    190:
                    191:        <h4 class="title">
                    192: <a name="xconsole"></a>Console output (such as from 'su') garbles X display. (<a href="#running-x">top</a>)
                    193:   </h4>
                    194:
                    195:        <p>The system is outputting a line to the console
                    196:          indicating something has happened (such as 'su'). You should
1.16      spz       197:          really run <a href="http://netbsd.gw.com/cgi-bin/man-cgi?xconsole+1+NetBSD-5.1+i386">xconsole(1)</a> or one 'xterm -C' to capture
1.1       dsieger   198:          this console output.</p>
                    199:
                    200:        <p>You may need to ensure your kernel is compiled with the
                    201:          following enabled:
                    202:          </p>
                    203: <pre class="programlisting">options  UCONSOLE  # allow anyone to steal the virtual console</pre>
                    204: <p>
1.11      dsieger   205:          See <a class="ulink" href="../kernel/#how_to_build_a_kernel" target="_top">How to build a kernel</a>
1.1       dsieger   206:          for details on how to build your own kernels.</p>
                    207:
                    208:        <p>If you're logged in as root, and get annoying
                    209:          <code class="code">portmap</code> notices, you may wish to look at the
1.11      dsieger   210:          <a class="ulink" href="../misc/#portmap-messup" target="_top">FAQ entry</a>
1.1       dsieger   211:          on how to turn those messages off.</p>
                    212:
                    213:        <h4 class="title">
1.11      dsieger   214: <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>)
1.1       dsieger   215:   </h4>
                    216:
                    217:        <h4 class="title">
                    218: <a name="which_version"></a>Which version of XFree86 am I running? (<a href="#running-x">top</a>)
                    219:   </h4>
                    220:
                    221:        <p>To quickly tell which version of the X server you are
1.16      spz       222:          running, you can use <a href="http://netbsd.gw.com/cgi-bin/man-cgi?xdpyinfo+1+NetBSD-5.1+i386">xdpyinfo(1)</a>. E.g.:
1.1       dsieger   223:          </p>
                    224: <pre class="programlisting">$ xdpyinfo | grep release
                    225: vendor release number:    335</pre>
                    226: <p>
                    227:
                    228:          In the case of XFree86, this tells us that the server
                    229:          version is 3.3.5.</p>
                    230:
                    231: <h4 class="title">
                    232: <a name="anti_aliased"></a>How to setup anti-aliased fonts on NetBSD for X11 (<a href="#running-x">top</a>)
                    233:   </h4>
                    234:
1.16      spz       235: <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
1.1       dsieger   236: <h3 class="title">Note</h3>
                    237: <p>
                    238: The paths below should be adjusted appropriately if using
                    239: <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/xpkgwedge/README.html" target="_top"><code class="filename">pkgtools/xpkgwedge</code></a>.
                    240: </p>
                    241: </div>
                    242:
1.16      spz       243: <div class="orderedlist"><ol class="orderedlist" type="1">
                    244: <li class="listitem">
1.1       dsieger   245: <p>
                    246: Install the
                    247: <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.
                    248: If you use the pkgsrc version of X, install also the
                    249: <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/mkfontscale/README.html" target="_top"><code class="filename">fonts/mkfontscale</code></a> and
                    250: <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/fontconfig/README.html" target="_top"><code class="filename">fonts/fontconfig</code></a> packages.
                    251: </p>
                    252: </li>
1.16      spz       253: <li class="listitem">
1.1       dsieger   254:
                    255: <p>
                    256: If using the XFree86 shipped with NetBSD, you may consider
                    257: 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
                    258: as it offers more tweaking options.  Set the variable <code class="varname">
                    259:  PREFER.fontconfig</code> to pkgsrc in the <code class="filename">/etc/mk.conf
                    260: </code> file to ensure that the pkgsrc version is used in
                    261:  favour of the shipped (or native) version:
                    262:   </p>
                    263: <pre class="programlisting">
                    264:   PREFER.fontconfig=pkgsrc
                    265:   </pre>
                    266: <p>
                    267: </p>
                    268:
                    269: <p>
                    270:   You may also want to instruct fontconfig to never use
                    271:   <span class="emphasis"><em>bitmap fonts</em></span> again:
                    272:   </p>
                    273: <pre class="programlisting">
                    274:   # cd /usr/pkg/etc/fontconfig/conf.d
                    275:   # ln -s ../../../share/examples/fontconfig/conf.avail/70-no-bitmaps.conf .
                    276:   </pre>
                    277: <p>
                    278: </p>
                    279:
                    280: <p>
                    281: You may wish to replace the native fontconfig libraries entirely,
                    282: which is useful should you have any previously-compiled binaries
                    283: that used it.
                    284:   </p>
                    285: <pre class="programlisting">
                    286:   # cd /usr/X11R6/lib
                    287:   # mv libfontconfig.so.1.0 libfontconfig.so.1.0.old
                    288:   # rm libfontconfig.so.1
                    289:   # ln -s ../../pkg/lib/libfontconfig.so.1 .
                    290:   # cd /usr/X11R6/bin
                    291:   # mv fc-cache fc-cache.old
                    292:   # mv fc-list fc-list.old
                    293:   </pre>
                    294: <p>
                    295: </p>
                    296:
                    297: </li>
1.16      spz       298: <li class="listitem">
1.1       dsieger   299: <p>
                    300: To configure fontconfig, add the following line to your
                    301: local.conf.  This file is generally found in
                    302: <code class="filename">/etc/fonts/local.conf</code>.
                    303: If you installed the fonts/fontconfig package, you will
                    304: <span class="bold"><strong>also</strong></span> need to add the line to
                    305: <code class="filename">/usr/pkg/etc/fonts/local.conf</code>
                    306: (or replace one with a symbolic link to another):
                    307:   </p>
                    308: <pre class="programlisting">
                    309:   &lt;dir&gt;/usr/pkg/lib/X11/fonts/TTF&lt;/dir&gt;
                    310:   </pre>
                    311: <p>
                    312: </p>
                    313:
                    314: <p>
                    315: The <code class="filename">local.conf</code> file may look like this:
                    316:   </p>
                    317: <pre class="programlisting">
                    318:   &lt;?xml version="1.0"?&gt;
                    319:   &lt;!DOCTYPE fontconfig SYSTEM "fonts.dtd"&gt;
                    320:   &lt;fontconfig&gt;
                    321:   &lt;dir&gt;/usr/pkg/lib/X11/fonts/TTF&lt;/dir&gt;
                    322:   &lt;/fontconfig&gt;
                    323:   </pre>
                    324: <p>
                    325: </p>
                    326:
                    327: <p>
                    328: You can also add other directories containing fonts to the
                    329: <code class="filename">local.conf</code> file. The following lines are
                    330: for using teTeX-3.0 and ghostscript fonts:
                    331:   </p>
                    332: <pre class="programlisting">
                    333:   &lt;dir&gt;/usr/pkg/share/texmf-dist/fonts/&lt;/dir&gt;
                    334:   &lt;dir&gt;/usr/pkg/share/ghostscript/fonts&lt;/dir&gt;
                    335:   </pre>
                    336: <p>
                    337:  </p>
                    338:
                    339: </li>
1.16      spz       340: <li class="listitem">
1.1       dsieger   341: <p>
                    342:   Rebuild the font cache for applications that use fontconfig
                    343:   </p>
                    344: <pre class="programlisting">
                    345:   # fc-cache -v
                    346:   </pre>
                    347: <p>
                    348: Depending on your hardware this may take a long time.
                    349: </p>
                    350: </li>
1.16      spz       351: <li class="listitem">
1.1       dsieger   352: <p>
                    353: Run the following commands:
                    354:   </p>
                    355: <pre class="programlisting">
                    356:   # mkfontscale /usr/pkg/lib/X11/fonts/TTF
                    357:   # mkfontdir /usr/pkg/lib/X11/fonts/TTF
                    358:   </pre>
                    359: <p>
                    360: There should now be the files <code class="filename">fonts.dir</code> and
                    361:  <code class="filename">fonts.scale</code> in the TTF font directory.
                    362: </p>
                    363: </li>
1.16      spz       364: <li class="listitem">
1.1       dsieger   365: <p>Configure the X server:
                    366:   </p>
1.16      spz       367: <div class="itemizedlist"><ul class="itemizedlist" type="disc">
                    368: <li class="listitem">
                    369:   <p> In the <span class="quote">&#8220;<span class="quote">Module</span>&#8221;</span> section, make sure that the following exists:
1.1       dsieger   370:   </p>
                    371: <pre class="programlisting">
                    372:   Load "type1"
                    373:   Load "freetype"
                    374:   </pre>
                    375: <p>
                    376:   </p>
                    377:   </li>
1.16      spz       378: <li class="listitem">
1.1       dsieger   379:   <p>
1.16      spz       380:   In the <span class="quote">&#8220;<span class="quote">Files</span>&#8221;</span> section, verify the order of
1.1       dsieger   381:   the font paths. Verify that the TTF and Type1
                    382:   font paths are before the rest:
                    383:     </p>
                    384: <pre class="programlisting">
                    385:     FontPath   "/usr/X11R6/lib/X11/fonts/local/"
                    386:     FontPath   "/usr/pkg/lib/X11/fonts/TTF"
                    387:     FontPath   "/usr/X11R6/lib/X11/fonts/Type1/"
                    388:     FontPath   "/usr/X11R6/lib/X11/fonts/misc/"
                    389:     FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
                    390:     FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
                    391:     FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/"
                    392:     FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/"</pre>
                    393: <p>
                    394:   </p>
                    395:
                    396:   <p>
                    397:   To apply the changes to the current X session, instead of
                    398:   restarting X, run the following command
                    399:     </p>
                    400: <pre class="programlisting">
                    401:     # xset fp rehash
                    402:     </pre>
                    403: <p>
                    404:     This will examine newly added font paths for changes.
                    405:   </p>
                    406:
                    407:   <p>
1.16      spz       408:   Instead of adding <span class="quote">&#8220;<span class="quote">FontPath</span>&#8221;</span> directives to the X configuration file,
1.1       dsieger   409:   you can run the following commands from
                    410:   <code class="filename">~/.xinitrc</code>
                    411:   (or <code class="filename">~/.xsession</code>) file:
                    412:     </p>
                    413: <pre class="programlisting">
                    414:     xset +fp /usr/X11R6/lib/X11/fonts/Type1
                    415:     xset +fp /usr/pkg/lib/X11/fonts/TTF
                    416:     xset +fp /usr/X11R6/lib/X11/fonts/local
                    417:     </pre>
                    418: <p>
                    419:   </p>
                    420:
                    421:   </li>
                    422: </ul></div>
                    423: <p>
                    424: </p>
                    425: </li>
1.16      spz       426: <li class="listitem">
1.1       dsieger   427: <p>That's it! Run the following commands to test the configuration.
                    428:   </p>
                    429: <pre class="programlisting">
                    430:   $ xterm -ls -fg gray -bg black -ls -fa 'Courier New:bold' -fs 10
                    431:   </pre>
                    432: <p>
                    433: </p>
                    434:
                    435: <p>
                    436: Run the command <strong class="userinput"><code>fc-list</code></strong> it should list
                    437: the fonts available, and shouldn't dump core!
                    438: </p>
                    439:
                    440: <p>
                    441: While the xterm command from above only tests the fontconfig part, the following
                    442: command will test the XLFD-style access:
                    443:   </p>
                    444: <pre class="programlisting">
                    445:   $ xterm -fn '-monotype-Courier New-medium-r-normal--0-0-0-0-m-0-iso8859-1'
                    446: </pre>
                    447: <p>
                    448: </p>
                    449:
                    450: <p>
                    451: Another test is that the following should show multiple fonts:
                    452:   </p>
                    453: <pre class="programlisting">
                    454:   $ xlsfonts | grep -i 'courier new'
                    455:   </pre>
                    456: <p>
                    457: </p>
                    458:
                    459: </li>
1.16      spz       460: <li class="listitem">
1.1       dsieger   461: <p>
                    462:   You can find other TTF font packages under pkgsrc/fonts.
                    463:   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>
                    464: </p>
                    465: </li>
                    466: </ol></div>
                    467:
                    468:
                    469:        <h4 class="title">
                    470: <a name="fc-cache"></a>Xft using applications eat CPU cycles, but don't appear
                    471:        to do anything! (<a href="#running-x">top</a>)
                    472:   </h4>
                    473:
                    474:        <p>It is possible that the application in question is
                    475:          computing the font information that should have been
                    476:          prepared by fc-cache - re-run '<code class="code">fc-cache -v</code>' to
                    477:          make sure the information in the cache is up-to-date.</p>
                    478:
                    479:        <h4 class="title">
                    480: <a name="font-error"></a>'No fonts found' - what does this mean? (<a href="#running-x">top</a>)
                    481:   </h4>
                    482:
                    483:        <pre class="programlisting">No fonts found; this probably means that the fontconfig
                    484: library is not correctly configured. You may need to
                    485: edit the fonts.conf configuration file. More information
1.16      spz       486: about fontconfig can be found in the <a href="http://netbsd.gw.com/cgi-bin/man-cgi?fontconfig+3+NetBSD-5.1+i386">fontconfig(3)</a> manual
1.11      dsieger   487: page and on <a class="ulink" href="http://fontconfig.org" target="_top">http://fontconfig.org</a></pre>
1.1       dsieger   488:
                    489:        <p>You haven't run '<code class="code">fc-cache -v</code>' like the
                    490:          <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/fontconfig/README.html" target="_top"><code class="filename">fonts/fontconfig</code></a>
1.11      dsieger   491:          <a class="ulink" href="ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/fonts/fontconfig/MESSAGE" target="_top">MESSAGE</a>
1.1       dsieger   492:          suggests during installation. For details, see
1.11      dsieger   493:          '<code class="code">pkg_info -D fontconfig</code>' and <a class="ulink" href="#anti_aliased" target="_top">above</a>.</p>
1.1       dsieger   494:
                    495:        <h4 class="title">
                    496: <a name="x_wm"></a>How do I change the default window manager? (<a href="#running-x">top</a>)
                    497:   </h4>
                    498:
                    499:        <p>First thing to do is to install the window manager you
                    500:          prefer. You can find a lot of them, ready to install, in
                    501:          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
                    502:          a successful installation, figure out how is the
                    503:          binary named. It will usually match package's name.</p>
                    504:
                    505:        <p>Once you know how to execute the window manager, you
                    506:          have to configure your X session to start it up. We will be
                    507:          using twm in our examples (which comes with X), whose binary
                    508:          is named <code class="code">twm</code>:</p>
                    509:
1.16      spz       510:        <div class="itemizedlist"><ul class="itemizedlist" type="disc">
                    511: <li class="listitem">If you are using <a href="http://netbsd.gw.com/cgi-bin/man-cgi?startx+1+NetBSD-5.1+i386">startx(1)</a>, edit the
1.1       dsieger   512:            <code class="filename">~/.xinitrc</code> file and
                    513:            append the following line to it:
                    514:            <code class="code">exec twm</code>
                    515: </li>
1.16      spz       516: <li class="listitem">If you are using <a href="http://netbsd.gw.com/cgi-bin/man-cgi?xdm+1+NetBSD-5.1+i386">xdm(1)</a>, edit the
1.1       dsieger   517:            <code class="filename">~/.xsession</code> file and append the
                    518:            following line to it:
                    519:            <code class="code">exec twm</code>
                    520: </li>
                    521: </ul></div>
                    522:
                    523:        <p>You can see that the content for each file is the same,
                    524:          so you may want to create a link between them.</p>
                    525:       <hr>
                    526: <h3 class="title">Compiling programs</h3>
                    527:        <h4 class="title">
                    528: <a name="compile_fails_xm"></a>Compile fails - 'unable to locate libXm' (<a href="#compiling-programs">top</a>)
                    529:   </h4>
                    530:
                    531:        <p>Xm does not come with the standard X11 environment. It is
1.11      dsieger   532:          part of <a class="ulink" href="http://www.opengroup.org/desktop/motif/" target="_top">Motif</a>,
1.1       dsieger   533:          which is a commercial graphical user interface.</p>
                    534:
1.11      dsieger   535:        <p>A freeware implementation of Motif called <a class="ulink" href="http://www.lesstif.org/" target="_top">Lesstif</a> is also available.
                    536:          It is available as part of the <a class="ulink" href="../software/packages.html" target="_top">NetBSD packages collection</a>,
1.1       dsieger   537:          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>
                    538:
                    539:        <h4 class="title">
                    540: <a name="compile_fails_xpm"></a>Compile fails - 'unable to locate xpm.h', or '-lXpm: no match' (<a href="#compiling-programs">top</a>)
                    541:   </h4>
                    542:
                    543:        <p><code class="filename">xpm.h</code> is part of the X PixMap
                    544:          library, used by many programs to allow more multi (than
                    545:          two) colour icons.
1.11      dsieger   546:          It is available as part of the <a class="ulink" href="../software/packages.html" target="_top">NetBSD packages collection</a>,
1.1       dsieger   547:          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>
                    548:
                    549:        <h4 class="title">
                    550: <a name="compile_basic"></a>Compile fails to link: Undefined symbol '_XOpenDisplay' (<a href="#compiling-programs">top</a>)
                    551:   </h4>
                    552:
                    553:        <p>If it is a third party item of software, you should
1.11      dsieger   554:          check if a version is available via the <a class="ulink" href="../software/packages.html" target="_top">NetBSD packages collection</a>.
1.1       dsieger   555:          If you are writing you own code you need to ensure you link
                    556:          against the necessary X libraries. In this case, add
                    557:          <code class="code">-L/usr/X11R6 -lX11</code> to the end of your link
                    558:          line.</p>
1.3       dsieger   559:       <hr>Back to  <em><a href="../">NetBSD Documentation</a></em>
                    560: </div></div></div>
                    561: <div class="navfoot"></div>
1.13      mishka    562: <div id="footer"><div id="footerContent"><center>
1.3       dsieger   563: <span class="footfeed"><a href="http://www.NetBSD.org/cgi-bin/feedback.cgi">
                    564:          Contact</a> |
1.9       kano      565:       </span><span class="footcopy"><a href="../../about/disclaimer.html">
1.3       dsieger   566:       Disclaimer</a> |
                    567:
1.17    ! darcy     568:       <span class="copyright">Copyright © 1994-2012 The NetBSD Foundation, Inc. </span>ALL RIGHTS RESERVED.<br>NetBSD<sup>®</sup> is a registered trademark of The NetBSD
1.3       dsieger   569:        Foundation, Inc.</span>
1.13      mishka    570: </center></div></div>
1.1       dsieger   571: </div></body>
                    572: </html>

CVSweb <webmaster@jp.NetBSD.org>