Commit 28b46985 authored by Peter Billam's avatar Peter Billam

1.5 default width now 450

parent 56d8fe92
......@@ -5,20 +5,20 @@
-- This script is free software; you can redistribute it and/or --
-- modify it under the same terms as Lua5 itself. --
---------------------------------------------------------------------
local Version = '1.4 for Lua5'
local VersionDate = '28jun2018';
local Version = '1.5 for Lua5'
local VersionDate = '29jun2018';
local Synopsis = [[
fen2img [-w 350] \
fen2img [-w 550] \
'rnb1k1nr/pppp1ppp/8/4p3/3b3q/4PPP1/PPP2K1P/RNBQ1BNR b KQkq - 0 5' \
output.png
# default width is 500 pixels
# default width is 450 pixels
# output file can be a .jpg or .png or .eps
perldoc fen2img # read the manual :-)
]]
local FEN = require 'chess.fen'
Width = 500;
Width = 450;
Flip = 'false'
local function which(s)
......@@ -404,17 +404,16 @@ fen2img - Creates a .png or .jpg diagram of a chess position in FEN
=head1 SYNOPSIS
fen2img -w 500 \
'rnb1k1nr/pppp1ppp/8/4p3/3b3q/4PPP1/PPP2K1P/RNBQ1BNR b KQkq - 0 5' \
fen2img '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
fen2img -w 500 "$FEN" - | display - # pipes into display as a .png
fen2img -f -w 500 "$FEN" - | display - # flip the display
fen2img -w 700 "$FEN" /tmp/t.jpg
fen2img -w 600 "$FEN" /tmp/t.png
fen2img -w 500 /tmp/t.fen /tmp/t.eps
fen2img "$FEN" - | display - # pipes into display as a .png
fen2img -f "$FEN" - | display - # flip the display
=head1 DESCRIPTION
......@@ -437,7 +436,9 @@ The board will be displayed B<F>lipped, ie: from Black's point of view.
This option sets the B<W>idth in pixels of the C<.jpg> or C<.png> image,
or the width in points of C<.eps> files.
The default width is 500.
Widths less than about 400 may produce
unsightly moire effects on the dark squares.
The default width is 450.
=item I<-v>
......@@ -472,6 +473,7 @@ which you move into C</usr/share/fonts/truetype/>
=head1 CHANGES
20180629 1.5 default width now 450
20180628 1.4 handles missing .fen file in a more user-friendly way
20180628 1.3 now works also on a t.fen file
20180627 1.2 introduce the -f Flip option
......
......@@ -43,17 +43,16 @@ CONTENT="PostScript, chess, FEN, pgn, jpg">
<H3 id="SYNOPSIS">SYNOPSIS</H3>
<pre><code> fen2img -w 800 \
'rnb1k1nr/pppp1ppp/8/4p3/3b3q/4PPP1/PPP2K1P/RNBQ1BNR b KQkq - 0 5' \
<pre><code> fen2img '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 "$FEN" /tmp/t.jpg
fen2img "$FEN" /tmp/t.png
fen2img "$FEN" /tmp/t.eps
fen2img -w 800 "$FEN" - | display - # pipes a .png into display
fen2img -f -w 800 "$FEN" - | display - # flip the display</code></pre>
fen2img -w 700 "$FEN" /tmp/t.jpg
fen2img -w 600 "$FEN" /tmp/t.png
fen2img -w 500 "$FEN" /tmp/t.eps
fen2img "$FEN" - | display - # pipes a .png into display
fen2img -f "$FEN" - | display - # flip the display</code></pre>
<H3 id="DESCRIPTION">DESCRIPTION</H3>
......@@ -78,7 +77,9 @@ ie: from Black's point of view.</p>
<p>This option sets the <b>W</b>idth in pixels of the <code>.jpg</code>
or <code>.png</code> image, or the width in points of <code>.eps</code>
files.
The default width is 500</p>
Widths less than about 400 may produce
unsightly moire effects on the dark squares.
The default width is 450</p>
</dd>
<dt id="v"><i>-v</i></dt> <dd>
......@@ -106,7 +107,8 @@ It also needs a particular TrueType font:</p>
</p>
<H3 id="CHANGES">CHANGES</H3>
<PRE> 20180628 1.4 handles missing .fen file in a more user-friendly way
<PRE> 20180629 1.5 default width now 450
20180628 1.4 handles missing .fen file in a more user-friendly way
20180628 1.3 now works also on a t.fen file
20180627 1.2 introduce the -f Flip option
20180627 1.1 allows output on stdout, for piping into display
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment