Annotation of htdocs/docs/x/index.html, Revision 1.11
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.6 dsieger 36: <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">
1.4 dsieger 37: <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">
1.3 dsieger 38: </form></div></div>
39: </div>
40: <div class="navBar">
1.6 dsieger 41: <span class="doNotDisplay">
42: Navigation:
43: </span><a href="../../">
44: Home</a> |
45: <a href="../../about/">
46: About</a> |
47: <a href="../../releases/">
48: Download</a> |
49: <a href="../../docs/">
50: Documentation</a> |
51: <a href="../../support/">
52: Support</a> |
53: <a href="../../community/">
54: Community</a> |
55: <a href="../../ports/">
56: Ports</a>
1.3 dsieger 57: </div>
58: </div>
59: <div id="content"><div class="fullWidth"><div class="rowOfBoxes">
60: <h1>NetBSD Documentation: The X Window System</h1>
1.1 dsieger 61: <h3 class="title"><a name="running-x">Running X</a></h3>
62: <ul>
63: <li><a href="#wsmouse">How to get the mouse working with XFree?</a></li>
64: <li><a href="#x-keyboard-maps">Changing the keyboard mapping from 'US' under X</a></li>
65: <li><a href="#x-keyboard-nocaps">How do I make the Caps key another Control key</a></li>
66: <li><a href="#xf86_corrupts_on_rage_128">XF86_SVGA corrupts glyphs on Rage 128 if accelerated</a></li>
67: <li><a href="#slow_when_compiling">X is very slow when compiling under NetBSD 1.3.x</a></li>
68: <li><a href="#bypassing_xdm">How to bypass xdm</a></li>
69: <li><a href="#startx_not_found">When I type 'startx' I get the message: startx: Command not found. What's wrong?</a></li>
70: <li><a href="#xinit_not_found">Unable to run X - 'xinit: not found'</a></li>
71: <li><a href="#startx_fails">startx fails -'X connection to: 0.0 broken'</a></li>
72: <li><a href="#xconsole">Console output (such as from 'su') garbles X display.</a></li>
73: <li><a href="#wheel-mouse">How do I get my mouse wheel to work?</a></li>
74: <li><a href="#xfree86-docs">XFree86 Documentation</a></li>
75: <li><a href="#which_version">Which version of XFree86 am I running?</a></li>
76: <li><a href="#anti_aliased">How to setup anti-aliased fonts on NetBSD for X11</a></li>
77: <li><a href="#fc-cache">Xft using applications eat CPU cycles, but don't appear
78: to do anything!</a></li>
79: <li><a href="#font-error">'No fonts found' - what does this mean?</a></li>
80: <li><a href="#x_wm">How do I change the default window manager?</a></li>
81: </ul>
82: <h3 class="title"><a name="compiling-programs">Compiling programs</a></h3>
83: <ul>
84: <li><a href="#compile_fails_xm">Compile fails - 'unable to locate libXm'</a></li>
85: <li><a href="#compile_fails_xpm">Compile fails - 'unable to locate xpm.h', or '-lXpm: no match'</a></li>
86: <li><a href="#compile_basic">Compile fails to link: Undefined symbol '_XOpenDisplay'</a></li>
87: </ul>
88: <hr>
89: <h3 class="title">Running X</h3>
90: <h4 class="title">
91: <a name="wsmouse"></a>How to get the mouse working with XFree? (<a href="#running-x">top</a>)
92: </h4>
93:
94: <p>Assuming you're using the default wscons console driver,
95: make sure you adjust the mouse protocol and device properly
96: in the XF86Config file's "Pointer" section:</p>
97:
98: <pre class="programlisting">Section "Pointer"
99: ###Protocol "PS/2" # Linux
100: ###Device "/dev/mouse" # Linux
101: ##Protocol "busmouse" # NetBSD 1.4.x
102: ##Device "/dev/pms0" # NetBSD 1.4.x
103: Protocol "wsmouse" # NetBSD 1.5 or later
104: Device "/dev/wsmouse" # NetBSD 1.5 or later
105: EndSection</pre>
106:
107: <p>If you don't use wscons (as is the default on 1.4.x
108: systems), use <code class="filename">/dev/pms0</code>
109: and the "busmouse" protocol for a PS/2 mouse.</p>
110:
111: <p>Protocol "PS/2" is still supported for older kernels,
112: you'll have to use Device "<code class="filename">/dev/pms0</code>"
113: with the opms mouse driver in the kernel for that,
114: though. Useful for X-Servers that don't support the wscons
115: protocol (like XFree V4 or Linux/FreeBSD X server
116: binaries).</p>
117:
118: <h4 class="title">
119: <a name="x-keyboard-maps"></a>Changing the keyboard mapping from 'US' under X (<a href="#running-x">top</a>)
120: </h4>
121:
122: <p>XFree 3.x maps the keyboard with an english map per
123: default. To change this to e.g. german, make sure the
124: following is in your XF86Config file:</p>
125:
126: <pre class="programlisting"># XkbDisable
127: # XkbKeymap "xfree86(us)"
128:
129: XkbModel "pc102"
130: XkbLayout "de" XkbVariant "nodeadkeys"</pre>
131:
132: <p>To get e.g. a german keyboard in XFree 4.x, put the
133: following into your XF86Config's "InputDevices"
134: section:</p>
135:
136: <pre class="programlisting">Options "XkbLayout" "de"</pre>
137:
138: <p>Configuring the keyboard for the console under wscons is
1.11 ! dsieger 139: described <a class="ulink" href="../guide/en/chap-cons.html#chap-cons-wscons-wskbd-keymaps" target="_top">elsewhere</a>.</p>
1.1 dsieger 140:
141: <h4 class="title">
142: <a name="x-keyboard-nocaps"></a>How do I make the Caps key another Control key (<a href="#running-x">top</a>)
143: </h4>
144:
145: <p>For XFree 3.x (as shipped with NetBSD 1.l5), add
146: “<span class="quote"><code class="code">XkbOptions "ctrl:nocaps"</code></span>” if you
147: want the caps-lock key become a second control-key. If you
148: want to use the "Windows" keys on your keyboard, you can get
149: some useful keysyms for them by using
150: “<span class="quote"><code class="code">XkbModel "pc105"</code></span>” instead.</p>
151:
152: <p>XFree 4.x uses a different config file format. For it,
153: put
154: </p>
155: <pre class="programlisting">Option "XkbOptions" "ctrl:nocaps"</pre>
156: <p>
157: into the "InputDevice" section of your XF86Config file.</p>
158:
159: <h4 class="title">
160: <a name="xf86_corrupts_on_rage_128"></a>XF86_SVGA corrupts glyphs on Rage 128 if accelerated (<a href="#running-x">top</a>)
161: </h4>
162:
163: <p>To fix this make sure you have xsrc of at least
164: 2000-01-13 (otherwise you will have to also apply the patch in PR
165: <a href="http://www.NetBSD.org/cgi-bin/query-pr-single.pl?number=9171" class="gnatspr">misc/9171</a>).
166: Then use </p>
167: <pre class="programlisting">Option "xaa_no_color_exp"</pre>
168: <p>
169: in the Device section of your
170: <code class="filename">XF86Config</code>.</p>
171:
172: <h4 class="title">
173: <a name="slow_when_compiling"></a>X is very slow when compiling under NetBSD 1.3.x (<a href="#running-x">top</a>)
174: </h4>
175:
1.11 ! dsieger 176: <p>A <a class="ulink" href="ftp://ftp.NetBSD.org/pub/NetBSD/misc/patches/1.3schedpatch" target="_top">patch</a>
1.1 dsieger 177: for the NetBSD 1.3 series is available which will
178: significantly improve the interactive performance under X
179: while compiling or performing other tasks.</p>
180:
181: <h4 class="title">
182: <a name="bypassing_xdm"></a>How to bypass xdm (<a href="#running-x">top</a>)
183: </h4>
184:
185: <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
186: for some reason, possibly because there is no root password,
187: and you do not have virtual consoles enabled (or they are
188: not yet supported on your port), you can either press ^C at
189: the immediately after the boot messages indicate xdm is
190: starting, or:</p>
191:
192: <div class="itemizedlist"><ul type="disc">
193: <li>Boot to single user mode - Usually this is
194: accomplished by passing '-s' at the end of the boot
195: command.</li>
196: <li>Start the shell - Press <code class="code">ENTER</code> when
197: prompted for the shell.</li>
198: <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
199: <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>
200: </li>
201: <li>Set term terminal type -
202: <code class="code">TERM=<span class="emphasis"><em>vt100</em></span> ; export TERM</code>
203: Note: you may need to use a different terminal type such
204: as 'pc3' or 'sun'.</li>
205: <li>Fix problem - Edit
206: <code class="filename">/etc/rc.conf</code> to disable xdm, run
207: <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
208: other corrective action is needed</li>
209: </ul></div>
210:
211: <h4 class="title">
212: <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>)
213: </h4>
214: <p>You need to add the location of the X binaries to your
215: 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
216: derivatives, add <code class="filename">/usr/X11R6/bin</code>
217: to the line in your <code class="filename">.cshrc</code> file which
218: sets the <code class="code">path</code> variable. For <code class="code">sh</code> and
219: its derivatives, you'll need to modify you
220: <code class="filename">.profile</code> instead.</p>
221:
222: <h4 class="title">
223: <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>)
224: </h4>
225:
226: <p>You need <code class="filename">/usr/X11R6/bin</code> in your
227: path. As root add '<span class="bold"><strong><code class="code">set path = ( $path /usr/X11R6/bin )</code></strong></span>'
228: to <code class="filename">/etc/csh.cshrc</code>, and start a new
229: shell.</p>
230:
231: <h4 class="title">
232: <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>)
233: </h4>
234:
235: <p>To see the error messages in this case, run:
236:
237: </p>
238: <div class="itemizedlist"><ul type="disc">
239: <li>If your shell is <a href="http://netbsd.gw.com/cgi-bin/man-cgi?csh+1+NetBSD-current">csh(1)</a> or
240: <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/shells/tcsh/README.html" target="_top"><code class="filename">shells/tcsh</code></a>:
241: <pre class="programlisting">startx >& ~/x.log</pre>
242: </li>
243: <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:
244: <pre class="programlisting">startx > ~/x.log 2>&1</pre>
245: </li>
246: </ul></div>
247: <p>
248: Then view <code class="filename">~/x.log</code></p>
249:
250: <h4 class="title">
251: <a name="xconsole"></a>Console output (such as from 'su') garbles X display. (<a href="#running-x">top</a>)
252: </h4>
253:
254: <p>The system is outputting a line to the console
255: indicating something has happened (such as 'su'). You should
256: 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
257: this console output.</p>
258:
259: <p>You may need to ensure your kernel is compiled with the
260: following enabled:
261: </p>
262: <pre class="programlisting">options UCONSOLE # allow anyone to steal the virtual console</pre>
263: <p>
1.11 ! dsieger 264: See <a class="ulink" href="../kernel/#how_to_build_a_kernel" target="_top">How to build a kernel</a>
1.1 dsieger 265: for details on how to build your own kernels.</p>
266:
267: <p>If you're logged in as root, and get annoying
268: <code class="code">portmap</code> notices, you may wish to look at the
1.11 ! dsieger 269: <a class="ulink" href="../misc/#portmap-messup" target="_top">FAQ entry</a>
1.1 dsieger 270: on how to turn those messages off.</p>
271:
272: <h4 class="title">
273: <a name="wheel-mouse"></a>How do I get my mouse wheel to work? (<a href="#running-x">top</a>)
274: </h4>
275:
276: <p>If you use a Microsoft IntelliMouse, Logitech Wheel
277: Mouse (cordless our not) or something similar that has a
278: scroll wheel, and you want to use the wheel under NetBSD,
279: first make a kernel that includes the "pmsi" driver, and
280: make sure "wsmouse" uses it. Something like this should
281: occur in your <a href="http://netbsd.gw.com/cgi-bin/man-cgi?dmesg+8+NetBSD-current">dmesg(8)</a> output:
282:
283: </p>
284: <pre class="programlisting">pmsi0 at pckbc0 (aux slot)
285: wsmouse0 at pmsi0</pre>
286: <p>
287: If you are running XFree86 3.x (as shipped with NetBSD 1.5.2
288: and earlier), ensure your <code class="filename">/etc/XF86Config</code>
289: contains:
290: </p>
291: <pre class="programlisting">Section "Pointer"
292: Protocol "wsmouse"
293: Device "/dev/wsmouse"
294: ZAxisMapping 4 5
295: EndSection</pre>
296: <p>
297: If you are running XFree86 4.x, ensure your
298: <code class="filename">/etc/X11/XF86Config</code> contains:
299: </p>
300: <pre class="programlisting">Section "InputDevice"
301: Identifier "Mouse0"
302: Driver "mouse"
303: Option "Protocol" "wsmouse"
304: Option "Device" "/dev/wsmouse"
305: Option "Buttons" "5"
306: Option "ZAxisMapping" "4 5"
307: EndSection</pre>
308: <p>
309: That's enough to make xterms scroll. For other apps, you'll
310: need to edit your <code class="filename">~/.Xdefaults</code>. See
1.11 ! dsieger 311: <a class="ulink" href="http://koala.ilog.fr/colas/mouse-wheel-scroll/" target="_top">Colas Nahaboo X mouse wheel scroll page</a>
1.1 dsieger 312: for details on a lot of applications that can be made
313: working.</p>
314:
315:
316: <h4 class="title">
1.11 ! dsieger 317: <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 318: </h4>
319:
320: <h4 class="title">
321: <a name="which_version"></a>Which version of XFree86 am I running? (<a href="#running-x">top</a>)
322: </h4>
323:
324: <p>To quickly tell which version of the X server you are
325: running, you can use <a href="http://netbsd.gw.com/cgi-bin/man-cgi?xdpyinfo+1+NetBSD-current">xdpyinfo(1)</a>. E.g.:
326: </p>
327: <pre class="programlisting">$ xdpyinfo | grep release
328: vendor release number: 335</pre>
329: <p>
330:
331: In the case of XFree86, this tells us that the server
332: version is 3.3.5.</p>
333:
334: <h4 class="title">
335: <a name="anti_aliased"></a>How to setup anti-aliased fonts on NetBSD for X11 (<a href="#running-x">top</a>)
336: </h4>
337:
338: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
339: <h3 class="title">Note</h3>
340: <p>
341: The paths below should be adjusted appropriately if using
342: <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/pkgtools/xpkgwedge/README.html" target="_top"><code class="filename">pkgtools/xpkgwedge</code></a>.
343: </p>
344: </div>
345:
346: <div class="orderedlist"><ol type="1">
347: <li>
348: <p>
349: Install the
350: <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.
351: If you use the pkgsrc version of X, install also the
352: <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/mkfontscale/README.html" target="_top"><code class="filename">fonts/mkfontscale</code></a> and
353: <a href="ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc/fonts/fontconfig/README.html" target="_top"><code class="filename">fonts/fontconfig</code></a> packages.
354: </p>
355: </li>
356: <li>
357:
358: <p>
359: If using the XFree86 shipped with NetBSD, you may consider
360: 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
361: as it offers more tweaking options. Set the variable <code class="varname">
362: PREFER.fontconfig</code> to pkgsrc in the <code class="filename">/etc/mk.conf
363: </code> file to ensure that the pkgsrc version is used in
364: favour of the shipped (or native) version:
365: </p>
366: <pre class="programlisting">
367: PREFER.fontconfig=pkgsrc
368: </pre>
369: <p>
370: </p>
371:
372: <p>
373: You may also want to instruct fontconfig to never use
374: <span class="emphasis"><em>bitmap fonts</em></span> again:
375: </p>
376: <pre class="programlisting">
377: # cd /usr/pkg/etc/fontconfig/conf.d
378: # ln -s ../../../share/examples/fontconfig/conf.avail/70-no-bitmaps.conf .
379: </pre>
380: <p>
381: </p>
382:
383: <p>
384: You may wish to replace the native fontconfig libraries entirely,
385: which is useful should you have any previously-compiled binaries
386: that used it.
387: </p>
388: <pre class="programlisting">
389: # cd /usr/X11R6/lib
390: # mv libfontconfig.so.1.0 libfontconfig.so.1.0.old
391: # rm libfontconfig.so.1
392: # ln -s ../../pkg/lib/libfontconfig.so.1 .
393: # cd /usr/X11R6/bin
394: # mv fc-cache fc-cache.old
395: # mv fc-list fc-list.old
396: </pre>
397: <p>
398: </p>
399:
400: </li>
401: <li>
402: <p>
403: To configure fontconfig, add the following line to your
404: local.conf. This file is generally found in
405: <code class="filename">/etc/fonts/local.conf</code>.
406: If you installed the fonts/fontconfig package, you will
407: <span class="bold"><strong>also</strong></span> need to add the line to
408: <code class="filename">/usr/pkg/etc/fonts/local.conf</code>
409: (or replace one with a symbolic link to another):
410: </p>
411: <pre class="programlisting">
412: <dir>/usr/pkg/lib/X11/fonts/TTF</dir>
413: </pre>
414: <p>
415: </p>
416:
417: <p>
418: The <code class="filename">local.conf</code> file may look like this:
419: </p>
420: <pre class="programlisting">
421: <?xml version="1.0"?>
422: <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
423: <fontconfig>
424: <dir>/usr/pkg/lib/X11/fonts/TTF</dir>
425: </fontconfig>
426: </pre>
427: <p>
428: </p>
429:
430: <p>
431: You can also add other directories containing fonts to the
432: <code class="filename">local.conf</code> file. The following lines are
433: for using teTeX-3.0 and ghostscript fonts:
434: </p>
435: <pre class="programlisting">
436: <dir>/usr/pkg/share/texmf-dist/fonts/</dir>
437: <dir>/usr/pkg/share/ghostscript/fonts</dir>
438: </pre>
439: <p>
440: </p>
441:
442: </li>
443: <li>
444: <p>
445: Rebuild the font cache for applications that use fontconfig
446: </p>
447: <pre class="programlisting">
448: # fc-cache -v
449: </pre>
450: <p>
451: Depending on your hardware this may take a long time.
452: </p>
453: </li>
454: <li>
455: <p>
456: Run the following commands:
457: </p>
458: <pre class="programlisting">
459: # mkfontscale /usr/pkg/lib/X11/fonts/TTF
460: # mkfontdir /usr/pkg/lib/X11/fonts/TTF
461: </pre>
462: <p>
463: There should now be the files <code class="filename">fonts.dir</code> and
464: <code class="filename">fonts.scale</code> in the TTF font directory.
465: </p>
466: </li>
467: <li>
468: <p>Configure the X server:
469: </p>
470: <div class="itemizedlist"><ul type="disc">
471: <li>
472: <p> In the “<span class="quote">Module</span>” section, make sure that the following exists:
473: </p>
474: <pre class="programlisting">
475: Load "type1"
476: Load "freetype"
477: </pre>
478: <p>
479: </p>
480: </li>
481: <li>
482: <p>
483: In the “<span class="quote">Files</span>” section, verify the order of
484: the font paths. Verify that the TTF and Type1
485: font paths are before the rest:
486: </p>
487: <pre class="programlisting">
488: FontPath "/usr/X11R6/lib/X11/fonts/local/"
489: FontPath "/usr/pkg/lib/X11/fonts/TTF"
490: FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
491: FontPath "/usr/X11R6/lib/X11/fonts/misc/"
492: FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
493: FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
494: FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
495: FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"</pre>
496: <p>
497: </p>
498:
499: <p>
500: To apply the changes to the current X session, instead of
501: restarting X, run the following command
502: </p>
503: <pre class="programlisting">
504: # xset fp rehash
505: </pre>
506: <p>
507: This will examine newly added font paths for changes.
508: </p>
509:
510: <p>
511: Instead of adding “<span class="quote">FontPath</span>” directives to the X configuration file,
512: you can run the following commands from
513: <code class="filename">~/.xinitrc</code>
514: (or <code class="filename">~/.xsession</code>) file:
515: </p>
516: <pre class="programlisting">
517: xset +fp /usr/X11R6/lib/X11/fonts/Type1
518: xset +fp /usr/pkg/lib/X11/fonts/TTF
519: xset +fp /usr/X11R6/lib/X11/fonts/local
520: </pre>
521: <p>
522: </p>
523:
524: </li>
525: </ul></div>
526: <p>
527: </p>
528: </li>
529: <li>
530: <p>That's it! Run the following commands to test the configuration.
531: </p>
532: <pre class="programlisting">
533: $ xterm -ls -fg gray -bg black -ls -fa 'Courier New:bold' -fs 10
534: </pre>
535: <p>
536: </p>
537:
538: <p>
539: Run the command <strong class="userinput"><code>fc-list</code></strong> it should list
540: the fonts available, and shouldn't dump core!
541: </p>
542:
543: <p>
544: While the xterm command from above only tests the fontconfig part, the following
545: command will test the XLFD-style access:
546: </p>
547: <pre class="programlisting">
548: $ xterm -fn '-monotype-Courier New-medium-r-normal--0-0-0-0-m-0-iso8859-1'
549: </pre>
550: <p>
551: </p>
552:
553: <p>
554: Another test is that the following should show multiple fonts:
555: </p>
556: <pre class="programlisting">
557: $ xlsfonts | grep -i 'courier new'
558: </pre>
559: <p>
560: </p>
561:
562: </li>
563: <li>
564: <p>
565: You can find other TTF font packages under pkgsrc/fonts.
566: 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>
567: </p>
568: </li>
569: </ol></div>
570:
571:
572: <h4 class="title">
573: <a name="fc-cache"></a>Xft using applications eat CPU cycles, but don't appear
574: to do anything! (<a href="#running-x">top</a>)
575: </h4>
576:
577: <p>It is possible that the application in question is
578: computing the font information that should have been
579: prepared by fc-cache - re-run '<code class="code">fc-cache -v</code>' to
580: make sure the information in the cache is up-to-date.</p>
581:
582: <h4 class="title">
583: <a name="font-error"></a>'No fonts found' - what does this mean? (<a href="#running-x">top</a>)
584: </h4>
585:
586: <pre class="programlisting">No fonts found; this probably means that the fontconfig
587: library is not correctly configured. You may need to
588: edit the fonts.conf configuration file. More information
589: 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
1.11 ! dsieger 590: page and on <a class="ulink" href="http://fontconfig.org" target="_top">http://fontconfig.org</a></pre>
1.1 dsieger 591:
592: <p>You haven't run '<code class="code">fc-cache -v</code>' like the
593: <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 594: <a class="ulink" href="ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/fonts/fontconfig/MESSAGE" target="_top">MESSAGE</a>
1.1 dsieger 595: suggests during installation. For details, see
1.11 ! dsieger 596: '<code class="code">pkg_info -D fontconfig</code>' and <a class="ulink" href="#anti_aliased" target="_top">above</a>.</p>
1.1 dsieger 597:
598: <h4 class="title">
599: <a name="x_wm"></a>How do I change the default window manager? (<a href="#running-x">top</a>)
600: </h4>
601:
602: <p>First thing to do is to install the window manager you
603: prefer. You can find a lot of them, ready to install, in
604: 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
605: a successful installation, figure out how is the
606: binary named. It will usually match package's name.</p>
607:
608: <p>Once you know how to execute the window manager, you
609: have to configure your X session to start it up. We will be
610: using twm in our examples (which comes with X), whose binary
611: is named <code class="code">twm</code>:</p>
612:
613: <div class="itemizedlist"><ul type="disc">
614: <li>If you are using <a href="http://netbsd.gw.com/cgi-bin/man-cgi?startx+1+NetBSD-current">startx(1)</a>, edit the
615: <code class="filename">~/.xinitrc</code> file and
616: append the following line to it:
617: <code class="code">exec twm</code>
618: </li>
619: <li>If you are using <a href="http://netbsd.gw.com/cgi-bin/man-cgi?xdm+1+NetBSD-current">xdm(1)</a>, edit the
620: <code class="filename">~/.xsession</code> file and append the
621: following line to it:
622: <code class="code">exec twm</code>
623: </li>
624: </ul></div>
625:
626: <p>You can see that the content for each file is the same,
627: so you may want to create a link between them.</p>
628: <hr>
629: <h3 class="title">Compiling programs</h3>
630: <h4 class="title">
631: <a name="compile_fails_xm"></a>Compile fails - 'unable to locate libXm' (<a href="#compiling-programs">top</a>)
632: </h4>
633:
634: <p>Xm does not come with the standard X11 environment. It is
1.11 ! dsieger 635: part of <a class="ulink" href="http://www.opengroup.org/desktop/motif/" target="_top">Motif</a>,
1.1 dsieger 636: which is a commercial graphical user interface.</p>
637:
1.11 ! dsieger 638: <p>A freeware implementation of Motif called <a class="ulink" href="http://www.lesstif.org/" target="_top">Lesstif</a> is also available.
! 639: It is available as part of the <a class="ulink" href="../software/packages.html" target="_top">NetBSD packages collection</a>,
1.1 dsieger 640: 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>
641:
642: <h4 class="title">
643: <a name="compile_fails_xpm"></a>Compile fails - 'unable to locate xpm.h', or '-lXpm: no match' (<a href="#compiling-programs">top</a>)
644: </h4>
645:
646: <p><code class="filename">xpm.h</code> is part of the X PixMap
647: library, used by many programs to allow more multi (than
648: two) colour icons.
1.11 ! dsieger 649: It is available as part of the <a class="ulink" href="../software/packages.html" target="_top">NetBSD packages collection</a>,
1.1 dsieger 650: 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>
651:
652: <h4 class="title">
653: <a name="compile_basic"></a>Compile fails to link: Undefined symbol '_XOpenDisplay' (<a href="#compiling-programs">top</a>)
654: </h4>
655:
656: <p>If it is a third party item of software, you should
1.11 ! dsieger 657: check if a version is available via the <a class="ulink" href="../software/packages.html" target="_top">NetBSD packages collection</a>.
1.1 dsieger 658: If you are writing you own code you need to ensure you link
659: against the necessary X libraries. In this case, add
660: <code class="code">-L/usr/X11R6 -lX11</code> to the end of your link
661: line.</p>
1.3 dsieger 662: <hr>Back to <em><a href="../">NetBSD Documentation</a></em>
663: </div></div></div>
664: <div class="navfoot"></div>
665: <div id="footer"><center>
666: <span class="footfeed"><a href="http://www.NetBSD.org/cgi-bin/feedback.cgi">
667: Contact</a> |
1.9 kano 668: </span><span class="footcopy"><a href="../../about/disclaimer.html">
1.3 dsieger 669: Disclaimer</a> |
670:
1.11 ! dsieger 671: <span class="copyright">Copyright © 1994-2008 The NetBSD Foundation, Inc. </span>ALL RIGHTS RESERVED.<br>NetBSD<sup>®</sup> is a registered trademark of The NetBSD
1.3 dsieger 672: Foundation, Inc.</span>
673: </center></div>
1.1 dsieger 674: </div></body>
675: </html>
CVSweb <webmaster@jp.NetBSD.org>