Changes in the most recent releases of Ghostscript

Table of contents

This document is a record of changes in Ghostscript releases numbered 5.n. For earlier versions, see the the history documents:

History of Ghostscript versions 4.n
History of Ghostscript versions 3.n
History of Ghostscript versions 2.n
History of Ghostscript versions 1.n

For other information, see the Ghostscript overview.


Within each release, news appears in the following order: Documentation,
Procedures, Utilities, Drivers, Platforms, Fonts, Interpreter, Streams
(included under Interpreter through release 2.9.9), Library.  Changes marked
with a * were made available as patches to a previous release.


Version 5.50 (9/16/98)

This is the first public release since 5.10. See the release summary for a list of major additions and changes.

Documentation

Fixes problems: - Many files still referred to .txt rather than .htm files. (DLL.htm, Make.htm, New-user.htm, Readme.htm, bcwin32.mak, cfonts.mak, devs.mak, dvx-gcc.mak, dwmainc.cpp, gs-vms.hlp, gxdevcli.h, gxdevice.h, int.mak, jpeg.mak, libpng.mak, msvc32.mak, msvclib.mak, openvms.mak, os2.mak, unix-cc.mak, unix-gcc.mak, unixansi.mak, watc.mak, watcw32.mak, wccommon.mak, zlib.mak) Notes that ps2epsi.1 and ps2epsi.txt may be inconsistent or obsolete. (ps2epsi.1, ps2epsi.txt) Adds a reference to Thomas Merz's Ghostscript manual. (Readme.htm) Adds instructions for making RPMs. (Install.htm, Make.htm) Changes the URL for post-release notes. (Bug-form.htm, Make.htm, New-user.htm) Notes problems with Watcom compilation. (Make.htm)

Procedures

Fixes problems: - On Unix systems, the documentation files didn't get installed by `make install'. (unixinst.mak) - $() was missing around MAKEFILE in a Windows makefile. (msvc32.mak) - The dfax drivers didn't include all the necessary files in the linker list. (contrib.mak) - The MSVC makefiles didn't allow building the executable in a different directory. (bcwin32.mak, gs.mak, lib.mak, msvc32.mak, msvccmd.mak, msvclib.mak, msvctail.mak, os2.mak, watcw32.mak, winint.mak, winlib.mak) - The default build directory for the Borland compiler was debugobj rather than obj. (bcwin32.mak) Adds a patch file and some specification files for making RPMs. (gs.rps, gs-fonts.rps, rpm-conf.dif) Removes the docs target in the makefile, since this function is now performed by another program. (unix-end.mak)

Drivers

Fixes problems: - The jpeg drivers caused a memory access error. (bug introduced in 5.20 by an incorrectly made fix) (gdevjpeg.c) - The x11cmyk driver implemented map_rgb_color, which it should not do. (gdevxalt.c)

Utilities

Fixes problems: - echogs -h didn't work in environments where char is signed. (echogs.c)

Platforms

Fixes problems: - MSVC++ 5.0 produced incorrect code with TDEBUG=0. We "fixed" this problem by noting in the makefile that TDEBUG must be left set to 1. (msvc32.mak, msvclib.mak) Updates the icons for the MS Windows and OS/2 platforms. (gsgraph.icx, gsos2.icx, gspmdrv.icx, gstext.icx)

Interpreter

Fixes problems: - setpagedevice didn't update the state correctly when switching to a new type of device (different OutputDevice value). (gs_setpd.ps) - The interpreter's initialization depended on BSS being initialized to 0. (files.h, zfile.c) Removes all references to reloc_struct_ptr other than in gsstruct.h. (igcref.c) Adds DEBUG tracing for pdfmarks. (gs_pdfwr.ps) Disables TEST code for release. (zcrd.c, zfdcte.c)

Interpreter (PDF)

Fixes problems: - Some third-party software still referred to the obsolete #? procedure. (pdf_main.ps) - Destinations with string names weren't properly converted to pdfmarks. (pdf_main.ps) - Destinations with S = /Named weren't supported. (pdf_main.ps)

Library

Fixes problems: - Dropout prevention wasn't applied to landscape image masks. (gximono.c) - When using async rendering, the renderer's allocator was allocated with the wrong allocator. (gdevprna.c) - gx_strip_bitmap and gx_device_mask_clip didn't have proper GC descriptors, causing crashes if a GC occurred while rendering an ImageType 3 or 4 image. (gsstruct.h, gxbitmap.h, gxclip2.h, gxclipm.h, gxmclip.h, gspcolor.c, gxclipm.c, gxmclip.c) - The buffer for printer devices wasn't reallocated properly for async devices when the page size changed. We aren't entirely comfortable with the fix, but it's the best we've got right now. (gdevprn.c) - Some files wouldn't compile with -dNOPRIVATE. (gxcspace.h, gscdevn.c, gscolor2.c, gscscie.c, gscsepr.c) - gp_semaphore_close and gp_monitor_close were defined as not returning an error code. (gpsync.h, gp_nsync.c, gp_posem.c, gp_semon.c, gp_win32.c) - Initialization code depended on BSS being initialized to 0. (gsiodev.c) - The special PCL color mapping device didn't handle CMYK devices correctly in other than "identity" mode. (gdevcmap.c) Cleans up a little formatting. (gscie.h, gscpixel.c, gxmclip.c) Removes all references to reloc_struct_ptr other than in gsstruct.h. (gsstruct.h, gsalloc.c, gsdevice.c, gsfont.c, gxcpath.c) Patches the async code so that it allocates twice as much space for the renderer as should be needed, to deal with sandbars. (gdevprna.c)

Version 5.40 (beta) (9/10/98)

A few more fixes. This is intended as the candidate fileset for the 5.50 release.

Documentation

Fixes problems: - The current GNU Ghostscript version was documented as 3.33, not 4.03. (New-user.htm) - The ansi2knr usage documentation didn't mention --filename. (ansi2knr.1) - A projected completion date was too optimistic. (ps2pdf.1) Replaces all documentation files with new HTML versions. (*.txt [deleted], *.htm, index.html, imainarg.c) Adds a contributed set of Emacs macros useful for working with Ghostscript documentation. (gsdoc.el) Changes the version and date format slightly in one file for consistency. (gs-vms.hlp)

Procedures

Adds a make target (make docs) to touch up documentation files before a release. (unix-end.mak)

Utilities

Removes the long-obsolete ps2image.ps utility. (ps2image.ps [deleted])

Drivers

Adds a driver for the Color LaserJet 5. (devs.mak, gdevclj.c)

Platforms

Fixes problems: - Blanks in command lines weren't handled properly. (dwmain.cpp, dwmainc.cpp)

Library

Fixes problems: - 16-bit devices didn't convert colors to RGB correctly. (gdevm16.c) - 16- and 32-bit RasterOp didn't work, because pack_from_standard didn't handle depths greater than 8. (gdevdrop.c) - RasterOps with devices with non-standard color representation sometimes substituted black or white for the source or target. (gdevdrop.c) - The non-orthogonal case of Axial shading executed the axial-case code as well. (gxshade1.c) - copy_color on 4-bit-deep memory devices did an unnecessary fit_copy check. (gdevm4.c) - An upcast was missing. (gdevbbox.c) - View clipping was applied to internal devices, incorrectly. (gspath.c) Revises the implementation of shading so as to reduce the use of macros, update formatting, and help prepare for PatternType 2 patterns. (gsshade.h, gxshade.h, gxshade4.h, gscolor3.c, gsshade.c, gxshade.c, gxshade1.c, gxshade4.c, gxshade6.c)

Version 5.39 (beta) (9/8/98)

A couple more small fixes.

Drivers

Fixes problems: - The pkm[raw] drivers didn't work with 32-bit pixels. (gdevpbm.c) Adds (fake) 8-, 16-, and 32-bit X11 CMYK devices, for debugging. Unfortunately, the 16- and 32-bit devices consume the hardware color map and then no longer behave reasonably; the 8-bit device produces output with garbled colors (fixed in 5.40). (devs.mak, gdevxalt.c)

Library

Fixes bugs: - All banded devices caused a memory access error. (bug introduced in 5.38) (gsstate.c) - The special color mapping device didn't update its state after put_params. (gdevcmap.c) - RasterOp on 8-bit non-gray-scale devices didn't handle filling with constant 0 or 1 properly. (gdevmrop.c) - The halftone machinery didn't switch from full-size to strip halftones early enough, possibly allocating very large halftone data structures. (gshtscr.c) - If an ioerror (such as a disk- or memory-full condition) occurred while writing out the band list, the bookkeeping structures were left in an inconsistent state, causing further problems. (gxclutil.c) - Some shaded fills didn't check for errors when filling sub-regions. (gxshade1.c, gxshade4.c) Cleans up some formatting. (gxshade6.c)

Version 5.38 (beta) (9/3/98)

The sole purpose of this release was to fix some obscure bugs detected by the Genoa tests and by another Aladdin project.

Documentation

Updates the list of implemented PostScript LanguageLevel 3 features. (current.txt)

Drivers

Fixes problems: - The PDF writer did the wrong thing for multi-source images with more than 180 bytes of data (total) per scan line. (gdevpdfi.c) - If one used setdistillerparams, [g]restore caused a rangecheck in .setpagedevice. ****** DISABLED FOR DCT DICTS, SINCE THIS CAUSES A SEGV ****** (gdevpsdp.c)

Interpreter

Fixes problems: - 0-length parameter arrays were given an arbitrary type, confusing clients. (iparam.c) - EOD on a write stream caused an error. (zfileio.c)

Library

Fixes problems: - 0-length parameter arrays confused clients that wanted arrays of a particular type. (gsparam.c) - Patterns with XStep or YStep smaller than the bounding box didn't work properly. (gxp1fill.c) - Resizing an object sometimes copied it unnecessarily. (gsalloc.c) - Freeing the shared part of a graphics state didn't free its sub-objects. (gsstate.c) - The standard allocator didn't free its initial (self-containing) chunk when asked to free itself. (gsalloc.c) - The standard allocator didn't attempt to merge free blocks before giving up. We implemented this by adding another virtual procedure to allocators, consolidate_free. (gsmemory.h, gsmemraw.h, gsalloc.c, gsmalloc.c, gsmemlok.c, gsmemory.c) - The free object merging algorithm thought there were free objects even when there weren't. (Small performance bug only.) (gsalloc.c) Adds some more tracing to pattern filling. (gxclip2.c, gxp1fill.c) Replaces the cs_alloc, cs_copy, and cs_undo_alloc macros with procedures. (gxcspace.h, gscolor2.c, gscsepr.c, gscspace.c, gspcolor.c) Moves the free-object merging code from gsnogc.c to gsalloc.c, so it can be used even in systems that have a garbage collector. (gsalloc.h, gxalloc.h, gsalloc.c, gsnogc.c)

Version 5.37 (beta) (8/31/98)

Documentation

Mentions the new cid2code utility in the documentation. (psfiles.txt) Documents dpsnext.dev. (gs.mak) Notes that clients of ImageType 3 images are responsible for providing the mask data before the pixel data. (gsiparm3.h)

Procedures

Fixes problems: - The makefiles were missing a dependency of jconfig.h on arch.h. With this fix, parallel builds (make -jN) work reliably. (jpeg.mak)

Utilities

Adds a utility for creating maps from CIDs to Unicode. (unixinst.mak, cid2code.ps)

Drivers

Removes the %Fax% IODevice code, since it was only a skeleton and Adobe no longer supports this facility. (devs.mak, gdevpfax.c [deleted])

Fonts

Fixes problems: - TrueType fonts whose first code wasn't 0 or 0xf000 didn't display correctly. (bug introduced in 5.36) (gs_ttf.ps) - CIDFontType 0 fonts didn't handle being redefined with another name. (gs_cidfn.ps) - CIDFontType 0 fonts could get local-into-global-store errors. (gs_cidfn.ps) - PDF files couldn't use already-defined CMap resources. (pdf_font.ps) - Out-of-range CIDs gave an error rather than using a notdef character. (gs_cidfn.ps)

Interpreter

Fixes problems: - CIDFontType 4 fonts weren't recognized as CID-keyed. (zchar2.c, zchar32.c, zfont32.c) - When recovering from an error in an operator procedure, the interpreter didn't update the dictionary stack caches. (interp.c) - startjob didn't reinitialize the stacks or VM space. (gs_lev2.ps) - Encoding filters with a Predictor always caused an error. (zfilter2.c) - currenttrapparams gave an error. (gs_ll3.ps) - settrapparams had no effect, and left the dictionary on the stack. (gs_ll3.ps) Finishes implementing Type 32 fonts. These fonts don't actually work directly with the cache -- they store the bitmaps in a compressed form in an ordinary Dictionary -- but they do behave the way they are specified. (gs_typ32.ps, zchar32.c, zfont32.c) Cleans up formatting and macros in a few more files. (ccfont.h, icharout.h, icstate.h, iutil.h, iutil2.h, ibnum.c, iccfont.c, iccinit0.c, ilocate.c, isave.h, isave.c, iscannum.c, iutil.c, iutil2.c) Removes or capitalizes a few more macros. (zcontext.c, zcssepr.c, zusparam.c)

Interpreter (PDF)

Fixes problems: - Color spaces with subsidiary spaces (Indexed, Separation, DeviceN) sometimes didn't work properly, because they were translated to PostScript structures more than once. (pdf_draw.ps) - Type 3 fonts didn't rebind the resource context when executing the CharProc procedure. (pdf_font.ps)

Streams

Fixes problems: - The CCITTFax decoder signaled an error if it saw an EOB with EndOfBlock = false. (According to e-mail from Adobe, EOBs should be recognized even if EndOfBlock is false, even though the Red Book implies the opposite.) (scfd.c) Cleans up macros and formatting in a few more files. (slzwce.c, sfxfd.c, sfxstdio.c)

Library

Fixes problems: - Landscape color images usually didn't display. (bug introduced in 5.32) (gxicolor.c) - If gs_heap_free_object was called with ptr != 0 but bp = 0 (which is an error), an invalid memory access would occur. (gsmalloc.c) - The left side bearing was still being added in a second time for the accent of a seac. (bug probably introduced in 5.20) (gxtype1.c) - An access error occurred when rendering the very last glyph of a TrueType font with a 2-byte loca table. (gstype42.c) - In the fast portrait case of monochrome images, a numerical error sometimes produced a 1-bit-wide vertical stripe of an incorrect color at the right edge of the image. (gxifast.c) - ImageType 3 images with InterleaveType = 3 gave memory access errors. (gximage3.c) - Hit detection ignored any part of the aperture that had negative X or Y coordinates. (gdevhit.c) - The special color mapping device didn't copy all necessary values back from its target. (gxdevice.h, gdevbbox.c, gdevcmap.c, gsdevice.c) - The special color mapping device didn't handle ordinary (Type 1) images correctly. (gdevcmap.c) - CMYK halftones complemented both the color and the halftone level: this produced the right number of pixels turned on (only for linear spot functions or threshold arrays), but wasn't consistent with either the Adobe specification or the user's intentions. (gxcht.c) - The phase of mask Patterns wasn't always set correctly. (gxp1fill.c) - The reader side of overlapped band devices was confused about its open/closed status. (gdevprna.c) Renames Type 32 fonts from ft_bitmap to ft_CID_bitmap. (gxftype.h) Adds some more tracing for composite font decoding. (gsfcmap.c) Adds some more tracing for images. (gxiinit.c) Cleans up formatting and macros in a few more files. (gxifast.c) Moves the image*_type_data and image*_enum_procs_data definitions from header files into more appropriate .c files. (gsiparm2.h, gsiparm3.h, gsiparm4.h, gxiparam.h, gxiinit.c, gximage2.c, gximage3.c, gximage4.c)

Version 5.36 (beta) (8/25/98)

Another set of fixes. The free-standing bbox device now produces convenient %%BoundingBox messages. This fileset also includes support for double-byte TrueType fonts.

Documentation

Fixes problems: - There was a minor spacing glitch in one man page. (gs.1) - The page printed by align.ps didn't make it clear enough what to do with the numbers it asks users to calculate. (align.ps) - The sample code for adding gamma adjustment didn't work most of the time. (devices.txt) - The prolog produced by pswrite was completely uncommented. (gdevps.c) - The documentation didn't note that the string block freelist (sfree) is sorted in address order. (gxalloc.h) Notes that FirstBitLowOrder and LowBitFirst are equivalent. (slzwx.h) Notes a change in the FTP site of the free Kanji ("Wadalab") fonts. (fonts.txt) Adds a pointer to the freely available Unicode CMaps. (fonts.txt) Changes an obsolete e-mail address for Carsten Emde. (contrib.mak)

Utilities

Fixes problems: - The viewgif utility sometimes left 1-scan-line gaps when rendering interlaced images. (viewgif.ps)

Drivers

Fixes problems: - In the PDF writer, downsampled images were always written with 8 bits per sample, not the requested depth. (gdevpsdi.c) - The 8-to-N-bit compression filter produced an extra byte at the end of each row, and the N-to-8-bit expansion filter skipped an input byte at the end of each row. (gdevpsds.c) - In the PDF writer, the size of downsampled images for changing the pixel width was set incorrectly, leading to inconsistent image parameters in the output. (gdevpsdi.c) - The subsampling filters didn't take a clear position about what to do with excess input samples beyond a multiple of the reduction factor, leading to inconsistent image parameters. We added a Boolean to indicate whether they should discard the samples or use them to create an additional output sample. (gdevpsds.h, gdevpsdi.c, gdevpsds.c) - The subsampling filters didn't provide the necessary set_defaults procedures. (gdevpsds.h, gdevpsds.c) - Because of a typo, pdfwrite and pswrite printed sequences of 4 decimal values wrong. (bug introduced during macro removal in 5.25) (gdevpstr.c) Makes the PS writer produce a %%HiResBoundingBox as well as a %%BoundingBox. (gdevps.c)

Platforms

Fixes problems: - The Borland makefile didn't include the MT libraries. We added a MULTITHREAD option to this makefile. (bcwin32.mak) - The MSVC makefile didn't include the MT switches in the right place. (msvccmd.mak) - 'make clean' in the Windows makefiles didn't clean up quite enough. (bcwin32.mak, msvc32.mak, msvccmd.mak) - The OS/2 makefile had gotten slightly out of date. (os2.mak) Cleans up some formatting. (gp_win32.c)

Fonts

Fixes problems: - Loading large TrueType fonts caused excessive garbage collection. (gs_ttf.ps) Finishes implementing support for turning double-byte TrueType fonts into CIDFontType 2 fonts. (gs_ttf.ps)

Interpreter

Fixes problems: - We thought the dictionary returned by currentuserparams should always be allocated in local VM, but in fact the correct definition is that it should be allocated in the current VM. The simplest way to make this work is for setuserparams to copy any string values into global VM. (gs_lev2.ps) - 1-input stitching functions didn't allow k = 0. (ifunc.h, zfunc.c) - OtherSubrs defined in PostScript no longer worked. (bug probably introduced when we rewrote the Type 1 code in C) (zchar1.c) Cleans up a few compiler warnings (missing empty 'default' cases, unused variables). (igc.c, iname.c) Replaces some uses of RELOC_*_PTR (now deprecated) with RELOC_*_VAR. (isave.c, iscan.c)

Interpreter (PDF)

Fixes problems: - Resources were re-created on each page, causing (sometimes a lot of) unnecessary computation. We implemented most of the machinery for avoiding this, but not the mechanism for actually storing resources in global VM. (pdf_base.ps, pdf_main.ps) Adds a little more debugging code. (pdf_draw.ps)

Streams

Cleans up formatting in a few more files. (sbtx.h, sfilter.h, slzwx.h, spngpx.h, srlx.h, sstring.h, seexec.c, sfilter1.c, sfilter2.c, smtf.c, spcxd.c, srld.c, srle.c) Replaces a couple of #defines with duplicated (small) structures. (sbtx.h, sfilter.h, sfilter1.c, sfilter2.c) Replaces all uses of RELOC_*_PTR (now deprecated) with RELOC_*_VAR. (stream.c)

Library

Fixes problems: - If a garbage collection occurred during a string show operation, memory could be corrupted. (bug introduced in 5.24) (gstext.h, gstext.c) - A debugging check incorrectly indicated an error when miter-checking lines with a 0 degree angle between them. (gxstroke.c) - A structure created for bitmap/pixmap patterns was never freed. (gspcolor.c) - Colored halftones didn't work with 24-bit devices. (This case was never actually used.) (gxcht.c) - CIE colors didn't remap properly if the current color space was a Pattern space. (gscie.c) - In a non-garbage-collected environment, freeing a string in the current chunk made an unnecessary test. (Minor performance impact only.) (gsnogc.c) Cleans up a few compiler warnings (missing empty 'default' cases, unused variables). (gsht.c, gsht1.c, gshtscr.c, gsimage.c, gxacpath.c, gxclread.c, gxicolor.c, gxshade4.c) Replaces some uses of RELOC_*_PTR with RELOC_*_VAR. (gsht1.c) Changes the printed output of the free-standing bbox device so it produces %%BoundingBox and %%HiResBoundingBox lines that can be dropped directly into a DSC header. (gdevbbox.c) Speeds up the 4-bit case of copy_mono by about 30%. (gdevm4.c) Expands some macros and cleans up formatting, for easier reading and debugging. Speeds up the color halftone generation algorithm substantially (up to 40%), by skipping the halftone computation for planes that are known to be solid-color, and using copy_mono directly if only one plane is not solid-color. (gxcht.c)

Version 5.35 (beta) (8/18/98)

More updates for 5.3x, specifically fixing problems with halftones on banded CMYK devices.

Documentation

Fixes problems: - The URLs for the third-party libraries were out of date. (make.txt, jpeg.mak, libpng.mak, zlib.mak)

Drivers

Adds an x11gray4 device for help in debugging. (devs.mak, gdevxalt.c)

Fonts

Fixes problems: - TrueType fonts with more than 64K of data before or after the glyfs caused an error. (gs_ttf.ps)

Interpreter

Fixes problems: - The dictionary returned by currentuserparams was allocated in the current VM rather than always in local VM. (gs_lev2.ps)

Interpreter (PDF)

Fixes problems: - CID-keyed fonts caused an error, because their CDevProc was incorrect. (pdf_font.ps)

Library

Fixes problems: - A comment was duplicated. (gxht.h) - The main procedure of the command list reader was so large that it couldn't be optimized by many compilers, and was very hard to read. (gxclrast.c) - Banding devices using multi-screen halftones could get memory access errors because they didn't clear the halftone caches when changing halftone parameters. (gxclrast.c) - Banding devices using multi-screen halftones didn't set the halftone phase correctly. (gxcht.c, gxclrast.c) - RasterOp didn't work for 2- or 4-bit gray-scale devices. It still doesn't work right, but it's closer. (gdevm2.c, gdevm4.c, gdevmrop.c) - Undefined characters in CMap-based composite fonts caused errors and possible invalid memory accesses. (gschar0.c)

Version 5.34 (beta) (8/16/98)

More updates for 5.3x.

Documentation

Updates all of the man pages to new versions. (gs-vms.hlp, gs.1, pdf2dsc.1, pdf2ps.1, ps2ascii.1, ps2epsi.1, ps2pdf.1, ps2ps.1)

Procedures

Fixes problems: - The MSVC library makefile incorrectly included gp_msio.c. (msvclib.mak, winlib.mak)

Drivers

Fixes problems: - The PDF writer unnecessarily checked for other parameters after a failing show or pdfmark. (gdevpdfp.c) - The device's BufferSpace parameter was ignored. (bug introduced by async rendering code in 5.30) (gdevprn.c) - Banding devices smashed the first 4 bytes of each scan line. (bug introduced in 5.28) (gxdevmem.h, gdevmem.c, gxclread.c) - The phase for colored halftones was set wrong. (We have "fixed" this innumerable times, and it is still probably wrong.) (gxclrast.c) Replaces the deprecated gx_device_image_xxx calls with the new gx_image_xxx calls. (gdevpdfi.c, gdevps.c, gdevpx.c, gdevvec.c)

Interpreter

Fixes problems: - The equality test for idiom recognition sometimes incorrectly returned false. (zmisc3.c) - shfill didn't take the BBox into account. (It still doesn't.) (gxshade.c) - The status operator could return an incorrect pages or bytes value for files larger than 2 Gb, rather than giving an error. (zfile.c)

Library

Fixes problems: - The hint tables weren't reset after processing the base character of a 'seac', leading to incorrect hinting and (for Type 2 CharStrings) possible mis-parsing of the outline data. (gstype2.c) - When processing a 'seac', the left side bearing was added in twice, displacing characters to the right. (bug probably introduced in 5.20) (gstype1.c) - RasterOps didn't set the size of the RasterOp texture device, which caused filling operations involving a colored halftone to be clipped to an empty rectangle. (gdevrops.c) - When filling with a colored halftone, the RasterOp source was often disregarded. (gxcht.c) - gx_device_image[_plane]_data and gx_device_end_image took an unused dev argument, leading to potential confusion. We deprecated the gx_device_image_plane_data and gx_device_end_image procedures, replacing them with macros that call their replacements gx_image_plane_data and gx_image_end (which no longer have the spurious dev argument). (gxdevcli.h, gxdevice.h, gxiparam.h, gdevbbox.c, gdevddrw.c, gdevdflt.c, gsimage.c, gslib.c, gxclimag.c, gxclrast.c, gximage2.c, gximage3.c, gximage4.c) - gs_color_adjust_count, introduced in 5.33 to address the problem of freeing free-standing patterns, just made things worse. We are replacing them with gs_pattern_reference, essentially the procedure introduced in 5.31 that we deleted in 5.33. (gsccolor.h, gspcolor.h, gscolor.c, gspcolor.c) Changes hint suppression from a #define to a debugger-settable static. (gxhint1.c)

Version 5.33 (beta) (8/14/98)

This is the third set of updates for 5.30. These updates have been driven mostly by the needs of another Aladdin project, so they haven't included as many problem fixes as we would normally make.

Platforms

Fixes problems: - The thread creation procedure for Win32 called a Windows function rather than the proper C library function. (gp_win32.c) - In some MS-DOS implementations, the copy command doesn't recognize the /Y switch. (bcwin32.mak)

Fonts

Fixes problems: - TrueType fonts with *less* than 64K of glyf data stopped working. (bug introduced in 5.31) (gs_ttf.ps)

Interpreter (PDF)

Fixes problems: - Using an Identity function left an extra element on the stack. (pdf_draw.ps) - The syntax of # in names is different in PDF 1.1 and PDF 1.2, but the PDF 1.2 syntax was always used. (pdf_base.ps, pdf_main.ps)

Library

Fixes problems: - Color images still always caused an error. (bug introduced in 5.32) (gxicolor.c) - Because of a typo, the implementation of image types didn't compile. (bug introduced in 5.32) (gxiparam.h) - Free-standing colors (specifically pattern colors) and color spaces couldn't be freed. This required a NON-BACKWARD-COMPATIBLE change in an internal API used for managing color and color space reference counts. (gxcspace.h, gsccolor.h, gscdevn.c, gscolor.c, gscolor2.c, gscscie.c, gscsepr.c, gscspace.c, gspcolor.c) Cleans up a little more formatting. (gscspace.h)

Version 5.32 (beta) (8/13/98)

This is the second set of updates for 5.30.

Procedures

Fixes problems: - The OS/2 makefile accidentally omitted the OS/2-PM driver. (os2.mak) - The MSVC library makefile didn't work. (msvclib.mak) - Debugging was turned on in the Borland Windows makefile. (bcwin32.mak) - The BEGINFILES2 list was too long in the MSVC makefile. (msvc32.mak)

Interpreter

Fixes problems: - .execn wouldn't accept pseudo-operators. (iref.h) - inustroke with a matrix operand didn't work correctly. (zupath.c) - ImageType 4 images didn't work. (bug introduced in 5.31) (zimage3.c)

Interpreter (PDF)

Fixes problems: - Forms used more than once caused an invalidaccess error. (pdf_draw.ps)

Library

Fixes problems: - Using a colored pattern with a Pattern color space that included a base space could access uninitialized floating point values, possibly causing an arithmetic trap. (gspcolor.c) - RasterOp wasn't implemented for 16- and 32- bit devices. (gdevm16.c, gdevm32.c, gdevmrop.c) - The library test program relied on copysign, which some C libraries lack. (gslib.c) - The gs_free and gs_heap_free_all debugging printout were included even if DEBUG wasn't defined. (bug introduced in 5.30) (gsmalloc.c) - Color images always caused an error. (bug introduced in 5.30) (gxicolor.c) - Masked images with pis = NULL could cause an error. (gximono.c) - In landscape orientation, masked images didn't guarantee that the buffer of mask scan lines would be flushed to the mask clipping device before processing the data being masked. (gxiparam.h, gxidata.c, gxifast.c, gximage3.c) - Images with source transparency set but CombineWithColor = false could get an error because of trying to paint with an unloaded color. (caused by a bug fix in 5.30) (gxdcolor.c, gxiinit.c)

Version 5.31 (limited) (8/11/98)

This is the first set of updates for 5.30. They fix a few minor build problems, and some significant problems with bitmap patterns that do not affect the PostScript or PDF interpreters. Missing DPS functionality: Contexts: Free L/G VM when num_contexts goes to 0 quit should terminate only the current context Contexts terminated on quit or error destroy stacks & close stdin/out Monitor-lock oparrays? Global VM GC should collect (or at least scan) *all* local VMs that reference it How to handle multi-client input? Type 2 images: UnpaintedPath (generating X exposure events) Transformed source Overlapping source/dest (affects order) NeXT extensions: Compositing Storing alpha with X windows Halftoning Other partially implemented functionality: Internal: Directory restructuring Create .dev files in GEN directories 'make clean' do the right thing Typed images in band list (wrong in gxclimag.c, not implemented in gxclread.c) General image_plane_data for banding alpha/compositing-related: Image alpha data in band list (gxclimag.c?) Compositing through band list (stubbed in gxclimag.c) Driver text API (barely started, not documented) PDF-related: Acrobat Distiller 3.0 pdfmarks (see under Drivers) - untested PostScript Level 2+ leftovers: HalftoneTypes 6, 10, and 16 (in gs_ll3.ps) Type 32 fonts (gs_typ32.ps, zchar32.c, zfont32.c) PostScript LanguageLevel 3: clipsave/cliprestore (dummy) DeviceN color space (zcsdevn.c, gscdevn.c) How to handle arbitrary numbers of colorants? Caching transformed values ImageType 3 images (zimage3.c) Library doesn't check ImageMatrix compatibility (see Table 4.24 in PS3 RM draft) DevicePixel color space Not enough bits in client or concrete color! What is initial value? PatternTypes other than 1 Functions Monotonicity is implemented only for Exponential and ArrayedOutput (may not be needed at all....) Shading Doesn't handle Background, BBox, Extend, or clipping Streams LZWDecode LowBitFirst ReusableStreamDecode UseCIEColor (see Section 4.8.3 in PS3 RM draft) Known problems: - Setting HWSize by itself with setpagedevice has no effect. - When shrinking oversize halftone cells, the current algorithm, which progressively halves the size, can produce non-monotonic behavior; GS should either use a monotonic algorithm or give a limitcheck. (k/jdscreen.ps) - In Type 1 fonts, almost-vertical lines that straddle a stem edge produce uneven output. - At some resolutions, gaps occur in some character outlines with certain Type 1 fonts. (? - no test file) - The Watcom MS Windows makefile (watcw32.mak) doesn't work. - The uniprint driver sometimes drops some output, and is very slow at 720x720 resolution. - Halftones look relatively coarse: we should be using a small-scale version of AccurateScreens (multiple small dot cells with an ordered dither cell visiting pattern) to get both fine screens and many levels. - Since the x11alpha device uses saturation to emulate alpha, writing anti-aliased objects over dark areas produces incorrect output. (gdevxalt.c) - Setting OutputFile=- should redirect stdout to stderr (or provide some other way to redirect stdout). - There is a problem on page 3 of k/microw-j.pdf, related to Type 0 fonts. - Ghostscript can't handle double-byte TrueType fonts. (/import/fonts/cyberbit/CYBERBIT.TTF) - High-level output devices ([e]pswrite, pdfwrite, pxl*) always produce a single output file rather than a separate file for each page, even if there is a %d in the OutputFile name. - ps2pdf doesn't handle the Distiller 3.0 BP/EP/SP pdfmarks. (k/pdfmark3.ps) - CTM is not set correctly for PostScript pass-throughs in the PDF interpreter. - When attempting both RasterOp and anti-aliasing, the anti-aliasing takes effect rather than the RasterOp. - Selecting the nullpage device initially, gsave, change page device, grestore produces infinite recursion. - The MSVC library and Watcom makefiles are broken. - copy_rop doesn't work for 2- or 4-bit devices, because monobit copy_rop may call other device procedures (fill_rectangle, copy_mono, tile_rectangle).

Drivers

Moves some casting macros from generic files to the few specific files that use them. (gdev4693.c, gdevn533.c, gdevsnfb.c)

Interpreter

Changes ImageType 4 images to match the change in the library interface. (zimage3.c)

Library

Fixes bugs: - The MaskColor elements of ImageType 4 images were defined as int rather than uint, truncating the range by 1 bit and causing problems in comparing the mask color against the pixel samples. (gsiparm4.h, gximage4.c) - A needed cast was missing from gs_malloc_memory_release. (gsmalloc.h) - A needed cast from byte to char was missing. (gsparams.c) - Patterns always allocated a mask for rendering, which for large patterns specified directly as bitmaps allocated a lot of unnecessary memory. (gxcolor2.h, gspcolor.c, gxp1fill.c, gxpcmap.c) - Macros simply defining casted versions of variables made the code hard to debug. We have only removed the ones that are in generic code (not drivers) and that cast pointers to gx_device or its subclasses: the only ones removed from header files were prn_dev in gdevprn.h, mdev in gdevmem.h, and ccdev, crdev, and cwdev in gxcldev.h. gdevmem.h, (gdevprn.h, gxclist.h, gdevabuf.c, gdevm1.c, gdevm2.c, gdevm4.c, gdevm8.c, gdevm16.c, gdevm24.c, gdevm32.c, gdevmpla.c, gdevnfwd.c, gdevprn.c, gxacpath.c, gxclimag.c, gxclist.c, gxclpage.c, gxclpath.c, gxclread.c, gxclrect.c) - There was no way to free a pattern instance outside the graphics state. (gspcolor.h, gspcolor.c)

Version 5.30 (limited) (8/10/98)

This is the first beta candidate for the 5.50 release. It completes the merge of the overlapped rasterizing code into the main development line.

Documentation

Fixes bugs: - Yves Arrouye's e-mail address was out of date. (gdevbjc.h, gdevcdj.c, contrib.mak, devices.txt, unix-lpr.txt) Makes the warning against using SHARE_JPEG=1 even stronger. (make.txt, dvx-gcc.mak, ugcclib.mak. unix*.mak) Removes information about using DCL files on VMS to build Ghostscript. (make.txt) Updates the documentation for begin_typed_image. (drivers.txt)

Procedures

Fixes bugs: - The Unix build procedure didn't create the obj subdirectory automatically. (unixhead.mak, unix-end.mak) - gsdll_h wasn't defined for the OS/2 PM device. Fixing this properly required moving the OS/2 drivers into the same makefile as the MS Windows drivers, and renaming the file. (devs.mak, msdevs.mak => pcwin.mak, winlib.mak) - gsiparm4_h was used before it was defined. (lib.mak) - Building with shared libaries still used header files in Ghostscript's directories, not the ones in /usr/include. ****** NOT DONE YET ****** - The makefiles all assumed they were located in the current directory, not in the source directory. (*.mak) Adds new 'debugclean' and 'pgclean' targets, parallel to 'debug' and 'pg', for the Unix platforms. (unix-end.mak) Changes the management of .dev files so that on Unix platforms, one can really maintain standard, debugging, and profiling builds simultaneously. This is a hack, but a fairly reliable one. (gs.mak, unixhead.mak, unix-end.mak) Adds a dummy thread / semaphore / monitor implementation to all platforms other than Windows. (dvx-tail.mak, openvms.mak, os2.mak, ugcclib.mak, unixtail.mak, watc.mak, watclib.mak)

Drivers

Updates driver support to use the new write-position stream. (gdevpsdf.c)

Platforms

Fixes bugs: - The Windows Registry calls didn't deal properly with a null pointer. (gp_wgetv.c) Makes a small change in the platform semaphore / monitor API. (gpsync.h, gxsync.h, gp_win32.c, gxsync.c) Adds a dummy thread / semaphore / monitor implementation. Note that with this implementation, async rendering WILL NOT WORK. (gp_nsync.c) Adds pthreads thread creation and POSIX semaphores for Unix platforms. (We still need to add System V semaphores, which is all that is available on Solaris and BSDI.) (gp_semon.c, gp_posem.c, gp_pthr.c).

Fonts

Fixes bugs: - CIDFontType 0 fonts didn't select the proper VM space for adding entries to font dictionaries, and for loading Subrs strings. (gs_cidfn.ps) - TrueType fonts with an odd glyfs length didn't work. (gs_ttf.ps) - TrueType fonts with a Format 3 'post' table didn't work. (gs_ttf.ps) - TrueType fonts where the encoding in the 'post' table didn't cover the entire set of glyfs didn't work. (gs_ttf.ps) - TrueType fonts with more than 128K of glyfs didn't work. (gs_ttf.ps) - TrueType cmap format 6 didn't work. (gs_ttf.ps) - CIDFontType 0 fonts with hex data didn't skip over the > at the end of the data. (gs_cidfn.ps)

Interpreter

Works around the fact that gs_shfill can't do a gs_setcolorspace for color spaces that require interpreter assistance. (gs_ll3.ps) Moves clipsave and cliprestore to C code. (gs_ll3.ps, zmisc3.c) Updates some files to reflect the redivision of gsmemory.h and gsstruct.h. (imemory.h, istruct.h, ialloc.c)

Streams

Adds a stream that just keeps track of the write position. (stream.h, stream.c) Removes the compilation dependency that required all clients of the zlib filters to be compiled with the zlib source directory in the search path. (szlibx.h, szlibxx.h, szlib[cde].c)

Library

Fixes bugs: - ImageType 4 images with >1 input component didn't work. (gximage4.c) - Sampled functions didn't keep the fractional part when interpolating, possibly leading to infinite recursion in shading. (gsfunc0.c) - The color error value for shadings was computed incorrectly for CIE color spaces. (gxshade.c) - The CharstringType 2 'roll' operator rolled the operands in the wrong direction. (gstype2.c) - Images with RasterOp or transparency didn't retain the current color properly, leading to unpredictable results. (gdevmrop.h, gsropt.h, gdevddrw.c, gdevrops.c, gxdcolor.c, gxiinit.c, gximage3.c) - A cast to void * was needed to remove a const modifier. (gscrdp.c) - On 8-bit non-gray-scale devices, RasterOp values of all-0s or all-1s produced the wrong output. (gdevmrop.c) - The GC procedure for halftone screen enumerators was wrong, possibly causing invalid memory access errors. This bug predates 5.10. (gshtscr.c) - An extra pair of string quotes confused some compilers. (gsshade.c) - There were several errors in the CharstringType 2 'flex' operators. (gstype2.c) - The structure descriptors for devices weren't initialized in library-only configurations. (int.mak, gconf.c) - The Pattern cache got confused if the current device when a Pattern color was used wasn't the same as the current device when the Pattern instance was created. (gxpcmap.c) - The target of forwarding devices wasn't reference-counted properly. (gsdevice.c) ****** FIXING THIS PROPERLY WILL BE A LOT OF WORK: WE ONLY FIXED gs_setdevice_no_erase ****** - As a result of fixing a typo, the structure declaration for gx_page_queue was private, causing clients not to compile. We left it private and added an instance allocation procedure. (gxpageq.h, gdevprna.c, gxpageq.c) - The mask for ImageType 3 images was clipped (incorrectly). (gximage3.c) - Interpolated images with negative X->X values in the CTM were displaced on the page. (gxiscale.c) Finishes integrating the asynchronous rendering code. (gpsync.h, gxclist.h, gdevprna.c, gsmemlok.c, gxclimag.c, gxclpath.c, gxclutil.c) Updates the memory manager API for additional flexibility needed for asynchronous rendering. (gsmalloc.h, gsmemlok.h, gsmemraw.h, gsalloc.c, gsmalloc.c, gsmemlok.c) Updates the standard memory manager to work with a fixed (externally supplied) set of chunks, needed for asynchronous rendering, removing some macros in the process. (gsalloc.h, gsalloc.c) Updates some code to use more mnemonic variable names. (gstype2.c, gxicolor.c) Removes some macros for better readability. (gdevmrop.c) Adds dummy implementations of clipsave and cliprestore. (gsclipsr.h, gsclipsr.c) Implements an alternative, but completely untested, parameter list serializer based on streams. (gsparam2.c) Moves more of the internal memory manager structures from gsmemory.h to gsstruct.h. (gsmemory.h, gsstruct.h, gsmemory.c)

Version 5.28 (limited) (8/3/98)

This fileset almost finishes merging in the code for overlapped ("asynchronous") interpretation and rasterizing that gave rise to the side-branch versions 5.13 and 5.14; eliminates all initialized non-constant globals from the graphics library (but not from the interpreter); and adds a few more LanguageLevel 3 features (CIEBasedDEF[G] color spaces, CloseSource and CloseTarget for streams, Separation base space for Indexed color spaces). We were not originally planning to produce another fileset until the code merge was completed; however, the schedule demands of another Aladdin project justify another intermediate fileset.

Documentation

Notes that the MSVC++ 5.0 compiler may lock up when compiling gxi12bit.c with optimization. (make.txt)

Procedures

Fixes bugs: - psl3 didn't include fzlib. (int.mak) - The Windows makefile had the wrong name for a DLL. (winint.mak) - The Borland Windows makefile had several errors. (bcwin32.mak) At the request of a user, changes the creation of jconfig.h so it #includes, rather than copies, arch.h. (jpeg.mak, gsjconf.h)

Utilities

Fixes bugs: - viewpbm.ps scaled the image wrong. (viewpbm.ps)

Drivers

Fixes bugs: - clist_close was declared as an open proc rather than a close proc. (As it happens, this didn't make any difference.) (gxclist.c) - A comment was improperly terminated. (gxpageq.h) - A needed #include of memory_.h was missing. (gdevpsde.c) Integrates nearly all the rest of the code for asynchronous rendering. (gdevprn.h, gdevprna.h, gxcldev.h, gxclist.h, gxclpath.h, gxclmem.h, gdevbmpa.c, gdevprn.c, gdevprna.c, gxclbits.c, gxclimag.c, gxclist.c, gxclmem.c, gxclpath.c, gxclread.c, gxclrect.c) Changes tracing of memory-based clists to occur only if -Z: is selected, rather than always if the code was compiled with -DDEBUG. Note that this is a NON-BACKWARD-COMPATIBLE CHANGE (but only affects debugging). (gxclmem.c) Implements the NumCopies parameter for all page devices, not just printers. (gxdevcli.h, gxdevice.h, gdevprn.c, gsdparam.c) Splits off command list writing utilities into a separate file, since gxclist.c was getting too large. (gxclist.h, gxclist.c, gxclutil.c) Splits command list reading into control (gxclread.c) and the actual list interpreter (gxclrast.c), since the file was getting too large. (gxcldev.h, gxclrast.c, gxclread.c) Distinguishes dev_proc_* (defining a general driver procedure) from prn_dev_proc_* (defining a printer driver procedure). Unfortunately, we have to keep dev_proc_print_page and _print_page_copies for backward compatibility. (gdevprn.h) Splits out of the BMP driver the parts shared with the async version (gdevbmp.h, gdevbmp.c, gdevbmpc.c). Changes the band rasterizer to implement get_bits_rectangle rather than get_bits. In some cases, this results in much less computation. (gxclist.c, gxclread.c) Makes the monochrome H-P printer drivers emit a printer reset when closing the device. According to a user, this helps prevent the ink nozzles from clogging. (gdevdjet.c)

Platforms

Fixes bugs: - The Windows DLL entry point procedure didn't return a value as it was supposed to. (gp_mswin.c) Removes all remaining initialized but non-constant globals, and ensures that all non-debugging-related BSS variables in the library are explicitly set to 0 at initialization time. (gp_unix.c) Improves an error message slightly. (dwmainc.cpp)

Interpreter

Fixes bugs: - The tracing code for restore_resources could access an invalid address. (isave.c) - sizeof(procedure) is not allowed in ANSI C++. (opdef.h, iccfont.c, interp.c, ireclaim.c) - A variable was declared incorrectly as bin_token_type_t rather than bin_seq_type_t. (iscanbin.c) - The behavior of copypage didn't change in LanguageLevel 3. (gs_init.ps) - When grestore et al reactivated a page device, they performed an initgraphics, which should only be performed by showpage. (gs_setpd.ps) - The RunLengthEncode filter was broken in cases where the caller supplied a record size. (bug introduced in 5.2x) (zfilter.c) - A needed #include of memory_.h was missing. (zfreuse.c) - On machines with sizeof(long) > sizeof(int), the dictionary form of image and imagemask didn't work. (bug introduced in 5.2x) (zimage2.c) - exitserver left a 'true' on the operand stack. (gs_lev2.ps) Replaces the STACK_LOOP_BEGIN/END macros with procedures. (We retain the macros for backward compatibility.) (istack.h, istack.c, zchar.c, zcontrol.c, zdict.c, zvmem.c) Reviews the remaining operator files for ease of reading / debugging, including removing macros where appropriate. (z*.c) Changes the dictionary stack printer to indicate whether the dictionary is allocated in global or local VM. (gs_init.ps) Redefines countexecstack and execstack as operators, solely for the sake of the Genoa [count]execstack tests. (gs_init.ps, zcontrol.c) Changes array/string/packedarray forall not to keep an index on the stack, solely for the sake of the Genoa [count]execstack tests. (zgeneric.c) Finishes implementing CIEBasedDEF[G] color spaces. (icie.h, zcie.c) Adds a ColorSpace resource instance for sRGB. (gs_lev2.ps, gs_res.ps) Implements CloseSource and CloseTarget for filters. ****** DOESN'T WORK IF AN EXCEPTION OCCURS DURING A NESTED CLOSE. ****** (zfile.c) Allows Separation and DeviceN color spaces as the base space for an Indexed color space. (zcsdevn.c, zcsindex.c, zcssepr.c)

Interpreter (PDF)

Fixes bugs: - In PDF files, Indexed color spaces with a CIEBasedABC base space gave an /undefined error. (pdf_draw.ps)

Streams

Fixes bugs: - The report_error member of the DCT streams wasn't initialized early enough. (ifilter.h, zfdctd.c, zfdcte.c, zfile.c) Changes the zlib filters to use the stream's allocator, rather than the default allocator, for their private storage. Note that this requires the stream itself to keep pointers to this storage, for garbage collection. (szlibx.h, szlibc.c, szlibd.c, szlibe.c) Updates some clients to use new, simpler GC structure descriptors. (sdct.h, sfilter.h, sdctc.c, sfilter1.c) Adds a close_strm member for the interpreter's use (CloseSource / CloseTarget). (stream.h, stream.c)

Library

Fixes bugs: - gstate, currentgstate, and setgstate didn't handle the effective clip path properly, possibly leading to dangling pointers. (gsstate.c) - setrasterop, setsourcetransparent, and settexturetransparent should all return int rather than void, since they can fail. (gsrop.h, gsrop.c) - FunctionType 1 functions didn't clip the output value to the Range. (gsfunc3.c) - A needed cast from byte * to char * was missing. (gscrdp.c) - Some needed #includes of *_.h were missing. (gscrd.c, gscrdp.c, gxshade6.c) - The prototype for gx_effective_clip_path wasn't #included in a needed place. (gsimage.c) - RasterOp sometimes didn't work properly for devices whose representation of white wasn't a pixel value of 0. (gxdcolor.h, gdevbbox.c, gdevdbit.c, gdevvec.c, gslib.c, gxdcolor.c) - The variable used to detect double declaration of gs_get_bits_params_t was named incorrectly. (gxdevcli.h, gxgetbit.h) - gs_[eo]clip never retained the clipping path in its original form. These routines now retain it in the simple case (the old clipping path is a rectangle, and the new path is completely contained within it). This requires a small NON-BACKWARD-COMPATIBLE change in the gx_cpath_intersect procedure: it no longer updates the new path, and it flattens the path if needed. To avoid problems, we renamed this procedure as gx_cpath_clip. (gsdps.c, gspath.c, gxcpath.c) - If the image was empty, gs_image_common_init didn't free the lower-level enumerator. (gsimage.c, gxccache.c) Removes all remaining initialized but non-constant globals, and ensures that all non-debugging-related BSS variables in the library are explicitly set to 0 at initialization time. (gxdevice.h, gconf.c, gsdevice.c, gshtscr.c, gsiodev.c, gsutil.c, gxcht.c) Finishes implementing table-driven GC descriptors. We expected it to save considerable space at negligible time cost; it actually shrank the 1Mb executable by only about 5K, and slowed down garbage collection by about 2%. (gsfcmap.h, gsstrtab.h [deleted], gsstruct.h, gzpath.h, gsfcmap.c, gsmemory.c, gsstrtab.c [deleted]) Finishes implementing CIEBasedDEF[G] color spaces. (gscie.h, gscie.c) Simplifies some code by removing or redefining macros. (gxi12bit.c) Removes all patches made for easier retrofitting of 5.2x code into 5.1x filesets. (gdevdrop.c, gdevmrop.c, gslib.c, gspcolor.c) Reviews a few more files for style and readability. (gxbitfmt.h, gxgetbit.h) Allows Separation (and, if included, DeviceN) color spaces as the base space of an Indexed color space. Unfortunately, this involves introducing a new distinction in color space types, which entails NON-BACKWARD-COMPATIBLE changes in the color space and color space type structures. (gxcspace.h, gscdevn.c, gscolor1.c, gscolor2.c, gscpixel.c, gscscie.c, gscsepr.c, gscspace.c, gspcolor.c) Makes a small addition in order to fix an interpreter bug. (gxfixed.h, gdevbbox.c)

Version 5.27 (limited) (7/18/98)

This is another "in-flight" snapshot made in preparation for the 5.2x / 5.1x code merge. It completes the driver CRD API.

Documentation

Fixes bugs: - The reference to psview was out of date. (new-user.txt) Adds some pointers to Aladdin Ghostscript mirror sites. (new-user.txt) Updates the C style guide a little further. (c-style.txt) Adds documentation on driver-supplied CRDs. (drivers.txt) Updates the JPEG makefile to mention IJG release 6b. (jpeg.mak) Updates documentation to reflect the devs.mak / contrib.mak split. (README, devices.txt, drivers.txt, make.txt, new-user.txt, source.txt, use.txt)

Procedures

Fixes bugs: - sjpegerr.o was needed even when using the shared JPEG library. (jpeg.mak) Changes the name of the jpeg library directory from jpeg-<version> to just jpeg, to parallel libpng and zlib. (make.txt, *.mak) Creates a separate makefile for contributed drivers. Eventually these drivers will go in a separate directory. (devs.mak, contrib.mak, *.mak)

Drivers

Fixes bugs: - The pkm driver was absurdly inefficient. (gdevpbm.c) - The psfax driver (which, admittedly, doesn't come close to working) no longer compiled. (gdevpfax.c) - The ARCHAIC mode of the Epson driver emitted an incorrect character ('r' instead of ^R). (gdevepsn.c) - The X driver didn't check the calls of XInitImage for error status. (gdevx.c) Updates a client for the change in the names of the gb_ values. (gdevx.c) Updates a client for the added param_request procedure. (gdevpsdf.c) Reformats all Aladdin-maintained drivers to the new Ghostscript standard format, using indent. We deliberately did not reformat user-contributed drivers, since indent mangles a line once in a while and we do not want to take responsibility for fixing others' code. (*.h, *.c) Adds a default CRD specification to the 'bit' device, for testing. (gdevbit.c) Integrates a bit more of the support code for asynchronous rasterizing. (gxband.h, gxclio.h, gxclist.h, gxclmem.h, gxclfile.c, gxclist.c, gxclmem.c, gxclread.c, gxpageq.h, gxpageq.c)

Platforms

Adds thread support to the Win32 platform. (gp_win32.c)

Interpreter

Fixes bugs: - Composite fonts with CID-keyed descendants didn't run the BuildGlyph procedure. (zchar.c) - The internal representation of CMaps was built incorrectly. (zfcmap.c) - Category resources didn't load from files automatically. (gs_res.ps) Reformats all files to the new Ghostscript standard format, using indent. (*.h, *.c) Reviews most of the operator files for ease of reading / debugging, including removing macros where appropriate. (z*.c) Updates a client for the change in the names of the gb_ values. (zdevice.c) Updates a client for the added param_request procedure. (iparam.c) Updates clients for the completion of the CRD API. (zcie.c, zcrd.c) Increases the initial size of systemdict a little more, to allow for -d and -s. (iinit.c)

Interpreter (PDF)

Fixes bugs: - Text modes other than 0 didn't work with multiple-byte fonts. (pdf_ops.ps) - There were many bugs in the code for Type 0 and CIDFontType 0 fonts. (pdf_font.ps)

Library

Fixes bugs: - cshow returned a character code of -1 for composite fonts with FMapType 9 (CMap-based). (gsfcmap.h, gschar0.c, gsfcmap.c) - The GC procedure for enumerating show enumerators was broken. (bug introduced in 5.24 or 5.25) (gschar.c) - dashpath always copied the path, instead of only copying it if needed. (gspath1.c) - The hint replacement fix in 5.24 sometimes thought a path was closed when it wasn't, producing gross distortions of some characters. (gxhint3.c) Cleans up code for debugging by expanding macros, etc. (gstext.h, gschar0.c) Changes the gb_ values to all caps, in line with general C convention. This is a NON-BACKWARD-COMPATIBLE change to an as yet rarely-used API. (gxbitfmt.h, gdevalph.c, gdevdgbr.c, gdevmem.c, gsalphac.c, gximage2.c) Enhances the default implementation of parameter lists to allow requesting individual parameters. This is needed for the driver CRD API. (gsparam.h, gscparam.c, gsparam.c) Completes the API for driver CRDs, also moving some code from gscie.c to gscrd.c. This involves a NON-BACKWARD-COMPATIBLE change in the prototype of the TransformPQR procedures. (gscie.h, gscrd.h, gscrdp.h, gscie.c, gscrd.c, gscrdp.c) Reformats all files to the new Ghostscript standard format, using indent. (*.h, *.c) Splits up gdevmrop.c into 3 files: gdevmrop.c (RasterOp implementation for memory devices), gdevdrop.c (default and device-independent RasterOp algorithms), and gdevrops.c (RasterOp-source device). (gdevmrop.h, gdevdrop.c, gdevmrop.c, gdevrops.c)

Version 5.26 (limited) (7/7/98)

The purpose of this fileset is to add an API for drivers to provide one or more device-appropriate CIE rendering dictionaries. Like 5.25, it is a "snapshot" fileset not made available even to beta testers.

Procedures

Fixes bugs: - An !endif was omitted. (msvc32.mak) - A newly needed Windows library was omitted. (msvctail.mak) - The /Za and /Ze switches were set incorrectly for MSVC. (bcwin32.mak, msvccmd.mak, watcw32.mak, winint.mak, winlib.mak)

Drivers

Fixes bugs: - A closing bracket was omitted (in code that is ifdef'd out). (gdevpdf.c)

Fonts

Changes the font loader so that instead of pushing systemdict and a small empty dictionary on the stack before loading a font, it pushes userdict. This is what Adobe interpreters do, but this will probably break some PostScript files, specifically ones that redefine 'index'. I don't see how the Adobe interpreters can possibly do the right thing for such files. (gs_fonts.ps, gs_type1.ps)

Interpreter

Updates clients for changes in CRD API. This involves some changes in internal procedures. (gs_lev2.ps, icie.h, zcie.c, zcrd.c)

Library

Fixes bugs: - Pickling string, name, and array parameters tried to force inappropriate alignment. (gsparams.c) - Pickling dictionary parameters wrote the result in the wrong place. (gsparams.c) - An occurrence of dev_t should have been gx_device. The compiler didn't catch this because there happens to be a type named dev_t in <types.h> (!). (gxclread.c) Adds an API for drivers to provide one or more CRDs (as device parameters). Makes a small but NON-BACKWARD-COMPATIBLE change in the names and argument lists of the existing CRD API (which is not used by anything in the standard configuration). (gscie.h, gscrd.h, gscrdp.h, gscie.c, gscrd.c, gscrdp.c, gslib.c)

Version 5.25 (limited) (7/1/98)

This is a "snapshot" fileset created for the purpose of merging with a separate development branch. While it fixes some significant bugs in 5.24, it doesn't represent substantial additional progress.

Documentation

Completely rearranges the C style guide, updates it to reflect current practice, and adds a 1-page summary of the most important points. (c-style.txt) Updates the man pages for consistency and to correct minor errors. (*.1) Notes that the pjxl300 driver works with the H-P CopyJet. (devices.txt, devs.mak). Notes that in order to deal with over-zealous Solaris security checking, additional linker switches are needed. (make.txt, unix*.mak)

Procedures

Fixes bugs: - 'make install' didn't get the executable from the right place. unixinst.mak) - COMPILE_INITS=1 didn't work. (int.mak, geninit.c) - The MSVC makefile updates hadn't been applied to the MSVC-only devices. (devs.mak) - The other PC makefiles didn't define GLCCWIN. (bcwin32.mak, watcw32.mak) Adds bounding box testing to the library test program. (ugcclib.mak) Reviews and reformats code for maintainability. (genarch.c, geninit.c) Moves the MS Windows-specific devices to a new file. (bcwin32.mak, devs.mak, msdevs.mak, msvc32.mak, watcw32.mak)

Platforms

Reviews and reformats header files for maintainability. (vmsmath.h, windows_.h) Removes some no-longer-used files from the fileset. (overlay.h, gp_itbc.c)

Fonts

Fixes bugs: - Substituted fonts had their FontName set to the requested one. There was a comment in the code saying that some files that depend on this happening, but Adobe implementations don't do it. However, aliased fonts in Fontmap will continue to have the FontName set to the Fontmap key. (gs_fonts.ps) Adds the euro symbol at position 240 (0360) in SymbolEncoding. This is a PostScript 3 addition, but it's too much work to make it appear there only if languagelevel >= 3. (gs_sym_e.ps)

Interpreter

Fixes bugs: - The bbox device didn't work if its target was itself a forwarding device. (gdevbbox.c) - User parameters maintained at the PostScript (as opposed to VM) level didn't work. (gs_init.ps) - Idiom recognition didn't work. (gs_init.ps, gs_ll3.ps, zmisc3.c) - .beginpage and .endpage could cause an error if the current device was a page device but was installed with setdevice rather than setpagedevice. (gs_setpd.ps) In the interest of readability, replaces all casting macros with separate variables, other than those used in enum_ptrs and reloc_ptrs procedures. Note that doing this for rptr in gc_trace in igc.c will have a significant performance cost on Intel CPUs, unless the compiler has a very good optimizer, because it introduces another variable competing for scarce registers in the most performance-critical section of code in the garbage collector. (ialloc.c, igc.c, iparam.c, isave.c, istack.c, zchar42.c, zfproc.c, zusparam.c) Changes some macros to procedures. (igc.c, ilocate.c, zusparam.c) Changes some macros to static quasi-constants (only variable for debugging). (zvmem.c) Adds #include "errors.h" to oper.h, removing it from z*.c. (oper.h, z*.c) Reviews and reformats some header files for maintainability. This is an ongoing project. (bfont.h, errors.h, iinit.c) Consolidates and simplifies the reading and writing of binary tokens and binary object sequences. (bseq.h [deleted], btoken.h, ibnum.h, ibnum.c, iscanbin.c, zbseq.c) Adds dummy user and system parameter entries for all the parameters listed in Appendix C of the PostScript Red Book: even though the book clearly says that no PostScript program should rely on the presence of any particular parameter, PostScript files routinely assume the existence of the parameters listed in Appendix C. (gs_init.ps, gs_lev2.ps, gs_res.ps) Adds dummy user and system parameter entries for the new parameters listed in the 3010 Supplement. (gs_ll3.ps) Adds double-inclusion protection to all header files. (*.h) Moves the creation of binary object sequence headers from C to PostScript code. (zbseq.c, gs_btokn.ps) Adds support for multiple FormTypes and ColorRenderingTypes. (gs_init.ps, gs_lev2.ps, gs_res.ps, zcrd.c) Updates structures and clients for the introduction of "raw memory" allocators. (ialloc.h, igc.h, ialloc.c, imain.c, isave.c) In the interest of readability and being able to use GNU indent to create standard formatting, changes the operator tables from procedures back to data structures. This change is backward-compatible for all operator files, although we also edited all of Ghostscript's own operator definitions to remove the BEGIN_OP_DEFS and END_OP_DEFS macros (which now have to generate a little unnecessary code for backward compatibility). (opdef.h, iconf.c, iinit.c, iutil.c, z*.c) Splits zchar2.c into a Level 1+ part and a Level 2 part. (zcfont.c, zchar2.c)

Interpreter (PDF)

Adds font synthesis based on the FontDescriptor. Currently this is very rudimentary. (pdf_font.ps)

Drivers

Fixes bugs: - The PDF writer didn't default to A4 paper size if A4 was selected as the default in the makefile. (gdevpdf.c) - The default implementation of the begin_image procedure always called the image's begin_image implementation, rather than the device's begin_typed_image implementation. (gdevddrw.c) - The bbox device didn't initialize its reference count. (gdevbbox.c) - A necessary cast was omitted. (gdevpsde.c) Changes some macros to procedures. (gdevpstr.h, gdevpstr.c) Adds an internal device to implement the PCL5 special color mapping algorithms. (gdevcmap.h, gxdevice.h, gdevcmap.c, gdevnfwd.c) Adds double-inclusion protection to all header files. (*.h) Updates drivers for the change in begin_image. (gdevbbox.c, gdevpdfi.c, gdevvec.c, gxclimag.c)

Library

Fixes bugs: - The non-ANSI definitions of CLEAR_MARKS_PROC, ENUM_PTRS_BEGIN_PROC and RELOC_PTRS_BEGIN were missing a parameter. (gsstruct.h) - A few necessary casts were omitted. (gsparam.c, gxpcmap.c) - Images or Patterns with non-default RasterOps could cause crashes. (gdevmrop.c, gxp1fill.c) - Exponential Interpolation functions with non-integral positive exponents incorrectly required the lower bound of the domain to be strictly positive rather than only non-negative. (gsfunc3.c) - The attempt to achieve the desired color smoothness when shading could compute (nearly) forever. (gxshade.c, gxshade1.c) - The arc change in 5.24 caused arcs to render incorrectly. (gspath1.c) - The macro-reducing cleanup in 5.24 introduced a bug in handling copy operations with negative skew. (gdevm1.c) Adds unmasked images and bounding box testing to the library test program. (gxdevcli.h, gslib.c) Changes some macros to procedures. (gxfunc.h, gsfunc.c, gsfunc0.c, gsfunc3.c) Adds double-inclusion protection to all header files. (*.h) Reviews and reformats header files for maintainability. (*_.h, dodebug.h [deleted]) Changes the structure of the common part of the image enumerator to include the device (which may be different from the original device, because of forwarding), and to access the procedures through a pointer to a const structure. This is a NON-BACKWARD-COMPATIBLE CHANGE for implementors of begin_image, since they now must pass the device to gx_image_enum_common_init. (gximage.h, gxiparam.h, gdevddrw.c, gdevdflt.c, gxiinit.c, gximage3.c, gximage4.c) Adds tests of the new color mapping device to the library test program. (gslib.c) Removes the last vestiges of segmented pointers. (genarch.c, std.h) Introduces a "raw memory" API, primarily for managing the underlying memory pool for embedded systems. This involves a NON-BACKWARD-COMPATIBLE-CHANGE in the implementation (but not ordinary clients) of allocators. (gsmemory.h, gsmemraw.h, gxalloc.h, gsalloc.c, gsmalloc.c, gsmemory.c)

Version 5.24 (limited) (6/17/98)

In addition to the usual bug fixes, and a few enhancements where temptation proved irresistible or in response to an external need, this fileset: - Takes the first steps on a major readability cleanup (4-space indentation instead of 2, replacement of macros by procedures, ....) - Implements a bit more of the DPS functionality, including view clipping, and gstate stack copying for 'fork'. - Starts to sketch a text API for drivers. - Changes the Unix makefiles so that they create production binaries in a separate directory. Again, there are some non-backward-compatible changes required by other architectural improvements. As always, we have tried to minimize the impact of such changes on users' code.

Documentation

Fixes bugs: - The -Kn switch wasn't documented. (use.txt) - The term "Software" was used instead of "Program" in the last paragraphs of the license. (PUBLIC) Adds a couple of missing operators to the list at the end of ostack.h. (ostack.h) Documents more precisely which gstate points to which objects after various gstate operations. (gsstate.c) Corrects some addresses for the Free Software Foundation. (commprod.txt, new-user.txt) Improves the documentation for memory management of color spaces. (gscie.h, gscolor2.h) Updates the list of hardware available to Aladdin. (new-user.txt) Documents ReopenPerPage. (language.txt) Moves the documentation of image rendering procedures to a better place. (gximage.h, gxiinit.c) Clarifies that old slzwe.c files may not work with current Ghostscript versions. (make.txt)

Procedures

Fixes bugs: - psl3.dev didn't include func.dev. (int.mak) - device and device2 devices weren't sorted together, causing devices to appear in the list out of order (including, possibly, selecting the wrong device as default). (genconf.c) - The mswindll module definition omitted some needed files. (devs.mak) Changes the optimization level for gcc from -O to -O2 for both standard and profiling builds. (unix-gcc.mak) Defines 3 new makefile macros for the Unix platforms, CFLAGS_{STANDARD|DEBUG|PROFILE}, that give the additional compiler switches for these 3 compilation options. (unixansi.mak, unix-cc.mak, unix-gcc.mak) Changes the Unix makefiles so that by default they create the binaries in an 'obj' subdirectory of the source directory. (unixansi.mak, unix-cc.mak, unix-gcc.mak, unix-end.mak) Updates the MSVC++ makefiles so they allow setting any configuration parameter from the make command line. (msvc32.mak, msvccmd.mak, msvccom.mak [deleted], msvclib.mak, msvctail.mak)

Utilities

Fixes bugs: - ps2ascii was broken. (ps2ascii.ps) Adds capability to gslp.ps: - Variable-width fonts (but without automatic line breaking); - Pair kerning (from AFM file); - Inter-character and space width adjustment. This project was done for a paying customer. (gslp.ps)

Drivers

Fixes bugs: - The name of the plan9bm device was wrong. (gdevpbm.c) - The PDF writer wrote incorrect parameters for the CCITTFax filter used to compress Type 3 font bitmaps. (bug introduced in 5.23) (gdevpdfi.c) - The PDF writer emitted two 'endobj' lines for Type 3 bitmap fonts. (gdevpdf.c) Removes all remaining uses of _ds and _ss in Aladdin's drivers. (gdevprn.h, gdevsvga.h, gdevbit.c, gdevcgm.c, gdevdjet.c, gdevmsxf.c, gdevpbm.c, gdevpccm.c, gdevpcfb.c, gdevpdfi.c, gdevprn.c, gdevsvga.c, gdevtfax.c) Renames a local macro named END. (gdevcgml.c) Removes all uses of far_data other than for device (but not device2) prototypes. (gdevbit.c, gdevdjet.c, gdevemap.c, gdevmsxf.c, gdevpbm.c, gdevpcfb.c, gdevpcx.c, gdevpdf.c, gdevpng.c, gdevps.c, gdevpsim.c, gdevpx.c, gdevtfax.c, gdevtfnx.c, gdevvglb.c, gdevx.c, gdevxalt.c) Adds a psrgb driver that writes PostScript (Level 2) planar, run-length-compressed, 24-bit RGB images. (gdevpsci.c) Starts to define and implement a driver procedure for text. This interface will certainly change in the future as we get more insight into the division of responsibility and control flow between generic code, individual drivers, and internal and external fonts. This involves a major NON-BACKWARD-COMPATIBLE CHANGE in the gs_show_enum structure (which no client should be accessing directly). (gdevmem.h, gdevprn.h, gstext.h, gxchar.h, gxdevcli.h, gxdevice.h, gxtext.h, gdevbbox.c, gdevht.c, gdevnfwd.c, gschar.c, gschar0.c, gstext.c, gxacpath.c, gxclip.c, gxclip2.c, gxclipm.c, gxclist.c, gxpcmap.c) Extends the parameter list printer to handle names and arrays. (gdevpsdf.c) Implements the ability to write out a Type 1 font definition, for embedding fonts in PDF output. Currently this code isn't called from anywhere, and it will certainly be subject to change in the future. (gdevpsdf.h, gdevpdfi.c, gdevpsde.c, gdevpsdf.c) Adds the PCL XL Protocol Class 2.0 operators, attributes, and enumerated values to the relevant header files. (gdevpxat.h, gdevpxen.h, gdevpxop.h) Converts some additional devices to -dev2, to make them const. (devs.mak, gdevjpeg.c) To help in debugging, changes all uses of #define ss ((stream_xxx_state *)st) to stream_xxx_state * const ss = (stream_xxx_state *)st; (gdevpdfi.c, gdevpsdi.c, gdevpsdp.c, gdevpsds.c) Massages mem_mono_copy_mono and mem_mono_strip_tile_rectangle to reduce the use of macros somewhat. (gdevm1.c, gdevmem.h) Makes a change to support the change in gs_param_list_common. (gdevpsdf.c) Replaces all remaining uses of do { ... } while (0) with BEGIN ... END. (gdevpdfm.c, gdevpx.c, gdevx.c, gdevxalt.c) Adds a ReopenPerPage Boolean device parameter for printers, which causes the output file to be closed and reopened for each page. This may be helpful in persuading spoolers to start printing as soon as the first page is available. (gdevprn.h, gdevprn.c) Makes the %-format validator for output file names a procedure, even though it's only called in one place. (gdevprn.c) Updates some clients for the change from std_procs to procs. (gdevp2up.c, gdevpbm.c, gdevupd.c, Removes the use of the CleanFaxData tag (327) from TIFF output, since many applications don't recognize it and it isn't in the TIFF 6 documentation. (gdevtifs.h, gdevtfax.c)

Platforms

Adds a new gp_setmode_binary platform procedure, to set a file into binary mode on platforms that distinguish text and binary. (gp.h, gp_*.c)

Fonts

Fixes bugs: - The derived (Bold, Oblique, ...) Hershey fonts were broken. (fonts/makeher.ps, fonts/h*.ps)

Interpreter

Fixes bugs: - As always, gcc failed to report some signed/unsigned char * mismatches. (imainarg.c) - Some needed #includes were missing. (zcrd.c, ztype.c) - Contexts were always allocated in global VM (should be local VM), and were freed in the current VM (should be local VM). Fixing this required changing some internal interfaces defined in icontext.h. (icontext.h, icontext.c, interp.c, zcontext.c) - restore did some unnecessary gsaves. (zvmem.c) - Creating a new context didn't initialize the graphics state properly, and didn't do the first gsave that grestoreall relies on. (gs_dps.ps) - The bookkeeping for open files didn't work with multiple contexts. Fixing this required a substantial (simplifying) redesign of the interpreter's bookkeeping for streams in general: this may have introduced new bugs. (files.h, ireclaim.c, isave.c, zfile.c) - fork didn't copy the graphics state stack. (zcontext.c) - The space bits were set incorrectly in the array reference for the operand stack, causing the garbage collector not to mark the operand stack of contexts other than the current one. (interp.c) - LanguageLevel 3 facilities weren't enabled when desired. (gs_ll3.ps, ilevel.h, opdef.h, iinit.c, zcsdevn.c, zimage3.c, zmisc2.c, zmisc3.c, zshade.c, ztrap.c) - flushfile with a procedure-target stream didn't pass the buffered data to the procedure. We tinkered with this a little, but it still isn't fixed. (zfilter.c, zfproc.c) - The top-level color space objects allocated by the CIE color space setting operators were never freed (until garbage collection). (zcie.c) - setpagedevice with a 0-size page didn't fail. (gs_setpd.ps, zmedia2.c) - If one or more of the matrices in a CIE color space or CRD was singular, setcolorspace or setcolorrendering could cause a stackoverflow. (zcie.c) - defineuserobject didn't work. (I don't see how it could ever have worked.) (gs_dps2.ps) - The version string wasn't read-only. (gs_init.ps, gs_lev2.ps, gs_ll3.ps) - Some standard resource categories weren't defined (which they need to be, even if they have no instances). (gs_res.ps, gs_ll3.ps) - The Trapping ProcSet was empty. (gs_ll3.ps) - setvmthreshold didn't accept a value of -1. (gs_lev2.ps, gs_pdfwr.ps, zusparam.c, zvmem2.c) - Binary tokens containing native reals with swapped byte order didn't read in properly. (ibnum.c, iscanbin.c) - In binary object sequences, many executable objects were incorrectly written out as literal. (zbseq.c) - String DataSources for shadings didn't work. (zshade.c) - Parameter dictionaries with integer keys didn't work. (iparam.c) - A "can't happen" condition caused massive confusion instead of a rangecheck error. (gs_setpd.ps) - setcachelimit and setcacheparams were broken, because they no longer interacted correctly with setuserparams and setsystemparams. (gs_lev2.ps) - The source width and height of images was arbitrarily limited to 32767. (zimage2.c) - The optional dictionary parameter for filters was the last operand, not the first. (zfbcp.c, zfdecode.c, zfilter.c, zfilter2.c, zfilterx.c, zfzlib.c) - If the current color space was Indexed, Separation using the alternative space, or DeviceN using the alternative space, currentgray/cmykcolor/hsbcolor/rgbcolor returned 0 rather than the underlying color. (This was a correction to the Red Book in the 3010 Language Supplement, Section D.2.4 and D.2.5.) (gscolor.c, gscolor1.c, gxcspace.h) Implements some additional LanguageLevel 3 stream facilities: - CloseSource and CloseTarget (parsing only). (ilevel.h, zfilter.c) - Dictionary argument for SubFileDecode. (zfilter.c) - UnitSize (fully implemented) and LowBitFirst (parsing only) for LZWDecode. (zfdecode.c) - ReusableStreamDecode (incomplete). (gs_ll3.ps, zfreuse.c) Removes all remaining uses of _ds and _ss. (bfont.h, errors.h, files.h, icie.h, idict.h, idparam.h, ifunc.h, iscan.h, iutil2.h, opdef.h; iccfont.c, idict.c, idparam.c, igc.c, iinit.c, iparam.c, iscan.c, iscannum.c, iutil2.c, zcid.c, zcie.c, zdevice2.c, zfdecode.c, zfile.c, zfileio.c, zfont0.c, zfont2.c, zfont42.c, zfunc.c, zht2.c, zusparam.c) Removes the use of gs_if_debug_c. (zvmem2.c) Updates clients for the change in color space num_components. (zcolor2.c, zcsindex.c, zcssepr.c, zpcolor.c) Changes the stack manager so it can ensure an unused margin above the top element. This is needed for a possible change in the operator API. (istack.h, istack.c) Decouples the definition of the interpreter instance from the definition of the exported procedures that use it, so that we can use it in more places internally. (iminst.h, main.h) Removes all initialization of static per-context state. (iinit.c, iscan.c, zmath.c) Makes the freeing of VM spaces entirely dependent on the number of contexts referencing them, removing the special handling of interpreter termination. (icontext.h, gsalloc.c, icontext.c, inouparm.c, interp.c, zcontext.c, zusparam.c) ****** IN PROGRESS ****** Enables printing of time and memory usage even in non-DEBUG systems, for benchmarking. (imain.c) Adds a .forceundef operator to parallel .forceput. (gs_init.ps, zdict.c) Rewrites the Form caching code to use the Pattern cache. (gs_fform.ps) Removes all uses of far_data. (imain.c, imainarg.c, iname.c, opdef.h) Moves responsibility for null page devices from C code to PostScript code. (gs_setpd.ps, igstate.h, zdevice2.c, zgstate.c) Changes the context scheduler to not store or reload the state when switching from a context to the same context. (zcontext.c) Moves .registerencoding from C code to PostScript code. (gs_init.ps, zfont2.c) Splits off inames.h (API for names and the name table) from iname.h (API for the interpreter's name table); renames the_nt as the_gs_name_table, and moves it to imain.c. We would like to rename iname.h as names.h, but there are too many places that include it. (igc.h, iname.h, inamedef.h, inames.h, imain.h, idict.c, idstack.c, igc.c, iname.c, interp.c, isave.c) Splits off iestack.h and iostack.h from estack.h and ostack.h, as was done for [i]dstack.h in 5.23. (estack.h, iestack.h, iostack.h, ostack.h, interp.c) Splits off the hit detection device from the user path code, moving it to the library level where it belongs. (zupath.c) Updates the interpreter for the changes in the enum_ptrs, reloc_ptrs, and clear_marks memory management procedures. (igc.c, igcref.c, ilocate.c, zcontext.c) Removes all uses of 'near' from the interpreter: if short and long calls have different formats, we rely on the compiler to generate the most efficient one. (iccfont.c, imainarg.c, iparam.c, zdevice2.c, zdouble.c, zdps.c, zgstate.c, zmatrix.c, zpath.c, zpath1.c, zrelbit.c, ztype.c) Makes a couple of minor changes to support the change in gs_param_list_common. (iparam.h, iparam.c) Changes internaldict to an operator, and executive and findencoding to procedures, in order to satisfy the Genoa FTS. (gs_dps.ps, gs_init.ps, gs_res.ps) Updates clients for the addition of device reference counting. (zpcolor.c, zupath.c) Replaces all remaining uses of do { ... } while (0) with BEGIN ... END. (istruct.h, opcheck.h) Adds a debugging operator for printing out a Type 1 font. (zfont1.c) Updates the Type 1 font operators for the change in the procedure structure. (zchar1.c, zfont1.c) Updates one client for the change in the gs_show_enum structure. (zchar.c) Removes an obsolete "hook" put in for a customer. (zchar.c) Removes the BigStringEncode filter, which was only used by a former customer. (zfilter.c)

Interpreter (PDF)

Fixes bugs: - Images defined in non-Device color spaces were broken. (pdf_draw.ps) Removes some vestiges of the old pdf2ps. (pdf_draw.ps, pdf_main.ps) Adds some leftover PDF 1.2 features: - F, FFilter, and FDecodeParms keys in stream dictionaries. (pdf_base.ps) - Functions, including predefined spot functions. (pdf_draw.ps) - Name trees. (pdf_base.ps) Adds some PDF 1.3 features. Note that these require a fair amount of PostScript LanguageLevel 3 support. Note also that none of these have been tested yet, because we don't have any source of test files. - DeviceN and (stubbed) ICCBased color spaces. (pdf_draw.ps, pdf_ops.ps) - Additional extended graphics state parameters. (pdf_draw.ps) - Number trees. (pdf_base.ps) - Masked images. (pdf_draw.ps) Works around a bug in pdfTeX, which can generate Encoding vectors containing nulls. (pdf_font.ps)

Streams

Fixes bugs: - A needed #include of memory_.h was missing. (sdeparam.c) - The needed input buffer size for the RunLengthEncode filter was 128, but should be 129. (srle.c) - The ASCII85Encode and ASCIIHexEncode filters sometimes didn't insert \n characters often enough. (sfilter2.c, sstring.c) - In one obscure boundary case, the CCITTFaxEncode filter with K = -1 could emit an extra, incorrect code. (scfe.c) - The CCITTFaxDecode filter didn't default DamagedRowsBeforeError to 0. (scfx.h) Removes all remaining uses of _ds and _ss. (sfilter.h, sbcp.c, scfe.c, seexec.c, sfilter1.c, sstring.c) Removes the use of do_debug. (scfd.c) Removes all uses of far_data. (scf.h, scfdgen.c, scfdtab.c, scfetab.c, sjpegerr.c) Removes the save_count member of streams, which is now no longer needed. (stream.h) To help in debugging, changes all uses of #define ss ((stream_xxx_state *)st) to stream_xxx_state * const ss = (stream_xxx_state *)st; (sbcp.c, sbhc.c, sbwbs.c, scfd.c, scfe.c, sdctc.c, sdctd.c, sdcte.c, seexec.c, sfilter1.c, sfilter2.c, sfxfd.c, sfxstdio.c, siscale.c, slzwc.c, slzwce.c, slzwd.c, smtf.c, spdiff.c, spngp.c, srld.c, srle.c, sstring.c, szlibc.c, szlibd.c, szlibe.c) Changes all groups of statistic-gathering variables to be structure variables named stats_*. (scfe.c) Rewrites the CCITTFaxEncode filter to cut down one particularly large and obnoxious macro, and to simplify the code by allocating an output buffer as well as an input buffer. (scf.h, scfdgen.c, scfe.c, scfetab.c)

Library

Fixes bugs: - The masked image clipper sequenced through mask rows incorrectly. (gxclipm.c) - gx_[c]path_init_local_shared were declared as returning void, but could actually return an error. (gxpath.h, gxcpath.c, gxpath.c) - As always, gcc failed to report some static/non-static inconsistencies. However, to my dismay, I find that the ANSI C standard allows these, so I'll have to stop complaining about them. (gxclimag.c, gxclipm.c) - As always, gcc failed to report some signed/unsigned char * mismatches. (gdevpdfi.c, gsparam.c) - A loop counted on a non-existent zero value to mark the end of the IODevice table. (gsiodev.c) - Some needed #includes of memory_.h were missing. (gdevddrw.c, gscolor2.c, gscrdp.c, gscspace.c, gxclipm.c, gximage3.c, gxshade4.c) - Pattern device colors didn't have access to the original halftone phase, making it impossible to handle non-standard X/YStep correctly. (gsdcolor.h, gspcolor.c) - Pattern filling disregarded the phase. THIS MAY UNDO A FIX MADE IN 5.02. WE NEED TO RE-TEST PATTERNS CAREFULLY. (gxp1fill.c) - restore did some unnecessary gsaves. (gsstate.h, gsstate.c) - The reference counting macros could read from an object after freeing it. (gsrefct.h) - setgstate and currentgstate freed the view clipping path, which they shouldn't do. (gsstate.c) - If no view clipping path was set, viewclippath returned the entire extent of the device, not the imageable area. (gxpath.h, gsdps.c, gspath.c) - Assigning one stack-allocated path to another incorrectly wound up sharing their segments. (gxcpath.c, gxpath.c) - dot_length_absolute was incorrectly declared as float rather than bool. (gxline.h) - The test for varying-depth banded images was incorrect, causing varying-depth images to be treated as constant-depth. (This only affected ImageType 3 images.) (gxclimag.c) - Failure to clamp Y values when processing banded images could cause crashes or invalid band list data. (gxclimag.c) - The changes in gsparam.c introduced in 5.23 made the coercion of int arrays to float arrays fail. (gsparam.h, gsparam.c) - Interpolated banded images could be transmitted incompletely, causing narrow stripes to be chopped out of their rendering. (gxclimag.c) - FunctionType 0 functions with 32-bit samples didn't read their data correctly. (gsfunc0.c) - Lattice-form Shadings with packed coordinates could crash or produce incorrect results. (gxshade.c) - Lattice-form Shadings with packed coordinates always returned an error. (gxshade4.c) - If the PaintProc of a Pattern or a Form, or a CharString procedure, or a similar callback copied the current graphics state with gstate or currentgstate, a dangling reference to the device could result. Fixing this required adding a reference count to devices: internally created devices initialize it to 0, externally visible devices initialize it to 1. THIS IS A DELICATE CHANGE AND WILL PROBABLY HAVE A BUG TAIL. (gsdevice.h, gxdevcli.h, gxdevice.h, gdevmem.c, gdevmrop.c, gdevnfwd.c, gschar.c, gsdevice.c, gsmemory.c, gspaint.c, gsstate.c, gxacpath.c, gxccman.c, gxclip.c, gxmclip.c, gxpcmap.c) - The return_if_error macro referred to code rather than code_. (gserror.h) - Non-monotonic halftones didn't allocate enough slots in the halftone cache. (gxht.c) - setpagedevice with a 0-size page didn't fail. Fixing this required making the nullpage device provide explicit InputAttributes. (gdevnfwd.c) - Halftone angles were often slightly off. (gshtscr.c) - Banded fill_mask operations (used for characters) were sometimes broken. This bug was obviously introduced since 5.10; I'm surprised that it didn't have more serious effects. (gxclread.c) - Partially transparent patterns didn't work with non-default RasterOp values. (gxp1fill.c) - The default implementation of strip_copy_rop didn't handle color space conversion properly. (gdevmrop.c) - Hint replacement could cause the initial moveto and final closepath of a Type 1 outline to differ, confusing the filling code. (gxhint3.c) - Interpolated images were truncated at the bottom. (but probably introduced in 5.23) (gxiscale.c) - Using an unsigned type for the index passed to enum_ptrs procedures caused comparisons against signed values to be incorrect. (gsstruct.h) Rewrites the rectangle list and mask clipping algorithms to use callback procedures rather than macros. The rectangle list source code grew by 20%, but the compiled code shrank from 10K to less than 4K; the mask clip source code and compiled code both shrank. (gxclip.h, gxmclip.h, gxclip.c, gxclip2.c, gxclipm.c, gxcpath.c) Removes all remaining uses of _ds and _ss. (gsmemory.h, gsstruct.h, gzht.h, stdpre.h, gp_dosfb.c, gsbitops.c, gscie.c, gsht.c, gstype1.c, gstype2.c, gxclpath.c, gxclread.c, gxcmap.c, gxfill.c, gxi12bit.c, gxop1.h, gxpflat.c, gxstroke.c, gxtype1.c) Changes some GC procedures from explicit code to standard macros. (gsstruct.h, gscscie.c, gxcht.c) For easier debugging, changes gs_debug_c to a procedure; removes gs_if_debug_c and do_debug. (gdebug.h, gsht1.c, gsmisc.c, gspaint.c, gxcht.c, gxht.c, gxpcmap.c) Changes the num_components member of the color space structure to a procedure, which is needed because DeviceN color spaces have a variable number of components; also makes Pattern spaces return -1 - the correct num_components instead of -1. This is a NON-BACKWARD-COMPATIBLE CHANGE. Also adds a base_space procedure. (gxcspace.h, gscdevn.c, gscolor1.c, gscolor2.c, gscpixel.c, gscscie.c, gscsepr.c, gscspace.c, gspcolor.c, gxiinit.c, gxiscale.c) Changes all groups of statistic-gathering variables to be structure variables named stats_*. (gxclip.c, gxclist.c, gxclpath.c, gxfill.c, gxifast.c) Starts to pull apart gs_makebitmap/pixmappattern to remove the dependency on masked images. (gspcolor.c) Splits the C heap allocator from generic allocator support. (gsmemory.c, gsmalloc.c) Removes all uses of far_data other than references to device (but not device2) prototypes. (gdevmem.h, gdevmrop.h, gxdevcli.h, gconf.c, gdevabuf.c, gdevht.c, gdevm*.c, gdevmpla.c, gdevmrop.c, gdevnfwd.c, gsbittab.c, gsflip.c, gsroptab.c, gxcht.c) Adds a streams member to gs_ref_memory_t. The library doesn't use this, but it greatly simplifies the interpreter's bookkeeping. (gsalloc.h, gxalloc.h, gsalloc.c) Adds some more opaque types to the graphics state structure, rather than using naked struct types. (gsccolor.h, gzstate.h) Introduces the notion of the "effective clip path" in a graphics state. Painting operators should now call gx_effective_clip_path rather than using the clip_path member directly. (gxpath.h, gschar.c, gsdps1.c, gsimage.c, gspaint.c, gspath.c, gxccache.c, gxpaint.c) Implements view clipping. (gzstate.h, gspath.c, gsstate.c) Starts to pare down the fit_* macros in gxdevice.h, since some people feel strongly they are hard to follow, and also adds BEGIN/END wrapping. (gxdevice.h, gdevabuf.c, gdevmem.c, gxclpath.c) Refactors the structure definition macros in anticipation of moving to a more table-driven approach. Replaces ENUM_CALL, ENUM_RETURN_CALL, and RELOC_CALL with ENUM_USING and RELOC_USING. (gsstruct.h, gdevmem.c, gshtscr.c, gxcpath.c, gxiinit.c) Sketches a table-driven rather than procedural representation for GC descriptors. We believe this will improve readability, reduce code size, and perhaps reduce cache thrashing during garbage collection. This requires a NON-BACKWARD-COMPATIBLE CHANGE to the enum_ptrs, reloc_ptrs, and clear_marks procedures (to add the structure descriptor as a parameter). This should not affect any ordinary clients, because they should already define these procedures using the macros in gsstruct.h, which *are* backward-compatible; however, they do affect two internal clients that use their own type tags with unions (color spaces and device colors). (gsstrtab.h, gsstruct.h, gsalloc.c, gsstrtab.c) Updates color spaces for the change in enum_ptrs and reloc_ptrs. (gxcspace.h, gscdevn.c, gscolor1.c, gscolor2.c, gscpixel.c, gscscie.c, gscsepr.c, gscspace.c, gspcolor.c) Updates device colors for the change in enum_ptrs and reloc_ptrs. (gsdcolor.h, gxdcolor.h, gxpcolor.h, gspcolor.c, gxcht.c, gxcmap.c, gxdcolor.c, gxht.c, gxp1fill.c) Implements a hit detection device at the library level. (gserrors.h, gdevhit.c) Changes some configuration parameters from #defines to statics. (gschar.c) Changes "simple" structures so they no longer have 0 for the enum_ptrs or reloc_ptrs procedure. This is a NON-BACKWARD-COMPATIBLE CHANGE for structure-definers that don't use the macros in gsstruct.h (of which there shouldn't be any). (gsstruct.h, gsalloc.c) Adds the structure type name to the debugging printout for freeing objects. (gsalloc.c) To help in debugging, changes all uses of #define ss ((stream_xxx_state *)st) to stream_xxx_state * const ss = (stream_xxx_state *)st; (gxclread.c) Removes all uses of 'near' from the library: if short and long calls have different formats, we rely on the compiler to generate the most efficient one. (gscie.c, gscoord.c, gsimpath.c, gsstate.c, gstype2.c, gxclpath.c, gxclread.c, gxfill.c, gxhint1.c, gxhint2.c, gxhint3.c, gxstroke.c) Adds 'inline' to stdpre.h, defined as the empty string on compilers other than the ones we know accept it. (stdpre.h) Adds printout of the subrectangle to ImageType 1 tracing. (gxiinit.c) Replaces a few uses of gs_memory_default with dev->memory. (gdevdbit.c, gxclread.c) Improves support for halftone objects not associated with graphics states. This involves a minor change to the definitions of gs_spot_halftone and gs_threshold_halftone, to define the transfer function as a closure. This is slightly NON-BACKWARD-COMPATIBLE in that it requires clients to set transfer_closure.proc to 0 if they also set transfer to 0. NOTE: the API defined in gshtx.h is subject to future change. (gscsepnm.h, gshtx.h, gxdht.h, gxfmap.h, gxht.h, gxtmap.h, gscolor.c, gsht.c, gsht1.c, gshtx.c) Changes the Bezier approximation of arcs to cut arcs at absolute multiples of 90 degrees rather than at intervals of 90 degrees (e.g., an arc from 45 to 105 would now be cut at 90 rather than being treated as a single 60-degree curve) in order to produce more uniform output and also to ensure that the bounding box for arcs is more accurate (to pacify the Genoa FTS). (gxfarith.h, gsmisc.c, gspath1.c) Replaces all remaining uses of do { ... } while (0) with BEGIN ... END. (gsbitops.h, gsdsrc.h, gserror.h, gsmdebug.h, gsrect.h, gxcldev.h, gxfunc.h, gxop1.h, gxtype1.h, gsalphac.c, gsshade.c, gstype2.c, gstype42.c, gxclread.c, gxcpath.c, gximage4.c, gxpath.c) Adds a user-defined halftone type, to support non-monotonic halftones. We could make any of the following structures fully object-oriented: - Halftones (client level) - Halftone orders (device level, but not rendered) - Device halftones (device level, fully rendered) The right place to do this for non-monotonic halftones, which are specified directly by bit masks, is at the device halftone level. However, there are too many places that know too much about the implementation of device halftones and halftone orders right now. WE NEED TO REVISIT THIS AFTER THE 5.1x CODE BRANCH IS TERMINATED. SHOULD ALSO CONVERT UNION TO TYPED UNION FOR GC -- CODE IS DUPLICATED IN gsht.c VS gshtx.c. (gxdht.h, gxht.h, gxhttype.h, gshtx.h, gsht.c, gsht1.c, gshtx.c) Moves the procedures in Type 1 font data into a structure. This is a NON-BACKWARD-COMPATIBLE CHANGE, but an internal one. (gxfont1.h, gstype1.c, gstype2.c, gxtype1.c) Extends Type 1 / 2 / 4 fonts to require that they be able to enumerate the set of glyphs that they define, to allow writing them out. We may propagate this to all base fonts in the future. (gxfont1.h) Provides some utilities for devices that want to define their own InputAttributes and OutputAttributes. (gdevprn.h, gxdevice.h, gdevprn.c, gsdparam.c) Removes all of the text-display procedures that took null-terminated C strings as operands. This is NON-BACKWARD-COMPATIBLE. However, since the memory manager required that all such operands be allocated using gs_alloc_string, the procedures were never usable with arbitrary C strings anyway. (gschar.h, gschar.c) Renames the gx_device procedure record from std_procs to procs, in anticipation of more unified support for "objects". This is a NON-BACKWARD-COMPATIBLE CHANGE for a surprisingly large number of clients that should have been using dev_proc and set_dev_proc. (gdevbbox.h, gxdevcli.h, gxdevice.h, gdevdflt.c, gdevdgbr.c, gdevmem.c, gdevprn.c, gsalphac.c, gsdevice.c, gsropc.c, gxccache.c, gxifast.c) Disallows setting of the RasterOp-related graphics state parameters when a cache device is active. (gsrop.c) Changes the tracing printout of path segments to provide enough accuracy to cover all the fraction bits of a 'fixed'. (gxpath.c)

Version 5.23 (limited) (5/14/98)

This fileset adds a number of PostScript LanguageLevel 3 features: library support for ImageType 3 and 4 (masked) images, PostScript-level support for ImageType 4, and the shfill operator for smooth shading. It also adds RCS $Id$ lines to all the files we maintain. It also changes the Unix makefiles so that they create debugging or profiling binaries in separate directories. This fileset includes an unusually large number of non-backward-compatible API changes. Most of them don't affect ordinary library clients, but a few do. These changes, and a few more to come, result from the next (large) increment in our ongoing project to make the code completely re-entrant (no non-idempotent writable globals in our own code). This necessarily involves putting some things that used to be global into structures, some of which must be added to some interfaces. NOTE: because of a combination of hardware problems, time pressure, and belated discovery of sloppiness by the original developers of the PC makefiles, none of the PC makefiles in this fileset work. The Borland makefiles probably come the closest.

Documentation

Adds documentation for: - The changes in begin_image and related facilities. (drivers.txt) - The addition of -Z/. (use.txt) - The new ps2ps utility. (ps2ps.1) - The new get_hardware_params procedure. (drivers.txt) - The new -B<size> / -B- switch. (use.txt). Improves the documentation for the sample_ macros. (gsbitops.h) Adds some documentation on how the debugging/tracing flags work. (gdebug.h) Improves the documentation of DDAs. (gxdda.h) Documents a subtle change in the meaning of a flag in the PDF FontDescriptor. (pdf_font.ps) Changes the location of the authoritative site for zlib sources. (zlib.mak) Corrects a typo. (gsht1.h) Removes pdf_2ps.ps from the fileset. (psfiles.txt) Adds standard file name comments to all .c and .h files that didn't already have them. (dodebug.h, gdev3b1.c, gdev8510.c, gdevadmp.c, gdevhl7x.c, gdevimgn.c, gdevo182.c, gdevpdfx.h, gdevpe.c gdevsco.c, gdevsj48.c, gdevvglb.c, gsalpha.c, gscolor1.c, gscsepr.h, gsdsc.c, scfetab.c string_.h, zfunc3.c, zmedia2.c) Unifies the nroff styles of the various man pages a bit. (*.1) Adds a reference to the CTAN mirror sites. (new-user.txt) Notes that the result of rect_intersect may be anomalous. (gsrect.h) Improves the documentation for the Distiller parameter handling code. (gdevpdfp.c, gdevpsdp.c) Corrects an ambiguity in the definition of the int_keys argument of param_begin_xmit_dict. (gsparam.h) Adds a new file that will evolve into a reasonable guide to the source code. (README, source.txt) Adds the convention for 'status' and 'code' to the C style guide. (c-style.txt) Improves the documentation for the '-' pseudo-switch. (use.txt) Updates the problem reporting form to include the URL for known post-release problems. (bug-form.txt) Documents the availability of sources and binaries for Plan 9. (new-user.txt)

Procedures

Fixes bugs: - The 'tags' target in the Unix makefiles had an incorrect directory name. (bug probably introduced since 5.20) (unix-end.mak) - The ld_tr and CCFLAGS macros were used in the makefiles before they were defined, causing problems with `make' implementations that substitute macros into definitions at definition time rather than at use time. (*.mak) - Recent Digital Unix versions (4.0 and later) require -std1 when compiling. (make.txt) - The Unix library-only makefile had gotten out of date. (ugcclib.mak) - pf2afm[.bat] were omitted from the fileset. (master/package.tcl) - The Borland makefile didn't work, because the Borland compiler requires specifying the output file name (-o) before the input file name (-c)! This required changing the order of every compilation command in every platform-independent makefile. The win*.mak files still need work. (*.mak) - None of the non-Unix makefiles specified directory names for the auxiliary programs. (dvx-tail.mak, os2.mak, wctail.mak, winlib.mak) - The Windows makefiles lacked build rules for gp_ntfs and gp_win32. (msvclib.mak, winlib.mak) Adds a new debugging switch -Z/ that prints the file name and line number on all trace messages. (gdebug.h, std.h) Changes the Unix 'pg' and 'debug' build targets so that they create the binaries in a 'pgobj' or 'debugobj' subdirectory of the standard build directory. This allows keeping all 3 configurations active. (unix-end.mak) Adds GEN directories for jpeg, libpng, and zlib. (devs.mak, gs.mak, jpeg.mak, lib.mak, libpng.mak, zlib.mak) Adds a gendev.c that will eventually replace genconf.c. (gendev.c, *.mak) Adds -Wcast-align to the gcc compilation switches. (unix-gcc.mak) Adds support for libpng 1.0.1. (libpng.mak) Notes the use of -R on Solaris and other SVR4 systems. (unix*.mak) Removes pdf_2ps.ps from the fileset. (int.mak, unixinst.mak, pdf_2ps.ps[deleted]) Ensures that every file that is copyright, maintained, and distributed by Aladdin Enterprises has a RCS $Id$ line (actually, $Id: <filename> $). In .c and .h files, these lines currently are only comments, but they could be converted easily to static strings later if we want to. We had to touch almost every file in the fileset to do this, but we did *not* change the write dates. (*) Makes the build procedure auto-detect whether the installed version of gcc has the 'const' code generation bug. (gs.mak, lib.mak, unix-gcc.mak) Removes 'makefile' as a precondition for ccf32.tr. (I can't quite figure out why it was there in the first place.) (msvccom.mak) Replaces the -F<file> switch with a -B<buffer size> switch that forces all files to use the run_string interfaces. -B- turns it off. (iminst.h, imainarg.c) Adds a new resource to genconf.c, -replace <module>. This causes <module> *not* to be included if the module with the -replace resource *is* included. If two modules -replace each other, either directly or indirectly through -includes, the result is undefined. (genconf.c) Uses -replace to implement a default roplib package. (lib.mak)

Utilities

Fixes bugs: - unprot.ps stopped working because of the stricter prohibition against storing local-VM objects into systemdict. (unprot.ps) Adds a new ps2ps utility, like pdf2ps, that "distills" PostScript. (ps2ps, ps2ps.bat) Modifies the ps2epsi utility so it can be run outside the ps2epsi script for testing. (ps2epsi.ps) Changes the pdf2ps utility to use the pswrite device. This gets rid of all conversion problems, at the expense of larger and stupider output files. (pdf2ps, pdf2ps.bat)

Drivers

Fixes bugs: - Two procedures were declared 'private' inconsistently (thank you again, gcc). (gdevps.c) - The author of the uniprint driver sent a fix for an allocation-related bug and an off-by-one bug. (gdevupd.c) - The PDF writer incorrectly converted open stroked rectangles (only 3 sides drawn) to closed (4 sides drawn). (gxpath.h, gzpath.h, gdevpdfd.c, gxpath2.c) - When banding, filling a character within the PaintProc of a Pattern could produce memory access errors. (The problem was in gx_forward_fill_mask, which might affect filling characters in other situations as well.) (gdevnfwd.c) - The [e]pswrite driver produced incorrect line widths for stroked graphics. (gdevps.c) - The [e]pswrite driver didn't invoke colorimage correctly, so didn't handle Patterns right. (gdevps.c) - Vector devices didn't set the color before writing trapezoids, possibly causing incorrectly colored output. (gdevvec.c) - Vector devices could give errors on Pattern fills. (gdevvec.c) - The bbox device retained a pointer to the clipping path, which, since the path was embedded in the gs_state_contents, confused the garbage collector, causing memory access errors. We fixed this by de-embedding the path object: see below. (gsstate.c) - On some Linux systems, the X driver could get a memory access error when displaying patterns. We fixed this by adding calls on XInitImage in the necessary places when running X11R6. (gdevx.c) - PDF output didn't check names for unusual characters, and could produce invalid output if the input included names with those characters. (gdevpdfx.h, gdevpdf.c, gdevpdfm.c, gdevpdfo.c) - In the PDF writer, DEST pdfmarks with /Dest but no /Page or /View didn't generate named destinations. (gdevpdfm.c) - Printer devices didn't allow . in %-formats in the output file name. (gdevprn.c) - The x11cmyk driver didn't read bits back from the screen correctly. (gdevxalt.c) - The pcxmono and pcxgray drivers used colored rather than gray-scale palettes. (gdevpcx.c) - The PCX drivers could emit repetition counts greater than 15, confusing some readers. (gdevpcx.c) Removes some vestiges of the obsolete draw_line driver procedure. We also rename the draw_line member of the driver procedure structure as obsolete_draw_line, so that any uses of it will cause compilation errors, but we don't remove it from the structure, so that existing driver procedure vectors will continue to compile (although the draw_line procedure will never be called). (gxdevcli.h, gdevbbox.c, gdevddrw.c, gdevdflt.c) To repair a design error, and at the same time add flexibility needed for ImageType 3: - Removes the image_data and end_image driver procedures, associating them with the gx_image_enum(_common)_t structure instead. Clients should call gx_device_image_data and gx_device_end_image instead: we set the image_data and end_image procedures in the device structures to these procedures when filling in defaulted procedures. This is a NON-BACKWARD-COMPATIBLE CHANGE for drivers that implement begin_image, since they now have to fill the procedures into the enumerator structure. (gsiparm*.h, gxdevcli.h, gxdevice.h, gxiparam.h, gdevbbox.c, gdevddrw.c, gdevdflt.c, gdevnfwd.c, gsimage.c, gxclist.c, gxidata.c, gxifast.c, gxiinit.c, gximage3.c, gximage4.c) - Replaces the image_data driver procedure with a plane_data procedure (now associated with the image enumerator, not the device) that allows specifying the X offset and raster independently for each plane, and (depending on the image type) may allow omitting some planes. We provide a gx_device_image_plane_data procedure parallel to _image_data and _end_image (see above). (gsiparm*.h, gxdevcli.h, gxiparam.h, gdevbbox.c, gdevddrw.c, gxidata.c, gxiinit.c, gximage3.c, gximage4.c) Updates clients for image processing changes. (gdevvec.h, gdevpdf.c, gdevpdfi.c, gdevps.c, gdevpx.c, gdevvec.c) Enhances [e]pswrite to detect other kinds of opportunities for producing smaller output. This involves a change in the moveto procedure in the 'vector' interface. (gdevps.c) Changes the bbox device so that it automatically detects whether it is being used as a component in a device pipeline or as a free-standing device, rather than having to select this in the makefile. (lib.mak, gdevbbox.h, gdevbbox.c) Moves the halftoning driver a bit closer to real usability. (gdevht.h, gdevht.c) Adds some tracing to the color mapping code in the X driver. (gdevx.c) Implements setting the Dict and ACSDict parameters for pswrite and pdfwrite. Dict is effective with the CCITTFaxEncode filter for black-and-white images; otherwise, these parameters still don't do anything. (gdevpdfi.c, gdevpsdp.c) ****** READING HUFFMAN TABLES IS NYI, SEE sdcparam.c; SETTING DOESN'T WORK BECAUSE DCT_set_defaults DOESN'T DO WHAT IT SHOULD ****** Updates the PS/PDF writers to reflect the fact that the ASCIIHexEncode filter now has a state. (gdevpsdf.c) Modifies the X driver so that it can draw multiple platform characters at a time rather than one character per call. (gdevx.h, gdevx.c, gdevxxf.c) Takes advantage of the filter stream procedures now available in stream.c. (gdevjpeg.c, gdevpdf.c, gdevpsdf.c) Adds a get_hardware_params procedure, similar to get_params except that it reads parameters whose values depend on hardware state that may change without program intervention (e.g., panel switches). The default is that there are no hardware parameters. (gdevmem.h, gdevprn.h, gsdevice.h, gxdevcli.h, gxdevice.h, gxacpath.c, gxclip2.c, gxclipm.c, gxclist.c, gxcpath.c, gdevbbox.c, gdevdflt.c, gdevht.c, gdevmrop.c, gdevnfwd.c, gdevprn.c, gsdparam.c) Updates the PS/PDF writer for the change in the parameter list API. (gdevpsdf.c) Makes a few more writable statics const. (gdevos2p.c, gdevpipe.c, gdevpsim.c, gdevx.c) Removes the rrgb sample device, since it now no longer serves any purpose. (gdevrrgb.c[deleted]) Converts some additional devices to -dev2, to make them const. (devs.mak, gdevbit.c, gdevpbm.c, gdevpcx.c, gdevpsim.c, gdevpng.c, gdevtfax.c, gdevtfnx.c, gdevx.c, gdevxalt.c) Updates a client accessing the preallocated color spaces. (gdevpsdi.c) Renames the debugging-related statics in the X driver as X_SOMETHING. (gdevx.c)

Platforms

Makes a few minor changes to support Plan 9. (make.txt, devs.mak, stat_.h, stdio_.h, time_.h, gdevpbm.c)

Fonts

Documents the availability of a free Chinese font. (fonts.txt, new-user.txt) Works around a bug in the Adobe PostScript driver. We though it just output the FontBBox for Type 42 fonts in the 2048- or 4096-unit character space rather than a 1-unit space, but in fact it outputs garbage. (zfont42.c, gstype42.c) Augments the handling of Type 42 fonts to recognize the gdir / GlyphDirectory method of outline definition in addition to the loca / glyf method, per Adobe versions 2015 and later (undocumented!). (ifont.h, zfont42.c)

Interpreter

Fixes bugs: - Memory management for argument strings was wrong. (gsargs.h, gsargs.c) - 1 .setlanguagelevel was broken, because it didn't allow for the possibility that values could get deleted from systemdict that existed in level2dict. (bug introduced in 5.x, x <= 10) (zmisc2.c) - -dFAKEFONTS was broken. (gs_fonts.ps, gs_init.ps) - copyscanlines was broken. (bug introduced in 5.20) (gs_init.ps) - The matrix returned by sizeimage was incorrect. (zdpnext.c) - The implementation of .buildpattern for PatternType 2 was wrong. (gs_ll3.ps) - Ghostscript couldn't load TrueType fonts where the amount of data either before or after the glyf section exceeds 64K. (gs_ttf.ps) ****** WE BACKED OUT THIS CHANGE, BECAUSE WE HAD TO BACK OUT THE NEXT ONE. ****** - Ghostscript couldn't load TrueType fonts where the total data is more than 64K and the offset or length of the glyfs is odd. (gs_ttf.ps) ****** WE BACKED OUT THIS CHANGE: IT BROKE THE PDF INTERPRETER, BECAUSE IT IMPOSES A NEW REQUIREMENT THAT TTF FILES BE POSITIONABLE. ****** - Some compilers complained about arithmetic on enums. (interp.c) - The CIE color space and CRD GC structure definitions were in the interpreter rather than the library. (zcie.c, zcrd.c) - NullFont was still present in FontDirectory when currentglobal was false. (gs_init.ps) - execform failed with Form resources, because it tried to insert the Implementation in a read-only dictionary. (gs_fform.ps, gs_lev2.ps) Finishes implementing ImageType 4 images, and moves closer to implementing ImageType 3. (iimage.h, zdps.c, zimage.c, zimage2.c, zimage3.c) Updates tracing output to use the new dlprintf macros. (idict.c, igc.c, igcref.c, igcstr.c, iname.c, interp.c, isave.c, iscan.c, zcie.c, zcontext.c) Implements multiproc=true for readimage. (gs_dpnxt.ps) Does a bit more work on implementing shading with PatternType 2. (gs_ll3.ps, zfunc.c, zshade.c) Adds a .bitadd operator for adding integers modulo the word size. (zarith.c) Updates filter operators to use the new stream parameter facility. (iparam.h, iparam.c, zfdecode.c, zfdctc.c[deleted], zfdctd.c, zfdcte.c) Updates the implementation of parameter lists for the change from _dict to _collection. (iparam.c, iparam.h) Takes advantage of the filter stream procedures now available in stream.c. (zfilter.c) Adds get_hardware_params to one device procedure vector. (zupath.c) Adds .gethardwareparams to parallel .getdeviceparams. (zdevice.c) Updates the interpreter's parameter list machinery to match the change in gsparam.h. (iparam.h, iparam.c) Makes more writable statics const. (gs_init.ps, btoken.h, dstack.h, iref.h, opextern.h, icontext.c, idict.c, igc.c, igcref.c, iinit.c, imainarg.c, interp.c, iscanbin.c, iutil.c, zbseq.c, zcie.c, zcontrol.c, zdevcal.c, zdevice2.c, zdps.c, zdps1.c, zfont2.c, zgeneric.c, zgstate.c, ziodev.c, ziodev2.c, ztype.c) Removes an inappropriate reference to PROGRAM_NAME. (imainarg.c) Removes set/currentrenderalgorithm, since they are useless for the purpose for which they were intended. (zrop.c) Uncomments code for CIEBasedDEF[G] color spaces, even though these aren't fully implemented yet. (zcie.c) Reimplements StartJobPassword and SystemParamsPassword as no-access strings in systemdict. (gs_lev2.ps, iutil2.h, iutil2.c, ziodev2.c, zusparam.c) Splits off the context state record from icontext.h, so that places that only need access to state variables don't need to import the procedures. (icontext.h, icstate.h) Updates a client for the change in gs_malloc_limit. (imainarg.c) Updates clients for the change in the accessors for predefined color spaces. (zcolor1.c, zimage.c, zimage2.c) Renames the (few) debugging-related statics as I_SOMETHING. (igc.c) Splits off idstack.h (API for dictionary stacks) from dstack.h (API for the interpreter's dictionary stack), and idstack.c (dictionary stack implementation) from idict.c (dictionary implementation). We should have done this a long time ago! (dstack.h, idictdef.h, idstack.h, idict.c, idstack.c, iinit.c, ireclaim.c) Folds the cached currentfile pointer into the exec-stack structure. (estack.h, interp.c) Changes clients of gs_register_*_root to eliminate statically allocated roots. (iinit.c, iname.c, interp.c, zbseq.c, zcontext.c, zfile.c, zfont.c, zfont2.c, zgstate.c, ziodev.c) Adds a ref_free_stack procedure, and reformats the implementation of stacks. (istack.h, interp.c, istack.c)

Interpreter (PDF)

Fixes bugs: - Pattern colors sometimes caused errors. (gs_pdf.ps) - A file ending with %%EOF without an EOL caused an error. (pdf_main.ps) - Fl wasn't recognized as an abbreviation for FlateDecode in in-line images. (pdf_draw.ps) Removes all code related to converting PDF to PS: it never worked reliably, and we now support this function with the pswrite device instead. (gs_pdf.ps