[comp.fonts] PostScript font for chess

anw@maths.nott.ac.uk (Dr A. N. Walker) (03/20/91)

This is the current (pretty stable) state of my chess font.  It works
for me;  as I have no access to any PostScript device other than a
somewhat old Apple LW+, I can offer no guarantees that it will work
for you (but do try the demo).  Comments welcomed!

	-- Andy.

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  README Font Demo Table
# Wrapped by anw@piaggio on Tue Mar 19 17:53:54 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f README -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"README\"
else
echo shar: Extracting \"README\" \(9917 characters\)
sed "s/^X//" >README <<'END_OF_README'
XPostScript Chess Font -- "README" file.
X========== ===== ==== == ======== =====
X
X	Copyright (c) 1991 A. N. Walker.  All rights reserved.
X
XRestrictions on Use:
X------------ -- ----
X	You must keep the copyright notice on this file and on the
Xaccompanying "Font" file.  If you change anything, you must clearly
Xmark your changes.  Otherwise, you may use these files as you please
Xfor private, educational or research purposes.  You may also use them
Xfreely for commercial purposes as long as you do not make any changes
Xto the shapes of the pieces without my approval.
X
X	I do not, and am in no position to, make any claim as to
Xsuitability of these files for any specific purpose.  They work for
Xme, and if they work for you too I shall be pleased.  If they do not
Xwork for you, well, you have what you paid for.
X
X	If you are pleased with the results, please let me [and your
Xreaders, if any!] know.  If you manage to make money out of them,
Xplease let me know how!  I'd quite like to see [real or PostScript]
Xcopies of what you manage to do, if you have the necessary time,
Xinclination and resources.
X
X	If you don't like the results, please let me know why.  Indeed,
Xif you have any comments, please e- or snail- mail them to me.
X
XWhat you have to do:
X---- --- ---- -- ---
X	You should have three files, called "Font", "Demo" and "Table".
XIf you have a way of viewing PostScript, shovel "Font" and "Demo" or
X"Font" and "Table" at it;  for example, I use the commands
X
X		lpr -Plwriter Font Demo
X		lpr -Plwriter Font Table
X
Xto see the results on "my" LaserWriter.  If you have no way of viewing
XPostScript, then I'm sorry, but I can't help you.  What you should see
Xis an assorted collection of boards and figurines in various sizes and
Xrotations ("Demo") or a neat table showing all the symbols in the font
X("Table").  If anything else happens, you will have to consult someone
Xwho knows what they're doing -- *not* me!  I can promise you that the
Xfiles as shipped print nicely on a bog-standard Apple LW+.  They take
Xseveral minutes each to print on our LW+;  this is largely because they
Xmake almost pessimal use of the font caching mechanism -- lots of big
Xcharacters are printed once each in different sizes and orientations.
XConventional pages with lots of figurines or ordinary text and only a
Xfew diagrams print acceptably quickly (especially, of course, if you
Xhave a faster or more recent LW).
X
X	If you are happy with the demos, you can then install the "Font"
Xfile as a font in your system.
X
X	****************************************
X	* I cannot help you with this process! *
X	****************************************
X
XI can't even do it for our own computer, which has a much-hacked (from
Xits PDP-11 days) version of Troff;  I leave it to our guru.  Neither
Xhe nor I know what magic you have to utter for an unhacked Troff, or
Xfor TEX, or for Macs or PCs or whatever weird and wonderful software
Xor hardware you possess.  When you install the font, you may also find
Xit useful to grab some of the PostScript code from "Demo", especially
Xif you want to draw (for example) labelled diagrams.
X
XWhat there is in the Font:
X---- ----- -- -- --- -----
X	There are really two fonts wrapped up into one.  The more
Xconventional sub-font is the so-called "text mode", and is what you
Xget when you first select the font.  This mode itself has two major
Xcomponents.  The upper case letters are the figurines, for use in
Xtext.  For example, "Q" draws a queen figurine.  Lower case letters
Xand other symbols are (most of) the Informant symbols (omitting only
Xsymbols like "?" and "ch" that you can reasonably expect to find in
Xboring old Times Roman, but including "+" and "-").  I've been as
Xmnemonic as I could, but there are just too many symbols.
X
X	The other sub-font is "diagram mode".  In this, upper case
Xletters draw white pieces, and lower case letters draw black pieces.
XFor example, "Knk" draws a white king adjacent to a black knight
Xand a black king.  The pieces include a selection of fairy pieces
Xand other related symbols -- everything I've seen or had reported
Xto me on chess diagrams in the last few years.  The other symbols
Xin this sub-font consist of board-drawing components and motions
Xto facilitate the construction of diagrams.  You switch between
Xtext and diagram modes using the prime symbol, "'".  For example,
Xthe famous Reti study can be diagrammed by the PostScript:
X
X		('#[7K;8;k1P;7p;8;8;8;8]') show
X
Xwhere "#" draws the board, and the stuff between "[...]" is the
Xconventional Forsythe notation for the position.  Obviously, for
Xpractical use, you will need a chess pre-processor (which I have
X*not* written!).
X
X	Most of the capabilities of the font are illustrated on
Xthe demo page, which also includes some possibly-useful PostScript
Xprocedures for various of the effects.
X
X	Warning:  the dual-mode font treads on very thin ice in
Xsome places!  In particular, the caching mechanisms of PostScript
Xare very easy to fool with a dynamic font of this type.  For example,
Xfinding the width of a string is fraught with danger;  do it only
Xwith strings that include matched pairs of primes.
X
XThe font design:
X--- ---- -------
X	There are surprisingly many different chess fonts in use in
Xprinted books.  I have tried to copy the simplest -- for example,
Xthe rooks have no brickwork, and the kings are quite plain.  Note
Xthat the pieces do not scale well.  Large pieces (inches high) for
Xposters, etc., will have to be specially designed (and are usually
Xbased on "real" Staunton pieces).  Tiny pieces suffer from the lack
Xof resolution on 300 dpi (or coarser) printers.  On a 300 dpi printer,
X7-point is really too small, anything less is hopeless (see the demo).
XI usually use 15-point, which is comparable with most books.
X
X	The hardest piece to get right is the knight.  The book designs
Xare hopeless at 300 dpi resolution, as there are too many fine lines
Xaround the mouth and chin.  Any attempts to copy them just look like a
Xcaricature.  So I've made it a bit chunkier.  Most readers don't notice.
X
X	Note that most of the pieces (as opposed to the figurines)
Xcannot be cached.  This is because they include both write-white and
Xwrite-black components (partly, but not entirely, because they have
Xto work on black squares);  this makes drawing a whole page of black
Xkings (or whatever) rather slooow.  Fortunately, you don't often need
Xsuch a thing.  The figurines *are* cached, so are the Informant symbols,
Xand so are the commonest pieces (the black squares, and the pawns of
Xboth colours).
X
XForeign usage:
X------- ------
X	Foreign users may want to re-assign the letters used for the
Xvarious pieces.  This can easily be done in the Font file.  Lines
Xsuch as
X
X	dup 8#113 /WK put		% 'K'
X
X(not too far down the file) signify that ASCII character 113 (octal), or
X"K", is to draw the White King.  If you want some other character to draw
Xthe WK, alter the 113 to match.  You will have to change the BK and Kfig
Xby the same amount, and you will also have to reassign whatever symbol
Xyour chosen character already draws, if any.  Another minor problem is
Xthat some of the fairy pieces are defined explicitly in terms of the
Xexisting pieces -- eg, if you decide to use "F" to draw White queens,
Xthen the procedure for Grasshoppers (look for "WG" in Font) must be
Xchanged to draw upside-down "F" instead of upside-down "Q".  I hope the
Xnecessary edits are obvious even to non-PostScript users.  I suggest that
Xafter any change you try the Table and Demo files again.
X
XUnusual chess pieces:
X------- ----- -------
X	I've included a fair number of pieces that may not be familiar to
Xall chess players.  These include:
X	F for fou, French version of bishop.  There are several designs
X	    of fou in print, I have selected the easiest to implement.  If
X	    you want one of the others, you'll have to write it yourself.
X	D,X for draughts pieces.  Note that these are not cached (except
X	    as figurines);  if you are writing a book on draughts with
X	    lots of diagrams, you might find it worthwhile to re-write
X	    them in a cachable way.  This is easier if you want to use
X	    them on the white squares (you don't need the "halo" effect),
X	    but the books I have seen are about equally split on this.
X	C,I,T for chameleon, imitator, rose.  Various fairy pieces.
X	E,G,L,M,O,S,U,V,Z for various rotated standard pieces, used in
X	    fairy chess.  Note that the "Demo" file includes a more
X	    general way to rotate a piece.  I have used S for nightrider,
X	    oppositely to the problemists convention which uses S for
X	    knight and N for nightrider;  there is no way that the average
X	    player is going to change his habits!  If you are a problemist,
X	    feel free to interchange S and N (and then M and Z).
X	.,@,|,_ for various other marks useful in annotating diagrams.
X	    See the "Demo" file for examples of their use.
X	A,H,J,W,Y are unused.  Feel free to use them to add new pieces.
X
XGo pieces:
X-- -------
X	Sorry, despite several requests, I haven't put these in.  I
Xcan't save the whole world in one easy lesson.  The pieces themselves
Xand the board are easy in PostScript;  the annotations and the necessary
Xpre-processor are another kettle of fish.  The Go stones could also be
Xused for Reversi (Othello).
X
XBridge symbols:
X------ --------
X	No-one has actually asked for these, but just to forestall you,
Xnote that they are already provided in many places -- symbol fonts,
Xdingbats fonts, Hershey fonts, ....
X
XFinal comments:
X----- ---------
X	Suggestions for improvements, especially in the PostScript,
Xwill be welcomed.  Especially if they improve portability (which I
Xcan't check locally!).  Especially if you've tried them yourself,
Xand can vouch that they work.  Suggestions for extra symbols (other
Xthan Go or Bridge) also welcomed, especially if accompanied by
XPostScript or other descriptions of their shape.
X
X-- 
XAndy Walker, Maths Dept., Nott'm Univ., UK.
Xanw@maths.nott.ac.uk
END_OF_README
if test 9917 -ne `wc -c <README`; then
    echo shar: \"README\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f Font -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"Font\"
else
echo shar: Extracting \"Font\" \(24871 characters\)
sed "s/^X//" >Font <<'END_OF_Font'
X%!PS-Adobe-1.0
X%% This is my font for chess and similar pieces.  It is supplied "as is".
X%% It works for me, I have no idea whether it will work for you;  you gets
X%% what you pays for.  Before using it, you should read the Copyright
X%% notice below and the "README" file which should accompany this file.
X%%    -- ANW, March 1991.
X
X/Cfont 9 dict dup begin
X
X/FontMatrix [ 0.001 0 0 0.001 0 0 ] readonly def
X/FontType 3 def
X/FontBBox [ 0 0 0 0 ] readonly def
X/Encoding 256 array def
X/FontInfo 3 dict dup begin
X  /Notice (
X
X	Copyright (c) 1991 A. N. Walker.  All rights reserved.
X
X	This notice must be preserved in all versions of this file, and
X	any alterations which you make must be clearly marked as such.
X	For further information, see the "README" file which should
X	accompany this, or contact me at Dept of Mathematics, Nottingham
X	Univ., UK, anw@maths.nott.ac.uk.
X
X     ) readonly def
X  /FullName (ChessFont) readonly def
X  /version (2.0) readonly def
Xend def
X/UniqueID 472474 def
X
XEncoding
X0 1 255 { 2 copy /.notdef put pop } for
Xdup 8#040 /Wsquare put		% ' '
Xdup 8#042 /flap put		% '"'
Xdup 8#043 /board put		% '#'
Xdup 8#047 /flip put		% ''''
Xdup 8#052 /Bsquare put		% '*'
Xdup 8#055 /edge put		% '-'
Xdup 8#056 /blobfig put		% '.'
Xdup 8#057 /corner put		% '/'
Xdup 8#060 /m0 put		% '0'
Xdup 8#061 /Wsquare put		% '1'
Xdup 8#062 /m2 put		% '2'
Xdup 8#063 /m3 put		% '3'
Xdup 8#064 /m4 put		% '4'
Xdup 8#065 /m5 put		% '5'
Xdup 8#066 /m6 put		% '6'
Xdup 8#067 /m7 put		% '7'
Xdup 8#070 /m8 put		% '8'
Xdup 8#071 /m9 put		% '9'
Xdup 8#073 /nextline put		% ';'
Xdup 8#074 /m-1 put		% '<'
Xdup 8#076 /Wsquare put		% '>'
Xdup 8#100 /wblock put		% '@'
Xdup 8#102 /WB put		% 'B'
Xdup 8#103 /WC put		% 'C'
Xdup 8#104 /WD put		% 'D'
Xdup 8#105 /WE put		% 'E'
Xdup 8#106 /WF put		% 'F'
Xdup 8#107 /WG put		% 'G'
Xdup 8#111 /blob put		% 'I'
Xdup 8#113 /WK put		% 'K'
Xdup 8#114 /WL put		% 'L'
Xdup 8#115 /WM put		% 'M'
Xdup 8#116 /WN put		% 'N'
Xdup 8#117 /BO put		% 'O'
Xdup 8#120 /WP put		% 'P'
Xdup 8#121 /WQ put		% 'Q'
Xdup 8#122 /WR put		% 'R'
Xdup 8#123 /WS put		% 'S'
Xdup 8#124 /WT put		% 'T'
Xdup 8#125 /WU put		% 'U'
Xdup 8#126 /WV put		% 'V'
Xdup 8#130 /WX put		% 'X'
Xdup 8#132 /WZ put		% 'Z'
Xdup 8#133 /posstart put		% '['
Xdup 8#135 /posfinish put	% ']'
Xdup 8#137 /underbar put		% '_'
Xdup 8#142 /BB put		% 'b'
Xdup 8#143 /BC put		% 'c'
Xdup 8#144 /BD put		% 'd'
Xdup 8#145 /BE put		% 'e'
Xdup 8#146 /BF put		% 'f'
Xdup 8#147 /BG put		% 'g'
Xdup 8#151 /blob put		% 'i'
Xdup 8#153 /BK put		% 'k'
Xdup 8#154 /BL put		% 'l'
Xdup 8#155 /BM put		% 'm'
Xdup 8#156 /BN put		% 'n'
Xdup 8#157 /BO put		% 'o'
Xdup 8#160 /BP put		% 'p'
Xdup 8#161 /BQ put		% 'q'
Xdup 8#162 /BR put		% 'r'
Xdup 8#163 /BS put		% 's'
Xdup 8#164 /BT put		% 't'
Xdup 8#165 /BU put		% 'u'
Xdup 8#166 /BV put		% 'v'
Xdup 8#170 /BX put		% 'x'
Xdup 8#172 /BZ put		% 'z'
Xdup 8#174 /sidebar put		% '|'
Xdup 8#240 /Wsquare put		% ' '+
Xdup 8#241 /without put		% '!'+
Xdup 8#242 /flap put		% '"'+
Xdup 8#243 /board put		% '#'+
Xdup 8#245 /infinityequals put	% '%'+
Xdup 8#247 /flip put		% ''''+
Xdup 8#252 /circledot put	% '*'+
Xdup 8#253 /plus put		% '+'+
Xdup 8#255 /minus put		% '-'+
Xdup 8#272 /doubled put		% ':'+
Xdup 8#273 /nextline put		% ';'+
Xdup 8#274 /equalsplus put	% '<'+
Xdup 8#275 /equal put		% '='+
Xdup 8#276 /plusequals put	% '>'+
Xdup 8#277 /infinity put		% '?'+
Xdup 8#300 /circarrow put	% '@'+
Xdup 8#302 /Bfig put		% 'B'+
Xdup 8#303 /Cfig put		% 'C'+
Xdup 8#304 /Dfig put		% 'D'+
Xdup 8#305 /Efig put		% 'E'+
Xdup 8#306 /Ffig put		% 'F'+
Xdup 8#307 /Gfig put		% 'G'+
Xdup 8#311 /blobfig put		% 'I'+
Xdup 8#313 /Kfig put		% 'K'+
Xdup 8#314 /Lfig put		% 'L'+
Xdup 8#315 /Mfig put		% 'M'+
Xdup 8#316 /Nfig put		% 'N'+
Xdup 8#317 /Ofig put		% 'O'+
Xdup 8#320 /Pfig put		% 'P'+
Xdup 8#321 /Qfig put		% 'Q'+
Xdup 8#322 /Rfig put		% 'R'+
Xdup 8#323 /Sfig put		% 'S'+
Xdup 8#324 /Tfig put		% 'T'+
Xdup 8#325 /Ufig put		% 'U'+
Xdup 8#326 /Vfig put		% 'V'+
Xdup 8#330 /Xfig put		% 'X'+
Xdup 8#332 /Zfig put		% 'Z'+
Xdup 8#333 /minusorplus put	% '['+
Xdup 8#335 /plusorminus put	% ']'+
Xdup 8#336 /uparrow put		% '^'+
Xdup 8#341 /rightarrow put	% 'a'+
Xdup 8#342 /semicircle put	% 'b'+
Xdup 8#343 /centre put		% 'c'+
Xdup 8#344 /diags put		% 'd'+
Xdup 8#345 /etc put		% 'e'+
Xdup 8#346 /Phalo put		% 'f'+
Xdup 8#347 /samebs put		% 'g'+
Xdup 8#350 /edgefig put		% 'h'+
Xdup 8#351 /triangle put		% 'i'+
Xdup 8#352 /Bsquarefig put	% 'j'+
Xdup 8#353 /kside put		% 'k'+
Xdup 8#354 /line put		% 'l'+
Xdup 8#355 /hash put		% 'm'+
Xdup 8#356 /cornerfig put	% 'n'+
Xdup 8#357 /square put		% 'o'+
Xdup 8#360 /ending put		% 'p'+
Xdup 8#361 /qside put		% 'q'+
Xdup 8#362 /Pfill put		% 'r'+
Xdup 8#363 /separated put	% 's'+
Xdup 8#364 /tempo put		% 't'+
Xdup 8#365 /united put		% 'u'+
Xdup 8#366 /oppbs put		% 'v'+
Xdup 8#367 /with put		% 'w'+
Xdup 8#370 /weakpt put		% 'x'+
Xdup 8#371 /bpair put		% 'y'+
Xdup 8#372 /circlebolddot put	% 'z'+
X    8#374 /botharrow put	% '|'+
X
X/CharProcs 200 dict dup begin
X
X% Miscellaneous:
X	/.notdef { } bind def
X	/Arcto  { arcto 4 { pop } repeat } bind def
X	/Ddn3c  { dup dup neg 3 copy } bind def
X	/Round  { dtransform round exch round exch idtransform } bind def
X	/Rlineto { Round rlineto } bind def
X	/Rmoveto { Round rmoveto } bind def
X	/diamond { moveto dup neg 0 rmoveto dup dup neg rlineto
X		dup dup rlineto dup neg exch rlineto closepath } bind def
X	/dohalo { gsave 100 setlinewidth setW stroke grestore } bind def
X	/dofill { gsave fill grestore } bind def
X	/motion { 1000 mul exch 1000 mul exch setcharwidth } bind def
X	/setW	{ 1 setgray } bind def
X	/setB	{ 0 setgray } bind def
X	/drawingB { 0 currentgray eq } bind def
X	/setfig { 1000 0 0 -200 1000 800 setcachedevice 500 300 translate
X		} bind def
X	/setpce { 1000 0 setcharwidth 500 dup translate 0.95 dup scale
X		} bind def
X	/MiscStr (a) def
X	/tofig  { 0 get 8#200 add MiscStr exch 0 exch put MiscStr } bind def
X	/Tofig  { 1 0.95 div dup scale tofig } bind def
X	/intext true def
X	/flip	{ 0 0 setcharwidth /intext intext not def } bind def
X	/flap	{ 0 0 setcharwidth /intext true def } bind def
X	/Setfont { /ChessFont findfont 1000 scalefont setfont } bind def
X	/Show	{ rotate -500 dup moveto Setfont show } bind def
X	/Showfig { rotate -500 -300 moveto Setfont show } bind def
X	/LocStr (a) def
X	/SetChar {
X		dup 8#047 eq { pop flip stop } if
X		dup 8#200 lt { intext {
X			8#200 add LocStr exch 0 exch put
X			Setfont LocStr dup stringwidth setcharwidth
X			0 0 moveto show stop } if } if } bind def
X	/DoChar { Encoding exch get cvx exec } bind def
X
X% Kings
X	/WK {	setpce Kout dohalo setW dofill setB stroke Kin } bind def
X	/BK {	setpce Kout dohalo dofill stroke setW Kin } bind def
X	/Kfig { setfig Kout stroke Kin } bind def
X
X	/Kout {	2 setmiterlimit
X		325 -100 moveto 600 100 350 400 125 250 curveto
X		0 250 rlineto -250 0 rlineto 0 -250 rlineto
X		-350 400 -600 100 -325 -100 curveto 0 -250 rlineto
X		-100 -500 100 -500 325 -350 curveto closepath
X		30 setlinewidth } bind def
X	/Kin {	drawingB { 325 } { 275 } ifelse
X		Ddn3c -350 moveto 0 -300 3 -1 roll -350 800 Arcto
X		-350 lineto -100 moveto 0 -50 3 -1 roll
X		-100 800 Arcto -100 lineto
X		15 0 -185 diamond 15 -250 -210 diamond 15 250 -210 diamond
X		drawingB { 125 } { 75 } ifelse
X		Ddn3c dup dup 4 { 0 375 moveto rlineto } repeat
X		drawingB { 0 -45 moveto 125 250 lineto -250 0 rlineto
X			closepath } { 15 0 180 diamond 265 -95 moveto
X			480 150 280 380 50 -50 curveto -265 -95 moveto
X			-480 150 -280 380 -50 -50 curveto } ifelse
X		stroke } bind def
X
X% Queens
X	/WQ {	setpce Qout dohalo setW dofill setB stroke Qin } bind def
X	/BQ {	setpce Qout dohalo dofill stroke setW Qin } bind def
X	/Qfig { setfig Qout stroke Qin } bind def
X
X	/Qout {	2 setmiterlimit
X		0 75 moveto -150 440 50 -80 280 arc -250 25 lineto
X		-440 200 50 -60 300 arc -325 -100 lineto 0 -250 rlineto
X		-100 -500 100 -500 325 -350 curveto 0 250 rlineto
X		440 200 50 -120 240 arc 250 25 lineto 150 440 50 -100 260 arc
X		closepath 30 setlinewidth } bind def
X	/Qin {	drawingB { 325 } { 275 } ifelse
X		Ddn3c -350 moveto 0 -300 3 -1 roll -350 800 Arcto -350 lineto
X		-100 moveto 0 -50 3 -1 roll -100 800 Arcto -100 lineto
X		15 0 -185 diamond 15 -250 -210 diamond 15 250 -210 diamond
X		stroke } bind def
X
X% Rooks
X	/WR {	setpce Rout dohalo setW dofill setB stroke Rin } bind def
X	/BR {	setpce Rout dohalo dofill stroke setW Rin } bind def
X	/Rfig { setfig Rout stroke Rin } bind def
X
X	/Rout { -325 -450 moveto 650 0 rlineto 0 50 rlineto -100 175 rlineto
X		0 400 rlineto 50 75 rlineto 0 150 rlineto -86 0 rlineto
X		-30 -100 rlineto -86 0 rlineto -30 100 rlineto -86 0 rlineto
X		-30 -100 rlineto -86 0 rlineto -30 100 rlineto -86 0 rlineto
X		0 -150 rlineto 50 -75 rlineto 0 -400 rlineto -100 -175 rlineto
X		closepath 30 setlinewidth } bind def
X	/Rin {	drawingB { -225 } { -195 } ifelse
X		dup -225 moveto dup -2 mul 0 rlineto
X		dup 175 moveto -2 mul 0 rlineto stroke } bind def
X
X% Bishops
X	/WB {	Bsetpce Bout setW dofill setB stroke Bin } bind def
X	/BB {	Bsetpce Bout dofill stroke setW Bin } bind def
X	/Bfig { Bsetfig Bout stroke Bin } bind def
X
X	/Bsetpce { /Binpce true def setpce } bind def
X	/Bsetfig { /Binpce false def setfig } bind def
X	/Bout {	2 setmiterlimit
X		-400 -500 moveto 100 100 300 0 400 100 rcurveto
X		100 -100 300 0 400 -100 rcurveto 0 100 rlineto
X		-100 100 -300 0 -400 100 rcurveto
X		-100 -100 -300 0 -400 -100 rcurveto closepath
X		200 -350 moveto 0 200 rlineto
X		200 0 150 215 0 325 curveto -75 420 40 -90 270 arc
X		-340 100 -340 100 -200 -150 curveto 0 -200 rlineto
X		200 50 rlineto closepath 30 setlinewidth
X		gsave	0 325 moveto 150 215 200 0 200 -150 curveto
X			340 100 340 100 75 380 curveto 75 420 40 -90 270 arc
X			closepath Binpce { dohalo setW dofill setB } if stroke
X		grestore } bind def
X	/Bin {  15 0 -225 diamond
X		drawingB { 200 } { 150 } ifelse Ddn3c
X		-350 moveto 20 rlineto -20 rlineto -150 moveto
X		30 rlineto -30 rlineto stroke } bind def
X
X% Knights
X	/WN {	setpce Nout dohalo setW dofill setB stroke Nin } bind def
X	/BN {	setpce Nout dohalo dofill stroke setW Nin } bind def
X	/Nfig { setfig Nout stroke Nin } bind def
X
X	/Nout {	2 setmiterlimit
X		450 -450 moveto 450 200 150 350 -50 400 curveto
X		-25 100 rlineto -75 -200 rlineto -75 150 rlineto
X		0 -150 rlineto -125 -125 -325 -400 -275 -450 rcurveto
X		75 -75 rlineto 100 130 rlineto 0 -200 rlineto
X		50 -25 150 100 100 150 rcurveto 50 -50 150 75 125 150 rcurveto
X		125 -300 -250 -250 -250 -450 curveto
X		closepath 30 setlinewidth } bind def
X	/Nin {  15 -200 150 diamond stroke
X		drawingB {
X			[ 100 100 ] 0 setdash 410 -450 moveto
X			410 200 130 330 -60 380 curveto 50 setlinewidth
X			stroke } {
X			430 -430 moveto 430 200 150 350 -30 370 curveto
X			150 250 390 200 390 -430 curveto fill }
X		ifelse } bind def
X
X% Pawns
X	% Pawns are the only symbols which occur "frequently" in a chess
X	% diagram, so we make a special effort to optimise their caching
X	% behaviour.  Also, they are the only symbols for which this is
X	% easy!
X
X	/WP { setpce Setfont setW 0 0 moveto (f) tofig show setB (P) Tofig
X		-500 -300 rmoveto show } bind def
X	/BP { setpce Setfont setW 0 0 moveto (f) tofig show setB (r) tofig
X		show } bind def
X	/Pfig { setfig Pout stroke Pin } bind def
X
X	/Pout { 300 -450 moveto 200 -300  200 -300 75 -250 curveto
X		125 -50 125 -50 75 150 curveto 125 150 100 0 90 arc
X		0 300 100 -30 210 arc -125 150 100 90 180 arc
X		150 0 rlineto -125 -50 -125 -50 -75 -250 curveto
X		-200 -300 -200 -300 -300 -450 curveto
X		closepath 50 setlinewidth } bind def
X	/Pin { -75 150 moveto 150 0 rlineto stroke } bind def
X
X	/Phalo { 0 0 -350 -500 350 450 setcachedevice
X		Pout gsave 100 setlinewidth stroke grestore fill } bind def
X	/Pfill { 0 0 -325 -475 375 425 setcachedevice
X		Pout gsave stroke grestore fill } bind def
X
X% Fous
X	% There seem to be several styles of Fou (French Bishop) -- I have
X	% selected the easiest to implement.  Anyone who *really* wants
X	% this piece can do some work for themselves!
X
X	/WF {	setpce Fout dohalo setW dofill setB stroke Fin } bind def
X	/BF {	setpce Fout dohalo dofill stroke setW Fin } bind def
X	/Ffig { setfig Fout stroke Fin } bind def
X
X	/Fout { 2 setlinejoin
X		-300 -400 moveto 150 300 rlineto -250 500 rlineto
X		250 -125 rlineto 150 175 rlineto 150 -175 rlineto
X		250 125 rlineto -250 -500 rlineto 150 -300 rlineto
X		closepath 30 setlinewidth } bind def
X
X	/Fin {  0 -400 150 dup mul 675 dup mul add sqrt
X		drawingB { 600 300 } { 30 sub 600 270 } ifelse
X		atan dup 180 sub neg arc
X		400 drawingB not { 15 5 sqrt mul add } if
X		dup neg 400 moveto dup dup -2 mul rlineto dup 2 mul rlineto
X		30 -100 150 diamond 30 100 150 diamond
X		0 175 moveto 0 -200 rlineto currentpoint stroke
X		75 210 330 arc stroke } bind def
X
X% Miscellaneous Fairy pieces
X
X    % Grasshopper
X	/WG {	setpce (Q) 180 Show } bind def
X	/BG {	setpce (q) 180 Show } bind def
X	/Gfig { setfig (Q) tofig 180 Showfig } bind def
X
X    % Nightrider.  Real problemists use S for Knight and N for Nightrider;
X    %	    the weight of tradition forces N for Knight, hence S here.
X	/WS {	setpce (N) 180 Show } bind def
X	/BS {	setpce (n) 180 Show } bind def
X	/Sfig { setfig (N) tofig 180 Showfig } bind def
X
X    % Zebra
X	/WZ {	setpce (N) -90 Show } bind def
X	/BZ {	setpce (n) -90 Show } bind def
X	/Zfig { setfig (N) tofig -90 Showfig } bind def
X
X    % Mao.  Also Camel, but C is for Chameleon.
X	/WM {	setpce (N) 90 Show } bind def
X	/BM {	setpce (n) 90 Show } bind def
X	/Mfig { setfig (N) tofig 90 Showfig } bind def
X
X    % Vao
X	/WV {	setpce (B) 90 Show } bind def
X	/BV {	setpce (b) 90 Show } bind def
X	/Vfig { setfig (B) tofig 90 Showfig } bind def
X
X    % Equihopper
X	/WE {	setpce (Q) -90 Show } bind def
X	/BE {	setpce (q) -90 Show } bind def
X	/Efig { setfig (Q) tofig -90 Showfig } bind def
X
X    % Leo.  Also Locust, Lion, Edgehog
X	/WL {	setpce (Q) 90 Show } bind def
X	/BL {	setpce (q) 90 Show } bind def
X	/Lfig { setfig (Q) tofig 90 Showfig } bind def
X
X    % Pao.  Also Empress.  Sorry, all Uther mnemonics seemed to be used Up.
X	/WU {	setpce (R) 90 Show } bind def
X	/BU {	setpce (r) 90 Show } bind def
X	/Ufig { setfig (R) tofig 90 Showfig } bind def
X
X    % Orphan -- NB, all Orphans are black!
X	/BO {	setpce (p) 90 Show } bind def
X	/Ofig { setfig 90 rotate Pout dofill stroke } bind def
X
X    % Rose.  Gardeners will know why T is mnemonic for this.
X	/WT {	setpce Tout dohalo setW dofill setB stroke Tin } bind def
X	/BT {	setpce Tout dohalo dofill stroke setW Tin } bind def
X	/Tfig { setfig Tout stroke Tin } bind def
X
X	/Tout { 300 2 sqrt 1 sub mul
X		8 { dup 300 exch dup -90 135 arc 45 rotate } repeat
X		pop 50 setlinewidth } bind def
X	/Tin {  drawingB { 270 } { 300 } ifelse
X		8 { dup 0 0 moveto 0 lineto 45 rotate } repeat
X		pop stroke } bind def
X
X    % Chameleon
X	/WC {	setpce Cout dohalo setW dofill setB stroke } bind def
X	/BC {	setpce Cout dohalo dofill stroke } bind def
X	/Cfig { setfig Cout stroke } bind def
X
X	/Cout { 2 setmiterlimit 50 setlinewidth
X		-250 -350 moveto 500 0 rlineto -500 700 rlineto
X		500 0 rlineto closepath } bind def
X
X    % Blob [for marking squares], also for Imitator
X	/blob { setpce 0 0 250 0 360 arc dohalo dofill } bind def
X	/blobfig { setfig 0 200 250 0 360 arc dofill } bind def
X
X% Draughts/Dame/Checkers pieces
X
X    % Man
X	/WD {	setpce Dout dohalo setW dofill setB stroke Din } bind def
X	/BD {	setpce Dout dohalo dofill stroke setW Din } bind def
X	/Dfig { setfig Dout stroke Din } bind def
X
X	/Dout { 1 0.5 scale 0 0 350 0 180 arc 0 -400 350 180 0 arc
X		closepath 50 setlinewidth } bind def
X	/Din {  0 0 350 drawingB { 180 0 } { 210 -30 20 setlinewidth }
X		ifelse arc stroke 20 setlinewidth 0 0 220 0 360 arc stroke
X		0 0 80 0 360 arc stroke } bind def
X
X    % King.  The mnemonic for this is unknown.
X	/WX {	setpce Xout dohalo setW dofill setB stroke Xin } bind def
X	/BX {	setpce Xout dohalo dofill stroke setW Xin } bind def
X	/Xfig { setfig Xout stroke Xin } bind def
X
X	/Xout { 1 0.5 scale 0 400 350 0 180 arc 0 -400 350 180 0 arc
X		closepath 50 setlinewidth } bind def
X	/Xin {  0 400 350 drawingB { 180 0 } { 210 -30 20 setlinewidth }
X		ifelse arc stroke 0 0 350 drawingB { 180 0 } { 210 -30 }
X		ifelse arc stroke 20 setlinewidth 0 400 220 0 360 arc stroke
X		0 400 80 0 360 arc stroke } bind def
X
X% Board symbols
X
X	/Wsquare { 1 0 motion } bind def
X	/Bsquare { setpce (j) Tofig 90 Show } bind def
X	/Bsquarefig { 1000 0 0 0 1000 1000 setcachedevice
X		/xpix 62.5 dup dtransform /ypix exch def def
X		/xpabs xpix abs def /ypabs ypix abs def
X		xpabs ypabs lt {
X			ypabs ceiling dup 4 lt { pop 4 } if
X			dup ypix div xpix mul exch } {
X			xpabs ceiling dup 4 lt { pop 4 } if
X			dup xpix div ypix mul } ifelse
X		idtransform pop abs dup 3 div setlinewidth dup 2 mul 2000
X		{ dup 1000 lt { dup 0 moveto 0 exch lineto }
X			{ 1000 sub dup 1000 moveto 1000 exch lineto }
X			ifelse } for stroke } bind def
X	/board { 10000 0 800 0 9200 8400 setcachedevice
X%		Setfont intext /intext dup true def 1000 8200 moveto
X%		4 { (hhhhhhhhn) show currentpoint translate -90 rotate } repeat
X%		-90 rotate 0 7000 moveto
X%	The above was the intention, but the borders sometimes fail to match
X%	up by a pixel or two.  Hence the following!  However, the borders
X%	work perfectly well for special purposes.
X		Setfont intext /intext dup true def
X		20 setlinewidth 940 140 moveto 8120 0 Rlineto 0 8120 Rlineto
X		-8120 0 Rlineto closepath stroke
X		80 setlinewidth 840 40 moveto 8320 0 Rlineto 0 8320 Rlineto
X		-8320 0 Rlineto closepath stroke
X		2000 200 moveto 90 rotate
X		4 { (j j j j ; j j j j;) show } repeat exch def } bind def
X	/nextline { -8 -1 motion } bind def
X	/edge { setpce (h) Tofig 0 Show } bind def
X	/edgefig { 1000 0 0 0 1000 200 setcachedevice
X		20 setlinewidth 0 60 moveto 1000 0 rlineto stroke
X		80 setlinewidth 0 160 moveto 1000 0 rlineto stroke } bind def
X	/corner { setpce (n) Tofig 0 Show } bind def
X	/cornerfig { 0 0 0 0 200 200 setcachedevice
X		20 setlinewidth 0 60 moveto 60 0 rlineto 0 -60 rlineto stroke
X		80 setlinewidth 0 160 moveto 160 0 rlineto 0 -160 rlineto
X		stroke } bind def
X	/posstart { -9 7.2 motion } bind def
X	/posfinish { 1 -0.2 motion } bind def
X	/m0 { 0.5 dup motion } bind def
X	/m2 { 2 0 motion } bind def
X	/m3 { 3 0 motion } bind def
X	/m4 { 4 0 motion } bind def
X	/m5 { 5 0 motion } bind def
X	/m6 { 6 0 motion } bind def
X	/m7 { 7 0 motion } bind def
X	/m8 { 8 0 motion } bind def
X	/m9 { 0 1 motion } bind def
X	/m-1 { -1 0 motion } bind def
X	/underbar { 1000 0 -40 -40 1040 40 setcachedevice 80 setlinewidth
X		1 setlinecap 0 0 moveto 1000 0 lineto stroke } bind def
X	/sidebar { 0 0 setcharwidth 80 setlinewidth
X		1 setlinecap 0 0 moveto 0 1000 lineto stroke } bind def
X	/wblock { 0 0 setcharwidth setW
X		200 200 moveto 600 0 rlineto 0 600 rlineto -600 0 rlineto
X		fill } bind def
X
X% Informant symbols
X
X	/plusequals { 1000 0 100 0 900 800 setcachedevice 20 setlinewidth
X		100 10 moveto 800 0 rlineto 0 140 Rmoveto -800 0 rlineto
X		0 300 Rmoveto 800 0 rlineto 500 150 moveto 0 650 rlineto
X		stroke } bind def
X
X	/equalsplus { 1000 0 100 0 900 800 setcachedevice 20 setlinewidth
X		100 790 moveto 800 0 rlineto 0 -140 Rmoveto -800 0 rlineto
X		0 -300 Rmoveto 800 0 rlineto 500 0 moveto 0 650 rlineto
X		stroke } bind def
X
X	/plusorminus { 1000 0 100 0 900 800 setcachedevice 30 setlinewidth
X		100 15 moveto 800 0 rlineto 0 385 Rmoveto -800 0 rlineto
X		500 0 moveto 0 800 rlineto stroke } bind def
X
X	/minusorplus { 1000 0 100 0 900 800 setcachedevice 30 setlinewidth
X		100 785 moveto 800 0 rlineto 0 -385 Rmoveto -800 0 rlineto
X		500 0 moveto 0 800 rlineto stroke } bind def
X
X	/plus { 1000 0 100 0 900 800 setcachedevice 30 setlinewidth
X		100 400 moveto 800 0 rlineto 500 0 moveto 0 800 rlineto
X		stroke } bind def
X
X	/minus { 1000 0 100 385 900 415 setcachedevice 30 setlinewidth
X		100 400 moveto 800 0 rlineto stroke } bind def
X
X	/equal { 1000 0 100 300 800 180 Round
X		320 add exch 100 add exch setcachedevice 20 setlinewidth
X		100 310 moveto 800 0 rlineto 0 180 Rmoveto -800 0 rlineto
X		stroke } bind def
X
X	/infinity { 1000 0 95 60 905 540 setcachedevice 40 setlinewidth
X		275 300 160 0 360 arc 660 300 225 -180 180 arc stroke
X		} bind def
X
X	/infinityequals { 1000 0 95 10 905 750 setcachedevice 30 setlinewidth
X		275 250 160 0 360 arc 660 250 225 -180 180 arc
X		100 565 moveto 800 0 rlineto 0 180 Rmoveto -800 0 rlineto
X		stroke } bind def
X
X	/circarrow {1000 0 100 0 900 800 setcachedevice 30 setlinewidth
X		500 400 385 0 30 arcn -200 0 rmoveto 200 0 rlineto
X		0 200 rlineto stroke } bind def
X
X	/circledot { 900 0 100 0 800 700 setcachedevice 20 setlinewidth
X		450 350 20 0 360 arc fill 450 350 340 0 360 arc stroke
X		} bind def
X
X	/rightarrow { 1200 0 100 185 1115 615 setcachedevice 30 setlinewidth
X		100 400 moveto 1000 0 rlineto -200 -200 rmoveto 200 200 rlineto
X		-200 200 rlineto stroke } bind def
X
X	/uparrow { 500 0 35 0 465 915 setcachedevice 30 setlinewidth
X		250 0 moveto 0 900 rlineto -200 -200 rmoveto 200 200 rlineto
X		200 -200 rlineto stroke } bind def
X
X	/botharrow { 1200 0 100 70 1100 730 setcachedevice 20 setlinewidth
X		100 280 moveto 990 0 rlineto -200 -200 rmoveto 200 200 rlineto
X		-200 200 rlineto 1100 520 moveto -990 0 rlineto
X		200 -200 rmoveto -200 200 rlineto 200 200 rlineto
X		stroke } bind def
X
X	/circlebolddot { 1000 0 100 0 900 800 setcachedevice 20 setlinewidth
X		500 400 50 0 360 arc fill 500 400 390 0 360 arc stroke
X		} bind def
X
X	/hash { 1000 0 100 0 900 800 setcachedevice 30 setlinewidth
X		100 280 moveto 800 0 rlineto 0 240 Rmoveto -800 0 rlineto
X		380 0 moveto 0 800 rlineto 240 0 Rmoveto 0 -800 rlineto
X		stroke } bind def
X
X	/triangle { 900 0 100 0 800 750 setcachedevice 30 setlinewidth
X		100 15 moveto 350 735 rlineto 350 -735 rlineto
X		closepath stroke } bind def
X
X	/square { 900 0 100 0 680 680 Round
X		20 add exch 120 add exch setcachedevice 20 setlinewidth
X		110 10 moveto 680 0 Rlineto 0 680 Rlineto
X		-680 0 Rlineto closepath stroke } bind def
X
X	/semicircle { 1000 0 50 0 950 465 setcachedevice 30 setlinewidth
X		500 15 435 0 180 arc closepath stroke } bind def
X
X	/line { 1000 0 100 190 900 610 setcachedevice 20 setlinewidth
X		220 300 moveto 560 0 rlineto 0 200 Rmoveto -560 0 rlineto
X		310 200 moveto -200 200 rlineto 200 200 rlineto
X		690 200 moveto 200 200 rlineto -200 200 rlineto
X		stroke } bind def
X
X	/diags { 1000 0 100 0 900 800 setcachedevice 20 setlinewidth
X		110 120 moveto 670 dup rlineto 110 -110 Rmoveto
X		-670 dup rlineto 640 790 moveto 250 0 rlineto
X		0 -250 rlineto stroke } bind def
X
X	/centre { 1000 0 100 0 780 780 Round
X		20 add exch 120 add exch setcachedevice 20 setlinewidth
X		110 10 moveto 780 0 Rlineto 0 780 Rlineto -780 0 Rlineto
X		closepath 110 400 moveto 780 0 rlineto 500 10 moveto
X		0 780 Rlineto stroke } bind def
X
X	/kside { 700 0 100 0 600 800 setcachedevice 20 setlinewidth
X		110 10 moveto 300 390 rlineto -300 390 rlineto
X		180 0 Rmoveto 300 -390 rlineto -300 -390 rlineto
X		stroke } bind def
X
X	/qside { 700 0 100 0 600 800 setcachedevice 20 setlinewidth
X		590 10 moveto -300 390 rlineto 300 390 rlineto
X		-180 0 Rmoveto -300 -390 rlineto 300 -390 rlineto
X		stroke } bind def
X
X	/weakpt { 700 0 100 0 600 500 setcachedevice 30 setlinewidth
X		110 10 moveto 480 480 rlineto 590 10 moveto -480 480 rlineto
X		stroke } bind def
X
X	/ending { 1000 0 100 0 900 800 setcachedevice 30 setlinewidth
X		100 15 moveto 800 0 rlineto 500 0 moveto 0 800 rlineto
X		stroke } bind def
X
X	/bpair { 1200 0 100 0 980 580 Round
X		20 add exch 120 add exch setcachedevice 20 setlinewidth
X		110 10 moveto 570 0 Rlineto 0 370 Rlineto -570 0 Rlineto
X		closepath 110 10 moveto 980 580 Rmoveto -570 0 Rlineto
X		0 -370 Rlineto 570 0 Rlineto closepath stroke } bind def
X
X	/oppbs { 1200 0 100 0 1100 600 setcachedevice 20 setlinewidth
X		110 10 moveto 570 0 Rlineto 0 370 Rlineto -570 0 Rlineto
X		closepath stroke 1100 600 moveto -590 0 rlineto
X		0 -390 rlineto 590 0 rlineto fill } bind def
X
X	/samebs { 1200 0 100 0 1100 600 setcachedevice
X		100 0 moveto 590 0 rlineto 0 390 rlineto -590 0 rlineto
X		closepath 1100 600 moveto -590 0 rlineto 0 -390 rlineto
X		590 0 rlineto fill } bind def
X
X	/united { 1210 0 50 0 1160 530 setcachedevice 30 setlinewidth
X		315 265 250 0 360 arc stroke 895 265 250 0 360 arc
X		stroke } bind def
X
X	/separated { 1550 0 50 0 1500 530 setcachedevice 30 setlinewidth
X		315 265 250 0 360 arc stroke 1235 265 250 0 360 arc stroke
X		665 30 60 0 360 arc fill 885 30 60 0 360 arc fill } bind def
X
X	/doubled { 730 0 100 0 630 1160 setcachedevice 30 setlinewidth
X		365 265 250 0 360 arc stroke 365 895 250 0 360 arc
X		stroke } bind def
X
X	/tempo { 1000 0 100 0 900 800 setcachedevice 20 setlinewidth
X		110 400 moveto 500 400 390 0 360 arc 500 10 moveto
X		0 790 rlineto stroke } bind def
X
X	/with { 1000 0 100 0 900 800 setcachedevice 30 setlinewidth
X		100 800 moveto 0 -785 rlineto 785 0 rlineto stroke } bind def
X
X	/without { 1000 0 100 0 900 800 setcachedevice 30 setlinewidth
X		100 15 moveto 785 0 rlineto 0 785 rlineto stroke } bind def
X
X	/etc { 500 0 100 0 270 800 Round
X		exch 130 add exch setcachedevice 30 setlinewidth
X		115 0 moveto 0 800 rlineto 270 0 Rmoveto 0 -800 rlineto
X		stroke } bind def
Xend def
X
X/BuildChar { exch begin CharProcs begin
X	{ SetChar } stopped not { DoChar } if
X	end end } bind def
Xend def
X
X/ChessFont Cfont definefont pop
END_OF_Font
if test 24871 -ne `wc -c <Font`; then
    echo shar: \"Font\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f Demo -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"Demo\"
else
echo shar: Extracting \"Demo\" \(8827 characters\)
sed "s/^X//" >Demo <<'END_OF_Demo'
X% Demo file to be appended to the Chess Font file & sent to your LaserWriter
X%	(or whatever else you do with PostScript!).
X
X% Miscellaneous useful procedures:
X
X	% show string centred on the current point
X/cshow { dup stringwidth -2 div exch -2 div exch rmoveto show } bind def
X
X	% Draw rank and file labels round a standard diagram
X	%   On entry, the ChessFont must be currently selected,
X	%   and the (properly scaled) font desired for the labels
X	%   must be top of stack.  Uses "cshow", defined above
X/dolabels {
X	('[<0) show			% position of top-left label
X	(0) stringwidth -1.5 div	% 1/3-square offset
X	0 exch rmoveto exch		% restore labelfont to top of stack
X	[(8)(7)(6)(5)(4)(3)(2)(1)]	% rank labels
X	{ gsave exch			% stack == offset, label, labelfont
X		dup setfont exch cshow
X	  grestore
X	  (8;) show			% move down a rank
X	} forall
X	[(a)(b)(c)(d)(e)(f)(g)(h)]	% file labels
X	{ (>) show			% move along a file
X	  gsave exch			% as before
X		dup setfont exch cshow
X	  grestore
X	} forall pop			% zap the labelfont
X	(0]') show			% move to RHS of board
X	1.5 div 0 exch rmoveto		% undo previous offset
X} bind def
X
X	% Rotate a piece.  The piece [eg "(Q)"] and the desired rotation
X	%   (in degrees, anticlockwise) should be on the stack
X/twirl {
X	gsave			% keep graphics state
X		(0) show	% go to centre of square
X		rotate		% no of degrees was on stack
X		(07;) show	% back to bottom left of rotated square --
X				% "0" takes us from centre to top right, "7"
X				% advances 7 squares, ";" goes down one and
X				% back 8
X		show		% string was on stack
X	grestore		% restore graphics state
X	( ) show		% advance to next square
X} bind def
X
X	% Draw a neutral piece (for Fairy chess).  Expects two strings
X	%   [eg. "(R) (r)"] on the stack;  the first will be drawn in
X	%   the left half of the square, the second in the right half.
X/neutral {
X	2 dict begin			% small dictionary for xinc, yinc
X	gsave				% keep graphics state
X		(0) stringwidth		% distance to centre of square
X		/yinc exch 2 mul def
X		/xinc exch def
X		currentpoint
X		xinc 0 rlineto		% draw clipping rectangle round
X		0 yinc rlineto		% left half of square
X		xinc neg 0 rlineto clip
X		moveto show		% show left half-piece
X	grestore gsave			% cancel clip
X		currentpoint
X		xinc 0 rmoveto
X		xinc 0 rlineto		% clip right half of square
X		0 yinc rlineto
X		xinc neg 0 rlineto clip
X		moveto show		% show right half-piece
X	grestore			% restore graphics state
X	( ) show			% advance to next square
X	end				% close small dictionary
X} bind def
X
X% End of generally useful procedures.
X
X% Quick hack definitions for this file:
X
X% Miscellaneous definitions:
X
X/ps 10.5 def		% point size
X/vs 12.5 def		% vertical spacing
X/V 11 72 mul def	% top margin
X/L 40 def		% left margin
X
X/N { L V vs sub dup /V exch def moveto } bind def	% newline
X/T { currentpoint exch L sub 6 add 36 div ceiling 36 mul L add exch moveto }
X	bind def	% tab
X
X	% Switch into Chess/Times/Courier/Bold
X/C { /ChessFont findfont ps scalefont setfont } bind def
X/R { /Times-Roman findfont ps scalefont setfont } bind def
X/H { /Courier findfont ps scalefont setfont } bind def
X/B { /Times-Bold findfont ps 1.25 mul scalefont setfont } bind def
X
X	12345		% pseudo-random item on stack, as check
X
X% demo 1 -- ordinary game, including diagram.
X% (start of demo 1) = flush
X
X/dostrings {	% expects an array of strings on the stack, and shows
X		% alternating Chess and Roman (starting Roman!) followed
X		% by newline.  Too simplistic for real use, but meets
X		% needs of this demo.
X	/oldfont C currentfont def R
X	{ show /oldfont currentfont oldfont setfont def } forall N } bind def
X
XB N (Ordinary game using figurines, including diagram) show N N
XR (Boudy vs. Szabo, Varna 1979, see Informant XXVII game 452) show N N
X[ (1. e4 c5 2. ) (N) (f3 ) (N) (c6 3. d4 cd4 4. ) (N) (d4 ) (N)
X  (f6 5. ) (N) (c3 d6 6. f4 a6 7. ) (N) (c6 bc6) ] dostrings
X[ (8. e5 ) (N) (d7 9. ed6 ed6 10. ) (Q) (f3 d5 11. ) (B)
X  (d2 ) (B) (d6 12. 0-0-0 0-0 13. g4 ) (B) (b7?!) ] dostrings
X[ ([13. . . ) (R) (b8!?) (?) (] 14. ) (R) (g1 ) (R)
X  (e8 15. g5 f5?! [15. . . ) (N) (c5] 16. g6 h6 17. ) (B) (d3?!) ] dostrings
X[ ([) (B) (h3!) (]) (] ) (R) (f8 18. ) (Q) (h3 ) (Q)
X  (f6 19. ) (R) (g5 ) (N) (c5 20. ) (B)
X  (f5 ) (B) (c8! 21. ) (B) (c8 ) (R) (ac8) ] dostrings
X[ (22. ) (R) (g4 ) (R) (b8) (%) ( 23. ) (R) (f1 ) (N)
X  (e4) (a) ( 24. ) (B) (e1 (see diagram) ) ] dostrings
X[ (24. . . ) (R) (b2!! 25. ) (K) (b2 [25. ) (N) (e4 de4 26. )
X  (B) (c3 ) (B) (a3! 27. ) (B) (f6 ) (R) (b3) ([p)
X  (] ) (B) (a3! ) ] dostrings
X[ (26. ) (K) (a3 [26. ) (K) (a1 ) (R) (b8) (-+) (] )
X  (R) (b8) (-+) ( 27. ) (N) (e4 ) (Q) (e7?? [27. . . ) (Q)
X  (b2 28. ) (K) (a4) ] dostrings
X[ () (Q) (a2 29. ) (Q) (a3 ) (Q) (c2 30. ) (K) (a5 ) (R) (b5  31. ) (K)
X  (a6 ) (Q) (e4 ) (i) ( ) (Q) (e8-a8) (-+) (] 28. ) (N) (d6!) ] dostrings
X[ ([28. ) (K) (a4 ) (Q) (e4) (-+) (] ) (Q) (d6 29. ) (K) (a4 c5 30. )
X  (R) (h4 [) (b) (30. ) (R) (g1 c4 31. ) (Q) (c3 ) (Q) (d7 32.) ] dostrings
X[ () (K) (a3 ) (Q) (d6 33. ) (Q) (e4) (-+) (] c4 31. ) (Q) (c3 ) (Q)
X  (d7 32. ) (K) (a3 ) (Q) (e7 33. ) (Q) (b4!) (+-) ( ) (R) (b4) ] dostrings
XT T T T T T T T T T /ps 15 def C
X('#[1r3rk1;6p1;p1pb1qPp;3p4;4nPR1;2N4Q;PPP4P;2K1BR2]') show
Xcurrentpoint exch pop L exch moveto
X/ps 10.5 def
X[ (34. ) (B) (b4 ) (Q) (h4 35. ) (R) (e1 ) (Q) (d8) (o)
X  ( 36. c3! a5 37. ) (B) (c5) ] dostrings
XR (etc.  White won (somewhat luckily in the end) on move 75.) show N
X
X% demo 2 -- some special effects -- a rotated piece, a neutral piece,
X%		and an annotated square
X% (start of demo 2) = flush
X
XB N N
X(Special effects (rotated pieces, neutral pieces, annotated square)) show N
X
X	/ps 15 def /vs 15 def C N T
X		('* * * * *) show N T
X		( * * * *<<<<<<<) show
X		(R) 45 twirl		% white rook rotated thro' 45 degrees
X		(p) -90 twirl		% black pawn thro' 90 deg clockwise
X		( ) show		% blank square
X		(r) (R) neutral		% neutral rook
X		(e) (E) neutral		% neutral equihopper
X		( ) show		% blank square
X		gsave			% keep graphics state
X			(@0) show	% clear centre of square & move to it
X			0 -3.5 rmoveto R % go down a bit & switch to Roman
X			0.7 dup scale	% a bit smaller!
X			(3) cshow	% put a "3" in middle of square
X		grestore		% back to previous state
X		N T (* * * * *') show N
X	/ps 10.5 def /vs 12.5 def N
X
X% demo 3 -- ruled boards, partial and labelled boards and symbols
X% (start of demo 3) = flush
X
XB N N
X(Ruled boards, partial boards, labelled boards and symbols) show N
X
X	/ps 15 def /vs 15 def		% define sensible point size
X	C N N N N N N N N N T		% switch to chess font & leave space
X
X		% board including ruled lines:
X	('#[2Q5;8;8;___5;K2|__3;5|3;1kp2|3;5|3]') show
X
X	T /X currentpoint /Y exch def def	% remember position
X	N N /ps 10.5 def /vs 12.5 def R		% Roman font for text
X	T (White to play wins if his king is in) show N
X	T (the marked-off area) show N
X
X	/L X def /V Y def			% remembered position
X	/X currentpoint /Y exch def def		% remember this position
X	L V moveto /ps 15 def /vs 15 def C	% go back & use chess font
X
X% (demo 3b) = flush
X		% partial board including bullets:
X			% (this could also be done using a clipping region)
X	('[8;8;8;8;8;83* *K) show (-) -90 twirl % see above for "twirl"
X	(;2* *.*) show (-) -90 twirl
X	(;3*<. *<k ) show (-) -90 twirl
X	(;2) show 5 { (-) 180 twirl } repeat (/) -90 twirl
X	(<9]') show
X	T /XX currentpoint /YY exch def def	% remember this position
X	N N /ps 10.5 def /vs 12.5 def R		% Roman for text
X	(Mate if White's queen is) show N
X	(on either marked square) show
X
X	/thisfont currentfont def		% remember font for labels
X	/L XX def /V YY def			% go to remembered position
X	L V moveto /ps 15 def /vs 15 def C	% and switch to chess font
X
X% (demo 3c) = flush
X	('#[1x2|4;2X1|1kpK;3D|4;d3|1P1G;4|4;D3|1R1S;4|4;4|4]') show
X	thisfont dolabels
X
X	N N /ps 10.5 def /vs 12.5 def R		% Roman for text
X	(L:  draughts/dame/checkers position) show N
X	(R:  quadruple check after ... g5; fxg ep) show
X
X	/L X def /V Y def N		% return to remembered position
X
X% demo 4 -- small and rotated boards
X% (start of demo 4) = flush
X
XB N N
X(Small and rotated boards) show N
X
X	N N N N N N N N T		% make some space
X	C ('#[rnbqkbnr;pppppppp;8;8;8;8;PPPPPPPP;RNBQKBNR]') show
X% (demo 4b) = flush
X	/ps 7 def			% go to 7-point type
X	C ('#[rnbqkbnr;pppppppp;8;8;8;8;PPPPPPPP;RNBQKBNR]') show
X% (demo 4c) = flush
X	T gsave
X		currentpoint translate 45 rotate
X		('#[8;8;8;4) show	% partial position -- current point
X			% is now geometric centre of board.  Set larger scale
X			% with font back upright, and draw B centred on this.
X		currentpoint translate -45 rotate 6 6 scale
X		(0;7b') show
X	grestore
X	T T /ps 4 def
X% (demo 4d) = flush
X	C ('#[rnbqkbnr;pppppppp;8;8;8;8;PPPPPPPP;RNBQKBNR]') show
X	T T /ps 10.5 def
X% (demo 4e) = flush
X	gsave
X		currentpoint translate 45 rotate
X		C ('#[rnbqkbnr;pppppppp;8;8;8;8;PPPPPPPP;RNBQKBNR]') show
X	grestore
X	N
X
X	12345 ne { bungle! } if		% check that stack is restored
X
Xshowpage
END_OF_Demo
if test 8827 -ne `wc -c <Demo`; then
    echo shar: \"Demo\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f Table -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"Table\"
else
echo shar: Extracting \"Table\" \(4220 characters\)
sed "s/^X//" >Table <<'END_OF_Table'
X/ps 10.5 def /vs 12.5 def
X/C { /ChessFont findfont ps scalefont setfont } bind def
X/R { /Times-Roman findfont ps scalefont setfont } bind def
X/H { /Courier findfont ps scalefont setfont } bind def
X/B { /Times-Bold findfont ps 1.25 mul scalefont setfont } bind def
X40 vs mul dup /V exch def /L 80 def
X/cshow { dup stringwidth pop -2 div 0 rmoveto show } bind def
X/T { currentpoint exch L sub 6 add 36 div ceiling 36 mul L add exch moveto }
X	bind def
X/N { L V vs sub dup /V exch def moveto } bind def
X/do { exch dup C cshow T H cshow T R show N } bind def
X
X/title { R N (To get) cshow T (type) cshow T (meaning ...) show N N } bind def
X
XL 50 sub V moveto B (Symbols in text mode:) show N
Xtitle
X(A) () do
X(B) (bishop figurine) do
X(C) (chameleon figurine) do
X(D) (draughts/dame/checkers figurine) do
X(E) (equihopper figurine) do
X(F) (fou figurine) do
X(G) (grasshopper figurine) do
X(H) () do
X(I) (imitator figurine) do
X(J) () do
X(K) (king figurine) do
X(L) (leo figurine) do
X(M) (mao figurine) do
X(N) (knight figurine) do
X(O) (orphan figurine) do
X(P) (pawn figurine) do
X(Q) (queen figurine) do
X(R) (rook figurine) do
X(S) (nightrider figurine) do
X(T) (rose figurine) do
X(U) (pao figurine) do
X(V) (vao figurine) do
X(W) () do
X(X) (draughts king figurine) do
X(Y) () do
X(Z) (zebra figurine) do
XN T H (') cshow T R (flip between text and diagram modes) show
XN T H (") cshow T R (reset to text mode) show N N
X(w) (with) do
X(!) (without) do
X(e) (etc.) do
X
X/V exch def /L L 280 add def N title
X
X(>) (W slightly better) do
X(<) (B slightly better) do
X(]) (W better) do
X([) (B better) do
X(+-) (W decisive advantage) do
X(-+) (B decisive advantage) do
X(=) (level) do
X(?) (unclear) do
X(%) (with compensation) do
X(@) (development advantage) do
X(*) (space advantage) do
X(a) (with an attack) do
X(^) (with initiative) do
X(|) (with counterplay) do
X(z) (zugzwang) do
X(m) (mate) do
X(i) (with the idea) do
X(o) (only move) do
X(b) (better is) do
X(l) (line (file)) do
X(d) (diagonals) do
X(c) (centre) do
X(k) (king's side) do
X(q) (queen's side) do
X(x) (weak point) do
X(p) (ending) do
X(y) (pair of bishops) do
X(v) (opposite coloured bishops) do
X(g) (same coloured bishops) do
X(u) (united pawns) do
X(s) (separated pawns) do
X(:) (doubled pawns) do
X(t) (tempo) do
X
X/V 800 def /L 30 def N B (Symbols in diagram mode:) show N
X/ps 15 def /vs C ('K') stringwidth pop def
XN vs -2 div 6 rmoveto
X/S { currentpoint exch vs add exch moveto dup cshow
X	stringwidth pop -2 div 0 rmoveto } bind def
X/ps 10.5 def R () S
X(a) S (b) S (c) S (d) S (e) S (f) S (g) S (h) S (i) S (j) S
X(k) S (l) S (m) S (n) S (o) S (p) S (q) S (r) S (s) S (t) S
X(u) S (v) S (w) S (x) S (y) S (z) S (.) S (_) S (@) S
Xvs -2 div 0 rmoveto (|) cshow N
X/ps 15 def C
X
X%	On my LW+, undefined characters appear to be printed as blanks
X% with the width of the preceding character.  I'm not sure whether this
X% is "universal" behaviour.  If the following comes out crammed up too
X% far to the left, try replacing A,a,H,h,J,j,W,w,Y,y by spaces in the
X% "alphabet" strings.
X
X('>* * * * * * * * * * * * * * *) show L V moveto
X(>abcdefghijklmnopqrstuvwxyz._|@) show N
X(> * * * * * * * * * * * * * *) show L V moveto
X(>abcdefghijklmnopqrstuvwxyz.) show N
X(>* * * * * * * * * * * * * * *) show N
X(> * * * * * * * * * * * * * *) show L V moveto
X(>ABCDEFGHIJKLMNOPQRSTUVWXYZ._) show N
X(>* * * * * * * * * * * * * * *) show L V moveto
X(>ABCDEFGHIJKLMNOPQRSTUVWXYZ.>|@) show N
X/ps 10.5 def vs -2 div 0 rmoveto R () S
X(A) S (B) S (C) S (D) S (E) S (F) S (G) S (H) S (I) S (J) S
X(K) S (L) S (M) S (N) S (O) S (P) S (Q) S (R) S (S) S (T) S
X(U) S (V) S (W) S (X) S (Y) S (Z) S (.) S (_) S (@) S
Xvs -2 div 0 rmoveto (|) cshow N
XN B (Other diagram symbols:) show N N
XT H (#) show T T T T R (draw a board) show N
XT H (1 2 3 4 5 6 7 8 ;) show T R (motions for use in Forsythe notation) show N
XT H (0 9 [ ] < >) show T T R (special motions, resp. to the centre of ) show
X(the next square, up a rank, from bottom) show N
XT T T T T (right of board to a8, from h1 to bottom right of board, ) show
X(left a square, right a square) show N
XT H ([space] * - /) show T T R (board components, resp. W square,) show
X( B square, top edge, top right corner) show N
XT H (' ") show T T T T R (flip modes (as in text mode)) show
X
Xshowpage
END_OF_Table
if test 4220 -ne `wc -c <Table`; then
    echo shar: \"Table\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0

-- 
Andy Walker, Maths Dept., Nott'm Univ., UK.
anw@maths.nott.ac.uk