[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.41

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

CVSweb <webmaster@jp.NetBSD.org>