asc2ppm is a program package that allows a go author to create a diagram of a problem, board position, or game slice in graphic format. The resulting graphic image can be included in an HTML file with the <IMG SRC... statement.
The font used for creating go diagrams is based on GIF files from the British Go Association web site. The section you are interested in is called Tools and fonts for Go diagrams. For example, 27x27gif.zip is the file for a 27x27 font.
A new font type margin has been added to the 266 font types given by Andrew Grant. This font type is called m.fnt in this package.
Simon Goss wrote a program gofigs for Windows. gofigs is distributed in binary format and creates BMP images or composite GIF images. asc2ppm accomplishes the same function as gofigs in the Linux environment, with source under the GNU General Public License license.
See Other Font Sizes below for the procedure to create a new font.
asc2ppm cols rows <diagram | pnmtopng >diagram.png
Example:
asc2ppm 9 9 <crane1 | pnmtopng >crane1.png
Example using PngMinus:
asc2ppm 9 9 <crane1 | pnm2png >crane1.png
If you want to create a JPEG file, run ppmtojpeg instead of pnmtopng.
Example:
asc2ppm 9 9 <crane1 | ppmtojpeg >crane1.jpg
For GIF files, run ppmtogif.
Example:
asc2ppm 9 9 <crane1 | ppmtogif >crane1.gif
crane1 is a sample diagram that comes with this package.
The following rules are necessary for creating a good diagram:
The Debian package netpbm contains a program pnmtopng that converts a ppm file to the png format. The resulting png file can then be included in an HTML document.
You will need to install netpbm to work with asc2ppm. If you don't have Debian, you can easily compile netpbm from source.
If you have difficulty installing netpbm, you may have an easier time compiling pngminus. pngminus will allow you to create only PNG images. See the following information about installing pngminus.
The ppm file format is the most flexible graphic file format. You can create many other types of graphic files from a ppm file. Here is a list of formatting programs available.
You can easily create other font sizes with shell
scripts in this package.
Other Font Sizes