Columns


CUG New Releases

VGL and Ghostscript

Victor R. Volkman


Victor R. Volkman received a BS in Computer Science from Michigan Technological University. He has been a frequent contributor to The C Users Journal since 1987. He is currently employed as Senior Analyst at H.C. I. A. of Ann Arbor, Michigan. He can be reached by dial-in at the HAL 9000 BBS (313) 663-4173 or by Usenet mail to sysop@hal9k.com.

Introduction

The C Users Group Library has launched an aggressive campaign to bring you more of the best public domain, shareware, and free software available. Specifically, I've pledged to provide more than 40 new volumes in the coming year. With your help, CUG Library can become the definitive source for applications and tools — with full source code in C and C++. So if you have a favorite public domain, shareware, or free software volume to nominate for inclusion, please send it to me at sysop@hal9k.com. And, of course, I'd like to hear from the all the authors whose volumes are not yet in the CUG Library as well.

I can now offer contributing authors some new incentives as a small token of our appreciation. Specifically, an author whose volume is accepted by the CUG Library can choose from the following bonuses:

This month, I'll introduce two new volumes:

VGL: CUG #383

The VGL graphics library, by Mark Morley (Victoria, B.C., Canada), is a complete graphics library for use with Video Graphics Array (VGA) mode 13H. As you may recall, when IBM first introduced the VGA in 1987, the revolutionary 320x200 resolution with 256 colors (mode 13H) was one of its biggest improvements over the Enhanced Graphics Adapter (EGA). As was typical of IBM PC hardware, the VGA did not include any programming tools. Freeware programming tools, such as the VGL graphics library, help fill the void for DOS programmers. The VGL graphics library includes routines for drawing on virtual screens, drawing sprites, doing fast bit blts, animating the palette, drawing bit-mapped fonts, loading GIF images, drawing lines, trapping keypresses, and even mouse handling. Fig. 1 shows animated sprites in the form of bouncing balls. VGL version 2.0, released on 5/93, is now available as volume #383 in the CUG Library.

Above all, the VGL graphics library is fast. Animation appears quite smooth even with my pokey old 386-20Mhz CPU. Morley has maximized speed by writing about a third of the package in hand-optimized assembly language. He has even provided separate versions of the core routines for 80286 and 80386 CPUs. The 80386 version takes advantage of 32-bit registers, such as EAX, and their 32-bit instruction extensions. With its fast animation, VGL graphics makes a great starting base for game programming.

VGL includes 22 fonts, for serious work and fun work. For serious applications, Helvetica (from 13 to 29 points) and Times Roman (12 or 14 points) look great. For fun applications, VGL includes cartoon, comics, stencil, art deco, and other fonts. VGL renders fonts in regular, underlined, boldface, italics, and shadowed attributes as desired. Of course, the font displays are fast too.

Ghostscript: CUG #384

Ghostscript, by L. Peter Deutsch of Aladdin Enterprises (Menlo Park, CA), consists of an Adobe PostScript compatible interpreter, fonts, and utilities. The interpreter is composed of C functions which implement the graphics capabilities that appear as primitive operations in the PostScript language. Ghostscript interprets your PostScript files and can print to a variety of displays, printers, and graphics file formats. Ghostscript version 2.6.1 is now available as CUG volume #384.

You can view the PostScript files on EGA, VGA, and many SuperVGAs. You can print the files to an HP LaserJet (LJ), LJ+, LJ IIp, LJ III, DeskJet (color or mono), PaintJet, IBM ProPrinter, Epson, and other printers. Ghostscript will write out to mono or 256-color GIF files as well as mono, 16-color, or 256-color PC Paintbrush (.PCX) files.

Ghostscript will work on any PC with EGA (or better) graphics and MS-DOS 3.1 (or later). You may also build Ghostscript as a Windows 3.0 or 3.1 application. Ghostscript runs on most Unix systems including Sun SPARCstations, SCO Unix, DECStation and VAX Ultrix, SGI Iris Indigo, Sequent, and more. The CUG Library edition of Ghostscript includes pre-built versions for MS-Windows and DOS only. The DOS version must be built with a DOS Extender such as DOS/4GW by Rational Systems, Inc.

Ghostscript includes many useful PostScript fonts. Most fonts are derivatives of the public domain Hershey and MIT Xll distribution. These fonts include Avante-Garde, Bookman, Courier, Helvetica, New Century Schoolbook, Palatino, Times-Roman, Zapf Chancery, and many more.

Ghostscript is licensed under the GNU General Public Software License. If you plan on incorporating source code from Ghostscript in your own product, you must make source code readily available. However, you are still free to distribute the unmodified version of Ghostscript and bundle it with other files.

Figure 1