fen2img

NAME

fen2img - Creates a .png or .jpg diagram of a chess position in FEN

SYNOPSIS

 fen2img -w 500 \
   'rnb1k1nr/pppp1ppp/8/4p3/3b3q/4PPP1/PPP2K1P/RNBQ1BNR b KQkq - 0 5' \
   /tmp/hammerschlag.png
 display /tmp/hammerschlag.png

 FEN=`pgn2fen '1.f3 e5 2. Kf2 Bc5+ 3.d4 Qh4+ 4. g3 Bxd4+ 5.e3'`
 fen2img -w 500 "$FEN" /tmp/t.jpg
 fen2img -w 500 "$FEN" /tmp/t.png
 fen2img -w 500 "$FEN" /tmp/t.eps

DESCRIPTION

This script converts a chess-position in FEN syntax into an image in .jpg or .png or .eps format.

It incorporates the same code as makes up the chess.ps PostScript library,
and feeds the result into gs to convert into .jpg or .png format.

OPTIONS

-w 500

This option sets the Width in pixels of the .jpg or .png image, or the width in points of .eps files.

-v

Prints the Version

DOWNLOAD

fen2img at is available in

  git clone https://github.com/peterbillam/postscriptlib

or at

  https://github.com/peterbillam/postscriptlib
  https://github.com/peterbillam/postscriptlib/tree/master/bin
  http://www.pjb.com.au/comp/free/fen2img

It also needs gs to be installed, if it isn't already:

  apt-get install ghostscript

or see: www.ghostscript.com/

It also needs a particular TrueType font:

   http://homepages.di.fc.ul.pt/~jpn/gv/tabs/chessfont.zip

which unzips to CHEQ_TT.TTF which you move into /usr/share/fonts/truetype/

AUTHOR

Peter J Billam, http://www.pjb.com.au/comp/contact.html

SEE ALSO

 en.wikipedia.org/wiki/Forsyth-Edwards_Notation
 www.pjb.com.au/comp/chess.html
 www.pjb.com.au/