<?xml version="1.0"?>
<linuxdoc><article opts="null"><titlepag><title>X11-big-cursor MINIHOWTO<subtitle>How to use enlarged mouse cursors with the X window system</subtitle></title><author><name><url url="mailto:joerg.schneider@ira.uka.de" name="Jentrg Schneider"></url></name></author><date>v2, 11 August 1997</date><abstract>This document describes how to use enlarged mouse cursors with the X
window system.</abstract></titlepag><toc></toc><sect><heading>Introduction<label id="top"></label></heading><p>There are several reasons why the standard X mouse cursors are hard to
track for some people: 
<itemize><item> when running X on a notebook with low contrast LCD</item><item> on normal screens when using high resolution, 1600x1280 e.entg.</item><item> for visually impaired persons even on normal hardware</item></itemize></p><p>In all cases it might help to use enlarged mouse cursors. Ideally this
job should be done by a single X program that automatically enlarges
every mouse cursor.</p><p>To my knowledge there is no simple way to write a utility like this,
because the X protocol has no provision to query mouse cursors. For
more details see section <ref id="tech" name="Technical discussion"></ref> below. </p><p>If we aim for a less general goal, though, something can be done: </p><p>There is a set of standard mouse cursors that can be found in the
cursor font (try <tt>xfd -fn cursor</tt> to look at it). Most programs use
these mouse cursors and the key idea is to replace the standard cursor
font with an enlarged version. </p><p></p></sect><sect><heading>About this document</heading><p>The motivation for this MINIHOWTO was a visually impaired co-student
who asked me how to enlarge the mouse cursor under X. After I found
out how this can be done, I wrote an initial version of this
document. The knowledge about the method described here does not seem
to be common, so I decided to share it and submitted this document as
a Linux MINIHOWTO, despite the fact that it is
<em>not specific to Linux at all</em>. As all other MINIHOWTOs it can be
found in the home of of the <url url="http://sunsite.unc.edu/LDP/HOWTO/" name="Linux Documentation Project (LDP)"></url>.</p><p>The <url url="http://i11www.ira.uka.de/entschneid/X11-big-cursor/master/" name="master"></url> of
this document is maintained in the SGML/linuxdoc format. This makes it
possible to automatically provide versions in the following formats
(which can be found in the same place as the master): html, text,
LaTeX, DVI, PostScript, GNU info.</p><p><url url="mailto:shinobu@emichan.rim.or.jp" name="Shinobu Miyata"></url> has
done a Japanese translation of this MINIHOWTO. It can be found in <url url="http://i11www.ira.uka.de/entschneid/jp/X11-big-cursor/" name="ent"></url>.</p><p></p></sect><sect><heading>How to do it<label id="howto"></label></heading><p>Follow the steps detailed below. If you don't want to get and compile
the bdfresize package yourself, you can skip to step 3 and download a
magnified font instead of creating it.
<enum><item> get cursor.bdf, the source of the cursor font, from some X
distribution, e.entg. from <url url="ftp://ftp.x.org/pub/R6.3/xc/fonts/bdf/misc/cursor.bdf" name="ent"></url> (if you don't 
find it there try an archie search or get it from <url url="http://i11www.ira.uka.de/entschneid/X11-big-cursor/cursor.bdf" name="my copy"></url>).  </item><item> get, compile and install the bdfresize package from
<url url="ftp://ftp.cs.titech.ac.jp/X11/contrib/Local/bdfresize-1.4.tar.Z" name="ent"></url>
(or from <url url="http://i11www.ira.uka.de/entschneid/X11-big-cursor/bdfresize-1.4.tar.gz" name="my copy"></url>):
<verb>     zcat bdfresize-1.4.tar.Z  | tar xf -
     cd bdfresize-1.4
     xmkmf
     make
     </verb>
On Linux you probably have to use:
<verb>     make CCOPTIONS='-include /usr/include/bsd/bsd.h' clean all
     </verb></item><item> create a directory and install a magnified cursor font in it
(magnification factor 2 in this example):

<verb>     mkdir $HOME/fonts
     bdfresize -f 2 cursor.bdf | bdftopcf ent$HOME/fonts/cursor2.pcf
     mkfontdir $HOME/fonts
     </verb>
     
I have prepared some <url url="http://i11www.ira.uka.de/entschneid/X11-big-cursor/fonts/" name="cursor fonts"></url>
with the following magnification factors: 1.5, 2, 2.5, 3, 4, 5,
6, 7, 8 and 16. You can download one of them an copy it to
<tt>entHOME/fonts</tt> if you don't want to use bdfresize.
</item><item> modify your <tt>.xinitrc</tt> or <tt>.xsession</tt> file: before
any X client (that uses cursors) is started the following
commands must  be executed: 

<verb>     xset +fp $HOME/fonts
     xsetroot -cursor_name X_cursor
     </verb>
</item><item> leave your X session and restart.</item></enum></p><p>That's itentnow all mouse cursors should have doubled in size. </p><p></p><p></p></sect><sect><heading>Notes and limitations<label id="notes"></label></heading><p><itemize><item> X servers may have a limit for the maximum cursor
size, especially if they use a hardware implementation for the mouse
cursor. Others do not have such a limit. E.entg. XF86entS3ent3.3
works even with a 512x512 mouse cursor (rather slowly).</item><item> The magnified cursor font must have the same name as the original
font (the <em>font name</em> must be <tt>cursor</tt>, <em>file name</em> does not 
matter)entthat is no problem as <tt>bdfresize</tt> does not change
the font name. </item><item> The directory with the new cursor font must be placed before the
directory with the standard cursor font in the the font pathentthis
is accomplished with <tt>xset +fp</tt> (as opposed to
<tt>xset fp+</tt>).</item><item> Changes in <tt>entHOME/fonts/</tt> will be visible only
after the command <tt>mkfontdir entHOME/fonts; xset fp rehash</tt> 
and only in newly
started X clients (more exactly: for newly created cursors).</item><item> <tt>xset +fp path</tt> may not work on a X-Terminal. In this case
a font server (see the section <ref id="fontserver" name="How to use a fontserver"></ref>)
can be used if supported by the X-Terminal or some
other method to install the font on the X-Terminal (this can
generally only be done by your system administrator).</item><item> The same approach can be used for <tt>olcursor</tt> and
<tt>decwentcursor</tt> fonts and any other cursor font you may
encounter.</item><item> Cursor fonts produced by bdfresize don't look smooth,
especially at larger magnification factors. It would be nice if
someone could create better looking handcrafted version at
some common sizes.</item></itemize></p><p></p></sect><sect><heading>Technical discussion<label id="tech"></label></heading><p>Is it possible to write a X program that enlarges cursors
automatically?</p><p><descrip><tag>(Partial) solution 1</tag><p>Use the XTestCompareCursor from the XTEST
extension. For all windows that the mouse pointer enters compare the
cursor of this window with a set of `known' cursors (e.entg. from
the cursor font). If the cursor is found, replace it with an enlarged
version, otherwise either leave it alone or substitute a standard
cursor. This will only work where the XTest extension is available.</p><p></p><tag>Solution 2</tag><p>Write a proxy X server that relays all client requests
unchanged to the real X server, except that it intercepts all requests
corresponing to the <tt>XCreate*Cursor</tt> Xlib
functions. <tt>XCreate*Cursor</tt> requests should be modified to use
an enlarged cursor. </p><p>This proxy server simulates a new display, e.entg. <tt>:1</tt>. All
clients that connect to this display (e.entg. <tt>xterm -display
:1</tt>) are displayed on the real server (normally <tt>:0</tt>) and their
mouse cursors are enlarged automatically. The mouse cursors of clients
that connect to <tt>:0</tt> will remain <em>unchanged</em>.</p></descrip></p><p></p></sect><sect><heading>Other ideas how to make the mouse cursor more visible<label id="ideas"></label></heading><p>Here are some ideas for rather simple X programs that might make
mouse cursors easier to track.</p><p><itemize><item> When a hot key is pressed display something (big cursor, small
window, shaped window) at pointer position for 0.5s.</item><item> use XRecolorCursor to change the mouse cursor color every 0.1s</item></itemize></p><p>A more demanding project would be <bf>mouse trails</bf> ent la
windoze, i.ente. when the mouse is moved and the mouse cursor needs
to be drawn in a different position, then the old mouse cursor does
not disappear at once, but after a short delay. Mouse trails would be
probably best implemented in a X server, but it might be feasible to
do it as a X client, or better as a proxy server (see section <ref id="tech" name="Technical discussion"></ref> for details).</p><p></p></sect><sect><heading>Related info<label id="info"></label></heading><sect1><heading>How to use a font server<label id="fontserver"></label></heading><p>A font server is a net service that provides a set of X11 fonts
with a simple protocol. It can be queried which fonts it provides and
will supply the font bitmap data on request.</p><p>You might want to use a font server to provide the X server with a
modified cursor font, instead of telling it where to find the font on
the file system. </p><p>This method is especially handy if you use several machines that don't
share a common file system or if you use X terminals that support
the font server protocol. </p><p>A font server program and associated tools comes with the X11R5+
distribution (AFAIK). </p><p></p><sect2><heading>Setting up a font server<label id="fsconfig"></label></heading><p>Read the manual pages <em>fs(1)</em>, <em>fslsfonts(1)</em> (or
<em>xfs(1)</em>, <em>xfslsfonts(1)</em> under X11R6) and try itentit isn't
hard. Say, you are running the server on host <tt>some.host.edu</tt>
on port 7100. You can test the setup with the command </p><p><tt>fslsfonts -server some.host.edu:7100</tt></p><p>To actually use the server issue the command </p><p><tt>xset +fp tcp/some.host.edu:7100</tt></p><p>which should return without an error message.</p><p></p><p></p></sect2></sect1><sect1><heading>How to get the bdf source for some font<label id="getbdf"></label></heading><p>If you have set up a font server simply use <tt>fstobdf</tt> which
comes with the font server.</p><p>Alternatively you may try <tt>getbdf</tt> which can dump any installed
X11 font to a bdf file. </p><p></p></sect1></sect></article></linuxdoc>

