.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Dg2Ps 3pm" .TH Dg2Ps 3pm "2009-11-01" "perl v5.10.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Games::Go::Dg2Ps \- Perl extension to convert Games::Go::Diagrams to PostScript. .SH "SYNOPSIS" .IX Header "SYNOPSIS" use Games::Go::Dg2Ps .PP .Vb 2 \& my $dg2ps = Bnew> (options); \& $dg2ps\->convertDiagram($diagram); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBGames::Go::Dg2Ps\fR converts a Games::Go::Diagram into PostScript. .SH "METHODS" .IX Header "METHODS" .ie n .IP "my $dg2ps = \fBGames::Go::Dg2Ps\->new\fR (?options?)" 4 .el .IP "my \f(CW$dg2ps\fR = \fBGames::Go::Dg2Ps\->new\fR (?options?)" 4 .IX Item "my $dg2ps = Games::Go::Dg2Ps->new (?options?)" A \fBnew\fR Games::Go::Dg2Ps takes the following options: .SS "General Dg2 Converter Options:" .IX Subsection "General Dg2 Converter Options:" .IP "\fBboardSize\fR => number" 4 .IX Item "boardSize => number" Sets the size of the board. .Sp Default: 19 .IP "\fBdoubleDigits\fR => true | false" 4 .IX Item "doubleDigits => true | false" Numbers on stones are wrapped back to 1 after they reach 100. Numbers associated with comments and diagram titles are not affected. .Sp Default: false .IP "\fBcoords\fR => true | false" 4 .IX Item "coords => true | false" Generates a coordinate grid. .Sp Default: false .IP "\fBtopLine\fR => number (Default: 1)" 4 .IX Item "topLine => number (Default: 1)" .PD 0 .IP "\fBbottomLine\fR => number (Default: 19)" 4 .IX Item "bottomLine => number (Default: 19)" .IP "\fBleftLine\fR => number (Default: 1)" 4 .IX Item "leftLine => number (Default: 1)" .IP "\fBrightLine\fR => number (Default: 19)" 4 .IX Item "rightLine => number (Default: 19)" .PD The edges of the board that should be displayed. Any portion of the board that extends beyond these numbers is not included in the output. .ie n .IP "\fBdiaCoords\fR => sub { # convert $x, $y to Diagram coordinates }" 4 .el .IP "\fBdiaCoords\fR => sub { # convert \f(CW$x\fR, \f(CW$y\fR to Diagram coordinates }" 4 .IX Item "diaCoords => sub { # convert $x, $y to Diagram coordinates }" This callback defines a subroutine to convert coordinates from \f(CW$x\fR, \&\f(CW$y\fR to whatever coordinates are used in the Games::Go::Diagram object. The default \fBdiaCoords\fR converts 1\-based \f(CW$x\fR, \f(CW$y\fR to the same coordinates used in \s-1SGF\s0 format files. You only need to define this if you're using a different coordinate system in the Diagram. .Sp Default: sub { my ($x, \f(CW$y\fR) = \f(CW@_\fR; \f(CW$x\fR = chr($x \- 1 + ord('a')); # convert 1 to 'a', etc \f(CW$y\fR = chr($y \- 1 + ord('a')); return(\*(L"$x$y\*(R"); }, # concatenate two letters .ie n .IP "\fBprint\fR => sub { my ($dg2tex, @tex) = @_; ... }" 4 .el .IP "\fBprint\fR => sub { my ($dg2tex, \f(CW@tex\fR) = \f(CW@_\fR; ... }" 4 .IX Item "print => sub { my ($dg2tex, @tex) = @_; ... }" A user defined subroutine to replace the default printing method. This callback is called from the \fBprint\fR method (below) with the reference to the \fBDg2TeX\fR object and a list of lines that are part of the TeX diagram source. .SS "Dg2Ps\-specific options:" .IX Subsection "Dg2Ps-specific options:" .IP "\fBpageSize\fR => 'page size'" 4 .IX Item "pageSize => 'page size'" May be one of: .RS 4 .IP "'A0' \- 'A9'" 4 .IX Item "'A0' - 'A9'" .PD 0 .IP "'B0' \- 'B10'" 4 .IX Item "'B0' - 'B10'" .IP "'Executive'" 4 .IX Item "'Executive'" .IP "'Folio'" 4 .IX Item "'Folio'" .IP "'Half\-Letter'" 4 .IX Item "'Half-Letter'" .IP "'Letter'" 4 .IX Item "'Letter'" .IP "'US\-Letter'" 4 .IX Item "'US-Letter'" .IP "'Legal" 4 .IX Item "'Legal" .IP "'US\-Legal'" 4 .IX Item "'US-Legal'" .IP "'Tabloid'" 4 .IX Item "'Tabloid'" .IP "'SuperB'" 4 .IX Item "'SuperB'" .IP "'Ledger'" 4 .IX Item "'Ledger'" .IP "'Comm #10 Envelope'" 4 .IX Item "'Comm #10 Envelope'" .IP "'Envelope\-Monarch'" 4 .IX Item "'Envelope-Monarch'" .IP "'Envelope\-DL'" 4 .IX Item "'Envelope-DL'" .IP "'Envelope\-C5'" 4 .IX Item "'Envelope-C5'" .IP "'EuroPostcard'" 4 .IX Item "'EuroPostcard'" .RE .RS 4 .PD .Sp Default: 'Letter' .RE .IP "\fBtopMargin\fR => points" 4 .IX Item "topMargin => points" .PD 0 .IP "\fBbottomMargin\fR => points" 4 .IX Item "bottomMargin => points" .IP "\fBleftMargin\fR => points" 4 .IX Item "leftMargin => points" .IP "\fBrightMargin\fR => points" 4 .IX Item "rightMargin => points" .PD Margins are set in PostScript 'user space units' which are approximately equivilent to points (1/72 of an inch). .Sp Default for all margins: 72 * .70 (7/10s of an inch) .IP "\fBtext_fontName\fR => 'font' Default: 'Times\-Roman'," 4 .IX Item "text_fontName => 'font' Default: 'Times-Roman'," .PD 0 .IP "\fBstone_fontName\fR => 'font' Default: 'Courier\-Bold'" 4 .IX Item "stone_fontName => 'font' Default: 'Courier-Bold'" .PD Text and stone fonts names may be one of these (case sensitive): .RS 4 .IP "Courier" 4 .IX Item "Courier" .PD 0 .IP "Courier-Bold" 4 .IX Item "Courier-Bold" .IP "Courier-BoldOblique" 4 .IX Item "Courier-BoldOblique" .IP "Courier-Oblique" 4 .IX Item "Courier-Oblique" .IP "Helvetica" 4 .IX Item "Helvetica" .IP "Helvetica-Bold" 4 .IX Item "Helvetica-Bold" .IP "Helvetica-BoldOblique" 4 .IX Item "Helvetica-BoldOblique" .IP "Helvetica-Oblique" 4 .IX Item "Helvetica-Oblique" .IP "Times-Roman" 4 .IX Item "Times-Roman" .IP "Times-Bold" 4 .IX Item "Times-Bold" .IP "Times-Italic" 4 .IX Item "Times-Italic" .IP "Times-BoldItalic" 4 .IX Item "Times-BoldItalic" .RE .RS 4 .RE .IP "\fBtext_fontSize\fR => points" 4 .IX Item "text_fontSize => points" .PD The point size for the comment text. Diagram titles use this size plus 4, and the game title uses this size plus 6. .Sp Default: 11 .IP "\fBstone_fontSize\fR => points" 4 .IX Item "stone_fontSize => points" The stone_fontSize determines the size of the stones and diagrams. Stone size is chosen to allow up to three digits on a stone . The default stone_fontSize allows for three diagrams (with \-coords) per \&'letter' page if comments don't take up extra space below diagrams. .Sp If \fBdoubleDigits\fR is specified, the stones and board are slightly smaller (stone 100 may look a bit cramped). .Sp Default: 5 .IP "\fBstone_width\fR => points" 4 .IX Item "stone_width => points" .PD 0 .IP "\fBstone_height\fR => points" 4 .IX Item "stone_height => points" .PD The \fBstone_width\fR and \fBstone_height\fR determine the size of the stones and diagrams. .Sp If \fBstone_width\fR is not explicitly set, it is calculated from the \&\fBstone_fontSize\fR to allow up to three digits on a stone . The default \fBstone_fontSize\fR allows for three diagrams (with \-coords) per 'letter' page if comments don't take up extra space below diagrams. If \fBdoubleDigits\fR is specified, the stones and board are slightly smaller (stone 100 may look a bit cramped). .Sp If \fBstone_height\fR is not explicitly set, it will be 1.05 * \&\fBstone_width\fR, creating a slightly rectangular diagram. .Sp Default: undef \- determined from \fBstone_fontSize\fR .IP "\fBps_debug\fR =# number from 0 to 2" 4 .IX Item "ps_debug =# number from 0 to 2" When non-zero, code and subroutines are added to the PostScript output to help debug the PostScript file. This is very slightly documented in PostScript::File, but you'll probably need to read through the PostScript output to make any use of it. .Sp Default: 0 .ie n .IP "$dg2ps\->\fBconfigure\fR (option => value, ?...?)" 4 .el .IP "\f(CW$dg2ps\fR\->\fBconfigure\fR (option => value, ?...?)" 4 .IX Item "$dg2ps->configure (option => value, ?...?)" Change Dg2Ps options from values passed at \fBnew\fR time. .ie n .IP "$dg2ps\->\fBprint\fR ($text ? , ... ?)" 4 .el .IP "\f(CW$dg2ps\fR\->\fBprint\fR ($text ? , ... ?)" 4 .IX Item "$dg2ps->print ($text ? , ... ?)" \&\fBprint\fRs raw PostScript code to \fBfile\fR as defined at \fBnew\fR time. .ie n .IP "$dg2ps\->\fBprintComment\fR ($text ? , ... ?)" 4 .el .IP "\f(CW$dg2ps\fR\->\fBprintComment\fR ($text ? , ... ?)" 4 .IX Item "$dg2ps->printComment ($text ? , ... ?)" Adds \f(CW$text\fR to the diagram comments. .ie n .IP "$dg2ps\->\fBcomment\fR ($comment ? , ... ?)" 4 .el .IP "\f(CW$dg2ps\fR\->\fBcomment\fR ($comment ? , ... ?)" 4 .IX Item "$dg2ps->comment ($comment ? , ... ?)" Inserts the PostScript comment character ('%') in front of each line of each comment and \fBprint\fRs it to \fBfile\fR. .Sp Note that this is \fInot\fR the same as the \fBprintComment\fR method. .ie n .IP "my $canvas = $dg2ps\->\fBconvertDiagram\fR ($diagram)" 4 .el .IP "my \f(CW$canvas\fR = \f(CW$dg2ps\fR\->\fBconvertDiagram\fR ($diagram)" 4 .IX Item "my $canvas = $dg2ps->convertDiagram ($diagram)" Converts a Games::Go::Diagram into PostScript. .ie n .IP "my $converted_text = $dg2ps\->\fBconvertText\fR ($text)" 4 .el .IP "my \f(CW$converted_text\fR = \f(CW$dg2ps\fR\->\fBconvertText\fR ($text)" 4 .IX Item "my $converted_text = $dg2ps->convertText ($text)" Converts \f(CW$text\fR into text for display (handles PostScript escape sequences). .Sp Returns the converted text. .ie n .IP "$title = $dg2ps\->\fBconvertProperties\fR (\e%sgfHash)" 4 .el .IP "\f(CW$title\fR = \f(CW$dg2ps\fR\->\fBconvertProperties\fR (\e%sgfHash)" 4 .IX Item "$title = $dg2ps->convertProperties (%sgfHash)" \&\fBconvertProperties\fR takes a reference to a hash of properties as extracted from an \s-1SGF\s0 file. Each hash key is a property \s-1ID\s0 and the hash value is a reference to an array of property values: \&\f(CW$hash\fR\->{propertyId}\->[values]. The following \s-1SGF\s0 properties are recognized: .RS 4 .IP "\s-1GN\s0 GameName" 4 .IX Item "GN GameName" .PD 0 .IP "\s-1EV\s0 EVent" 4 .IX Item "EV EVent" .IP "\s-1RO\s0 ROund" 4 .IX Item "RO ROund" .IP "\s-1PW\s0 PlayerWhite" 4 .IX Item "PW PlayerWhite" .IP "\s-1WR\s0 WhiteRank" 4 .IX Item "WR WhiteRank" .IP "\s-1PB\s0 PlayerBlack" 4 .IX Item "PB PlayerBlack" .IP "\s-1BR\s0 BlackRank" 4 .IX Item "BR BlackRank" .IP "\s-1DT\s0 DaTe" 4 .IX Item "DT DaTe" .IP "\s-1PC\s0 PlaCe" 4 .IX Item "PC PlaCe" .IP "\s-1GC\s0 GameComment" 4 .IX Item "GC GameComment" .IP "\s-1KM\s0 KoMi" 4 .IX Item "KM KoMi" .IP "\s-1RE\s0 REsult" 4 .IX Item "RE REsult" .IP "\s-1TM\s0 TiMe" 4 .IX Item "TM TiMe" .RE .RS 4 .PD .Sp Both long and short property names are recognized, and all unrecognized properties are ignored with no warnings. Note that these properties are all intended as game-level notations. .RE .ie n .IP "$dg2ps\->\fBclose\fR" 4 .el .IP "\f(CW$dg2ps\fR\->\fBclose\fR" 4 .IX Item "$dg2ps->close" \&\fBprint\fRs final PostScript code to the output file and closes the file. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "sgf2dg(1)" 4 .IX Item "sgf2dg(1)" Script to convert \s-1SGF\s0 format files to Go diagrams .SH "BUGS" .IX Header "BUGS" Bugs? In \fImy\fR code? .SH "AUTHOR" .IX Header "AUTHOR" Reid Augustin, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2005 by Reid Augustin .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.