Detailed History of Ghostscript versions 8.xx

Table of contents

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

History of Ghostscript versions 7.n
History of Ghostscript versions 6.n
History of Ghostscript versions 5.n
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.


Version 8.64 (2009-02-02)

This is the fifth scheduled release in the stable Ghostscript 8.6x series.

Approximately 100 bugs have been fixed since the 8.63 release.

Of particular note in this release are improvements to overprint and spot color support in documents with transparency, improvements to PDF and PS output, proper handling of PDF-specific text rendering modes and support for reading AES-encrypted PDF documents.

Also improved is handling of CJK text, especially in vertical writing modes, memory footprint processing some files at high resolution and support for using the system's default paper size on unix.

The interpreter's handling of color spaces has been moved from PostScript code to C.

A number of the included printer drivers and cups wrappers have been updated to support a PDF-based workflow. Also fixed are several long-standing bugs in the pcl drivers with respect to duplex, resolution and paper tray selection.

The following bugs were open at the time of the last release:

226943, 430175, 465936, 493348, 535932, 578865, 614298, 626295, 686853, 686865, 687011, 687084, 687095, 687146, 687193, 687257, 687271, 687280, 687295, 687297, 687303, 687327, 687375, 687414, 687475, 687492, 687514, 687520, 687536, 687561, 687593, 687608, 687630, 687650, 687666, 687674, 687677, 687695, 687697, 687702, 687715, 687721, 687728, 687731, 687775, 687780, 687782, 687793, 687796, 687805, 687850, 687887, 687903, 687904, 687915, 687931, 687950, 687981, 687983, 688007, 688022, 688024, 688026, 688032, 688036, 688042, 688061, 688064, 688081, 688130, 688166, 688184, 688187, 688204, 688210, 688215, 688227, 688267, 688269, 688280, 688288, 688312, 688318, 688320, 688333, 688342, 688361, 688363, 688372, 688386, 688387, 688389, 688395, 688413, 688436, 688437, 688440, 688448, 688473, 688475, 688483, 688495, 688500, 688515, 688528, 688533, 688539, 688540, 688542, 688557, 688565, 688580, 688581, 688601, 688604, 688605, 688607, 688616, 688617, 688627, 688636, 688638, 688647, 688651, 688655, 688673, 688699, 688708, 688709, 688710, 688714, 688728, 688731, 688736, 688757, 688777, 688797, 688818, 688829, 688843, 688846, 688871, 688872, 688908, 688918, 688919, 688926, 688933, 688942, 688949, 688958, 688969, 688978, 688990, 688994, 688999, 689003, 689011, 689013, 689025, 689028, 689031, 689032, 689040, 689044, 689046, 689048, 689057, 689060, 689070, 689076, 689077, 689078, 689081, 689093, 689094, 689098, 689133, 689137, 689145, 689150, 689153, 689161, 689167, 689174, 689184, 689188, 689195, 689198, 689199, 689209, 689222, 689224, 689236, 689247, 689248, 689252, 689253, 689278, 689279, 689280, 689283, 689289, 689290, 689295, 689308, 689331, 689335, 689340, 689341, 689361, 689370, 689376, 689378, 689392, 689396, 689418, 689419, 689421, 689422, 689423, 689438, 689439, 689450, 689451, 689456, 689460, 689471, 689484, 689487, 689489, 689490, 689498, 689500, 689502, 689506, 689507, 689512, 689518, 689522, 689546, 689547, 689549, 689554, 689557, 689560, 689561, 689563, 689566, 689571, 689573, 689574, 689581, 689584, 689585, 689591, 689592, 689595, 689598, 689601, 689606, 689610, 689616, 689623, 689625, 689627, 689632, 689636, 689641, 689653, 689657, 689658, 689663, 689670, 689674, 689681, 689682, 689684, 689689, 689690, 689691, 689697, 689698, 689704, 689705, 689709, 689710, 689711, 689715, 689721, 689725, 689726, 689727, 689734, 689737, 689741, 689747, 689752, 689756, 689759, 689760, 689761, 689767, 689769, 689772, 689775, 689778, 689781, 689786, 689792, 689793, 689794, 689799, 689801, 689805, 689808, 689817, 689822, 689823, 689826, 689835, 689836, 689840, 689853, 689856, 689858, 689859, 689860, 689861, 689862, 689868, 689869, 689870, 689871, 689878, 689883, 689885, 689910, 689915, 689916, 689917, 689928, 689929, 689930, 689931, 689933, 689937, 689938, 689939, 689940, 689941, 689942, 689943, 689947, 689950, 689951, 689952, 689957, 689968, 689969, 689972, 689974, 689980, 689986, 689991, 689996, 689997, 690003, 690005, 690006, 690007, 690009, 690020, 690022, 690024, 690025, 690026, 690029, 690033, 690036, 690043, 690047, 690051, 690053, 690054, 690056, 690057, 690058, 690061, 690066, 690068, 690069, 690073, 690083, 690084, 690085, 690093, 690094, 690098, 690100, 690102, 690110, 690115, 690119, 690123, 690125, 690126, 690131, 690132, 690137, 690143, 690146, 690157, 690160, 690162, 690170, 690171, 690174, 690176, 690180, 690182, 690183, 690184, 690185, 690189, 690191, 690192, 690199, 690200, 690203, 690207, 690208, 690209, 690212, 690213, 690214, 690216, 690218, 690224, 690225, 690226, 690229, 690230, 690232, 690233, 690234, 690235, 690237, 690238, 690239, 690241, 690246, 690247, 690248, 690249, 690250, 690251, 690253, 690256, 690259, 690261, 690262, 690263, 690264.

Incompatible changes

In this release the C source files have been split into two new directories. Interpreter source files are now in psi and the graphics library and output devices are now in base. Previously everything was in src. This may cause problems with existing references in external build files or when applying patches generated against an older version.

The compiled in font set in Resource/Fonts has been updated to the version from the 8.11 release. This is the same set which was recommended prior to the 8.63.

Changelog

2009-02-02T08:58:11.805173Z Ray Johnston

Fix broken bbox device caused by the 'fillpage' commit of rev 9288. This
resolves bug 690260 and other cases where the bbox was all 0's.

DETAILS:

When the 'RECT_IS_PAGE' check was removed, the BBOX_INIT_BOX function was
invoked unconditionally MUCH too often, leading to an empty bbox (0's)
which also caused the x11 device to not update many areas from the under-
lying image24 buffer to the screen. The 'BBOX_INIT_BOX' should only be
needed when the params change the geometry or when 'fillpage' is done.

[base/gdevbbox.c]

2009-02-02T08:52:01.582216Z Ray Johnston

Revert the patch of 9314 that caused a problem with the Ubuntu bug 160203
(https://bugs.launchpad.net/ubuntu/+source/ghostscript/+bug/160203). This
patch appears to be a fix for a much older (~2004) version of gs and should
not be needed as of rev 8161 that resolved segfaults when there is a NULL
get_color_mapping_procs pointer. The mapping of 'black' and 'white' is
needed to properly allow for non-white painting in the bbox device to
avoid 0 0 0 0 BoundingBox.

[base/gdevbbox.c]

2009-01-30T21:10:55.690493Z Russell Lang

Add the default papersize module to the OS/2 build.

[psi/os2.mak]

2009-01-27T23:04:37.869301Z Ralph Giles

Update the directory listing the license for the source code
reorganization.

[LICENSE]

2009-01-27T22:40:23.384111Z Ralph Giles

Update internal copyright string.

[base/gscdef.c]

2009-01-27T21:00:23.120021Z Ralph Giles

Update changelogs and release dates for 8.64rc2.

[doc/History7.htm doc/Projects.htm doc/History8.htm man/dvipdf.1 man/ps2ascii.1 doc/Use.htm doc/Readme.htm doc/Source.htm doc/Deprecated.htm man/ps2epsi.1 doc/Install.htm doc/Changes.htm doc/API.htm doc/Issues.htm doc/DLL.htm doc/Drivers.htm man/pfbtopfa.1 doc/Release.htm doc/Commprod.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm man/gs.1 man/pf2afm.1 doc/Ps2ps2.htm doc/Fonts.htm man/printafm.1 doc/Ps2pdf.htm doc/Develop.htm doc/Helpers.htm man/pdf2dsc.1 doc/Psfiles.htm doc/Lib.htm doc/gs-vms.hlp man/font2c.1 man/gsnd.1 base/version.mak man/pdfopt.1 doc/News.htm man/pdf2ps.1 man/ps2pdf.1 doc/Make.htm doc/Details8.htm doc/Unix-lpr.htm doc/C-style.htm doc/Ps-style.htm doc/History1.htm doc/History2.htm man/gslp.1 man/wftopfa.1 doc/History3.htm man/ps2ps.1 doc/Details.htm doc/Ps2epsi.htm doc/History4.htm man/ps2pdfwr.1 doc/History5.htm doc/History6.htm]

2009-01-27T20:50:54.789641Z Ralph Giles

Update the release notes for 8.64rc2.

The x11alpha issue has been worked around.

Add some comments from Till Kamppeter.

[doc/News.htm]

2009-01-27T20:43:39.460217Z Ralph Giles

Fix fillpage in the x11alpha device.

This reverts an incorrect code change which prevented the fillpage
method of the x11alpha device from clearing the buffer. Bug 690255.

Details:

In r9288, a new fillpage method was added. This is a stub in printer
devices, but is overridden to detect page flushes in some high
level devices. That commit included incomplete changes to gdevxini.c
which didn't compile. Alex suggested a fix in 690202, which was
committed as r9294 after approval from the author of 9288. This was
what broke page clearing in the x11alpha device.

This commit removes the changes both commits made to the x11 devices and
restores gdevxini.c to its state prior as of r9287.

[base/gdevxini.c]

2009-01-27T20:43:37.567128Z Ralph Giles

Update documentation on the COMPILE_INITS makefile variable.
In particular, it's normally no longer 0.

Thanks to Ken Sharp for pointing this out.

[base/gs.mak]

2009-01-27T20:43:33.967975Z Ralph Giles

Escape significant characters when generating html changelog entries.

[toolbin/split_changelog.py]

2009-01-27T00:18:29.136711Z Ralph Giles

Remove $(GS_LIB)\Resource directory from the search path in the msvc 
build to shadowing the compiled in version.

GS_LIB is set in the Windows registery by the installer, but it does not 
currently install a duplicate copy of the Resource tree in the 
filesystem. Having this directory in the search path caused Ghostscript 
to use it for Resource lookup to the exclusion of the %rom% version, and 
since the files weren't installed there, Ghostscript would error out in 
the initialization phase.

Files like cidfmap and available fonts can still be overridden by 
putting them in $(GS_LIB)\lib and $(GS_LIB)\fonts.

Patch from Russell Lang.

[psi/dwsetup.cpp]

2009-01-26T19:25:28.295228Z Ralph Giles

Update changelogs for 8.64rc1.

[doc/Changes.htm doc/History8.htm doc/News.htm doc/Details8.htm doc/Details.htm]

2009-01-26T18:59:39.072673Z Ralph Giles

Release notes for 8.64rc1.

[doc/News.htm]

2009-01-26T18:05:53.102397Z Ralph Giles

Propagate release number and date to the documentation.

[doc/History7.htm doc/Projects.htm doc/History8.htm man/dvipdf.1 man/ps2ascii.1 doc/Use.htm doc/Readme.htm doc/Source.htm doc/Deprecated.htm man/ps2epsi.1 doc/Install.htm doc/API.htm doc/Issues.htm doc/DLL.htm doc/Drivers.htm man/pfbtopfa.1 doc/Release.htm doc/Commprod.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm man/gs.1 man/pf2afm.1 doc/Fonts.htm doc/Ps2ps2.htm man/printafm.1 doc/Ps2pdf.htm doc/Develop.htm doc/Helpers.htm man/pdf2dsc.1 doc/Psfiles.htm doc/Lib.htm doc/gs-vms.hlp man/font2c.1 man/gsnd.1 man/pdfopt.1 doc/News.htm man/pdf2ps.1 man/ps2pdf.1 doc/Make.htm doc/Details8.htm doc/Unix-lpr.htm doc/C-style.htm doc/Ps-style.htm doc/History1.htm doc/History2.htm man/gslp.1 man/wftopfa.1 doc/History3.htm man/ps2ps.1 doc/Ps2epsi.htm doc/History4.htm man/ps2pdfwr.1 doc/History5.htm doc/History6.htm]

2009-01-26T18:04:16.208144Z Ralph Giles

Bump release numbers and copyright dates for 8.64rc1.

[base/gscdef.c base/version.mak doc/News.htm psi/dwsetup.rc psi/winint.mak doc/Release.htm]

2009-01-26T18:02:43.525231Z Ralph Giles

Work around an issue with comment parsing in the pre.tcl release script.

My tclsh seems to be broken.

[toolbin/pre.tcl]

2009-01-26T18:02:41.107170Z Ralph Giles

Update the pre.tcl release script for the new source locations.

[toolbin/pre.tcl]

2009-01-26T18:02:37.633990Z Ralph Giles

Update the pre.tcl release script for the new gs_init.ps location.

The essential ps library files were moved from lib to Resource/Init for
clarity and simpler behavior with compile-inits.

[toolbin/pre.tcl]

2009-01-26T17:33:36.155851Z Ken Sharp

Fix (pswrite): Incorrect PageBoundingBox comment location

Details:
The new %%PageBoundingBox comment was being emitted between a %%BeginPageSetup and %%EndPageSetup comment pair, which was causing it to be ignored by CUPS.

Moved the bounding box in front of the page setup comment

[base/gdevpsu.c]

2009-01-26T17:16:47.546837Z Ken Sharp

Yet more tidying up in the batch file. Adds release builds to the solution, better directory handling, a usage comment in the batch file and, if invoked without parameters, a usage printout for the user.

[toolbin/msvcxml.bat]

2009-01-25T06:59:45.428302Z Ralph Giles

Make the GS_SPLIT_LIBS configure function only recognize -l at the start 
of an argument, to avoid false positives from hyphens inside linker 
arguments. Bug 690254.

[base/configure.ac]

2009-01-24T09:31:46.808669Z Ken Sharp

This batch file, to generate a MSVC solution for building GS, was invalidated by the source re-organisation, and the inclusion of the resources in a ROM file system.

Fixed various aspects so that it now works again, basically.

[toolbin/msvcxml.bat]

2009-01-24T09:05:50.373013Z Ken Sharp

Add a check when comparing clip paths to see if both are NULL. Silences a Coverity warning and one day might conceivably prevent a crash.

[base/gdevpdfd.c]

2009-01-23T22:53:02.093705Z Ralph Giles

Convert 24 bit RGB data to grayscale when printing in monochrome with
eplaser device. Previously the RGB data was sent as is, resulting in
a stretched and truncated page image.

Patch from Olaf Meeuwissen. Bug 690252.

[contrib/eplaser/gdevescv.c]

2009-01-23T19:04:40.484432Z Alex Cherepanov

Continue the the fix from rev. 9384, plug 2 more ways that caused multiple
inclusion of page objects into the linearized file. Bug 690140, customer 932.

[lib/pdfopt.ps]

2009-01-23T03:10:05.467096Z Ralph Giles

Use the page parameters set on the X11 device when called by Ghostview.

This patch allows gv to control the output page parameters, overriding
document and gs default settings. Since it has been tested in the
Debian distribution and is contingent on being wrapped by the viewer,
I consider it low risk.

Original patch by William Bader. Bug 688943.

[base/gdevxini.c]

2009-01-22T13:53:18.843673Z Ken Sharp

Initialise two uninitialised variables. Not thought to be a real problem, but worth making certain. Flagged by Coverity.

[base/gdevpsf1.c base/gdevpsfx.c]

2009-01-22T13:15:07.920292Z Ken Sharp

Check the return value of gdev_prepare_stroke. Another warning from Coverity.

[base/gdevps.c]

2009-01-22T02:53:01.653019Z Alex Cherepanov

Fix multiple inclusion of page objects referenced from beads array.
Bug 690140, customer 932.

[lib/pdfopt.ps]

2009-01-22T01:48:31.483983Z Ray Johnston

Fix for Segfault with tiffsep devics when a file has more than 64 spot colors
and uses transparency. Clean up indentations to C-style. Problem seen with
Bug 690157.

DETAILS:

The number of channels needed in the pdf14 device is one greater than the
number of separations, to allow for the alpha channel (gxblend.h) and the
'comps' variable needs to be at a gx_color_index size to avoid truncation.

Note that the output from tiffsep and psdcmyk is still incorrect -- there
is a gray background in the black channel that is not expected. Also, the
color swatches defined as Alternate colors do not appear in the output,
only the Separations and the device (process) colors.

Also note that this does not address comment #5 from bug 690157 since the
default behavior when the maximum number of separations is reached is to
silently use the Alternate color.

This patch is primarily designed to cure the segfault (buffer OOB) issue.

[base/gdevp14.c base/gxblend.h]

2009-01-22T01:17:35.554315Z Alex Cherepanov

Check for and skip null objects (and other junk) in the /Anots array.
Bug 690244.

[Resource/Init/pdf_main.ps]

2009-01-21T15:34:55.892148Z Ken Sharp

Add a couple of error return checks which were missing. Picked up by Coverity.

[psi/zcolor.c psi/zicc.c]

2009-01-19T11:13:05.930829Z Ken Sharp

Revision 8951 missed an important part of the fix for pswrite, emitting a %%PageBoundingBox for each
page of the output.

[base/gdevpsu.c]

2009-01-19T09:47:56.340575Z Ken Sharp

Fix (pswrite): %%BoundingBox comment geenration
   (ps2write): media selection and %%BoundingBox generation

Details:
bug #690236 "Ghostscript is not able to convert PDF to PostScript 
maintaining the input document's page sizes"

The pswrite bug is actually in the consuming applications, which are unable to 
process the media selection requests in the pswrite output and instead use DSC
comments to select the media. pswrite attempts to use the bbox deice to generate a
%%BoundingBox comment, but because this is a high-level device, no marks are made, so 
the BoundingBox is 0 0 0 0. 

Fixed by using the media size instead if this case is detected.


ps2write did not generate a %%BoundingBox, or any other DSC comment at all, because it
does not produce DSC PostScript (there is a request to address this already #690064).
Also the media selection in the ps2write output is disabled by default, forcing users
to find some means to set particular keys in userdict on the target device.

Fixed by emitting a %%BoundingBox equal to the media size of the first page (NB as
this is not DSC, other pages will be selected incorrectly if this is all the
application uses). Also allow the use of the /SetPageSize, /RotatePages and /FitPages
keys during ps2write processing to emit a PostScript file with these keys already
set, thus allowing media selection to take place without further user intervention.

[doc/Ps2ps2.htm base/gdevpdfx.h base/gdevpsu.c base/gdevpdfp.c base/gdevpdfu.c base/gdevpdfb.h]

2009-01-18T19:57:58.223740Z Alex Cherepanov

Fix SEGV in 'inferno' device caused by insufficient memory allocation. Pass
correct device type to prn_device_body() macro. thanks to Wendy for the patch.

[base/gdevifno.c]

2009-01-16T18:38:48.474888Z Ken Sharp

Fix (pdfwrite): Invalid metadata for PDF/A output

Details:
bug #690046 "Ghostscript doesn't produce valid PDF/A-1B files"

Now that we have an example file, the remaining issues are resolved:

1) The recommended tags for font metadata in the ISO spec are not present in the XMP schema, resulting in Acrobat preflight complaining. Distiller does not (and never has, apparently) write font metadata for PDF/A files, and the spec says only that files 'should' contain metadata. For now we disable writing font metadata to match Distiller.

2) When converting TrueType fonts into CIDFonts, for PDF/A compatability, we must also write a CIDSet resource. The code was creating and initialising a table containing an explicit 256 entries, but the CIDSet resource was writing as many entries as there are glyphs in the base font. If this was larger we wrote uninitialised data to the CIDSet. Altererd to create and initialise a table the size of the number of glyphs in the base font.

[base/gdevpdtd.c base/gdevpdfe.c]

2009-01-16T05:03:44.102465Z Ralph Giles

Move the font api bridge implementations to the psi directory.

Bug 690231, fixes the language switch build with ufst.

These are referenced from int.mak and depend on interpreter-level 
headers. So while the font api should be part of the graphics library, 
these files actually belong in the interpreter.

[psi/fapi_ft.c base/fapiufst.c psi/fapiufst.c base/fapi_ft.c]

2009-01-15T15:22:39.193218Z Ken Sharp

Update a comment to say why the minimum file size is 4KB

[lib/pdfopt.ps]

2009-01-15T15:20:15.993430Z Ken Sharp

Fix (pdfopt): Minimum optimised file size changed in Acrobat 9

Details:
bug #690210 "Inconsistent "fast web view' results"

It seems Acrobat 9 will decide that any file less than 4Kb in size is not optimised for fast web view, regardless of content. Previous versions of Acrobat insisted on a minimum of 1Kb.

[lib/pdfopt.ps]

2009-01-15T09:16:00.166572Z Ken Sharp

Fix (pdfwrite)

Details:
revision 9346 sets the about member of the XMP metadata to empty ("") unconditionally, this should only be done when writing PDF/A files.

[base/gdevpdfe.c]

2009-01-15T07:52:13.786371Z Alex Cherepanov

Fix compilation on Windows NT, which doesn't define LOCALE_IPAPERSIZE.

[base/gp_wpapr.c]

2009-01-14T22:58:56.327548Z Ralph Giles

Check for a null target_info in bbox_image_end_image before
trying to free it. Fixes bug 680019.

[base/gdevbbox.c]

2009-01-14T11:15:24.692365Z Igor Melichev

Fix (graphics) : Redundant patterns in clist (continued 7).

DETAILS :

Bug 690228 "pcl6 regression".

Don't write a pattern in the short form (just tile id)
to the "all bands" list if some bands don't store same tile id.
Otherwise those bands would be confused and try to call pattern_load,
which is not supported while a clist playback. 

[base/gxclpath.c]

2009-01-13T22:17:21.104569Z Alex Cherepanov

Return 0 when accessing Type1C font table out of range or the table is too
short and display a warning if possible. Bug 690050, customer 353.

DETAILS:
Old code smashed the stack when operator read was unsuccessful and failed
shortly afterwards. New code tolerates PDF files produced by 'Exstream
Dialogue', which have Type1C fonts with overlapping tables, which Ghostscript
shortens to non-overlapping length. Thanks to Ray for the origimal patch.

[Resource/Init/gs_cff.ps]

2009-01-13T18:38:37.869412Z Ray Johnston

Revert .outputattrkeys to the list prior to rev 8026 to fix problems with
Duplex introduced with that change. Bug 690041.

[Resource/Init/gs_setpd.ps]

2009-01-12T19:33:58.722824Z Ralph Giles

Fix a gcc warning in gxshade6.c.

When VD_TRACE is not defined, vdtrace.h defines most of its operations
as DO_NOTHING, but with was not done for vd_restore and vd_disable,
causing compiler warnings in gxshade6.c, where vd_disable is called
as the sole body of an if() statement.

Bug 690204.

[base/vdtrace.h]

2009-01-12T16:51:59.689070Z Ken Sharp

Fix (pdfwrite): Invalid metadata for PDF/A output

Details:
bug #690046 "Ghostscript doesn't produce valid PDF/A-1B files"

This does not, unfortunately, address some of the issues raised in the bug report,
without a sample PostScript file to work from these cannot currently be addressed.

However, there were significant problems with the XMP metadata being written:
1) The rdf attribute 'about' has changed, it is no longer recommended to use a UUID,
it should be left empty or formatted as a URI. Altered to empty.
2) The Adobe parser does not like mix and match of attributes and properties, if we
are setting properties, we can't use (at least some) attributes.
3) The preferred schema namespace prefix for the XMP basic schema is now 'xmp' not
'xap'.
4) Date syntax was incorrect for GMT. XMP specifies *either* 'Z' *or* +/-hh:mm. We
were writing 'Z00:00' (that is, both alternatives).

Also added support for the /Subject and /Keywords elements of the Document Info
dictionary, if these are present, as per the patch from Florian Haenel.

[base/gdevpdfe.c]

2009-01-10T22:11:18.954264Z Till Kamppeter

Add "-sstdout=%stderr" to scripts that call gs so that they don't corrupt their own output when outputing to stdout (Thanks to Dan Sheridan (djs at adelard dot com), Ubuntu bug #314439).

[lib/eps2eps lib/ps2pdfwr lib/ps2ps lib/ps2ps2 lib/dvipdf]

2009-01-09T08:53:40.554994Z Till Kamppeter

Added support for GNU Hurd (patch from Debian package).

[base/configure.ac]

2009-01-09T00:28:18.396434Z Ray Johnston

Correct very minor typo.

[Resource/Init/pdf_base.ps]

2009-01-08T21:28:55.852108Z Till Kamppeter

Small correction on ./configure magic for libpaper.

[base/configure.ac]

2009-01-08T12:51:35.348058Z Till Kamppeter

Added auto-detection for libpaper to the configure script

[base/configure.ac]

2009-01-08T12:43:28.851914Z Igor Melichev

Fix (TT font handler) : Wrong glyph posiitions with vertical writing mode (continued).

DETAILS :

Bug 689304 "improper handling of vertical japanese text".

This is fourth partial patch for the bug 689304.
It adds a code for processing CoverageFormat2,
which is used by IPAfont00203.

Besides that, in the old CoverageFormat1 code
subst.GlyphCount was used instead cov.GlyphCount . 
It didn't cause a problem because (we guess)
normally they are equal.

The field CoverageFormat2::RangeRecord is renamed into 
RangeArray to avoid possible conflict with same name for
a structure type. Rather it is a correct C,
we're not sure that all compilers accept it with no warning.

[base/gstype42.c]

2009-01-08T09:17:18.162362Z Russell Lang

Automatically select the default paper size from the locale
on the Windows platform, and make provision for doing this
on Linux.

DETAILS:
This adds a new platform function gp_defaultpapersize and a new 
operator .defaultpapersize.
In order of priority, the paper size is set from PAPERSIZE,
DEFAULTPAPERSIZE, .defaultpapersize, or the compiled in
device paper size.

It has been tested on Windows 98, XP and Vista.

[base/openvms.mmk base/lib.mak base/gp_paper.c doc/Use.htm doc/Develop.htm base/unix-aux.mak base/macos-mcp.mak psi/zmisc.c psi/os2.mak base/winlib.mak base/watclib.mak base/gp.h Resource/Init/gs_init.ps base/openvms.mak base/gp_upapr.c base/gp_wpapr.c doc/Language.htm]

2009-01-08T08:04:41.159684Z Russell Lang

Fix stackunderflow when specified PAPERSIZE is unknown.
Ghostscript will now use the device default page size when
PAPERSIZE is unknown.

[Resource/Init/gs_init.ps]

2009-01-07T17:36:55.528046Z Michael Vrhel

Fix for overprinting with transparency.  This fixes bugs related to the lack of overprint support when there is transparency present in the file. 

DETAILS: Previously if a sep device is used when processing a file that contains both transparency and overprinting, the overprinted colors would blow away the other sep colors.  In this commit, there was one fix to improper geometry in pfd14_cmykspot_put_image.  The remaining changes involved 1) passing overprint compositor actions to the pdf14 device, which occurs during the clist reading phase (in pdf14_create_compositor)  2) adding over_print and overprint mode to the pdf14 clist parameters (this follows the same process that is currently done for text knockout, blend mode etc) and 3) adding the actual fill support in pdf14_mark_fill_rectangle. 

EXPECTED DIFFERENCES:  In the regression tests Bug688631.pdf and Bug690206.pdf will have slight differences due to the blending of spot colors when the color space is subtractive. This matches what is seen in AR.

[base/gdevp14.c base/gdevp14.h base/gstrans.h]

2009-01-07T08:33:14.825057Z Ken Sharp

Fix (PDF Interpreter): Default Unicode decoding clashing with ToUnicode CMap

Details:
bug #690190 "Problem with -dProvideUnicode"

The ProvideUnicode switch creates a (read only) default Unicode decoding resource, presumably to use as a default ToUnicode Cmap when creating PDF files.

This interferes with PDF files which contain a real ToUnicode CMap, as the resource is read only and so cannot be updated with the content of the ToUnicode CMap.

Fixed by checking to see if the GlyphNamesToUnicode dictionary is writeable, and if it is not, creating a new one, when processing a ToUnicode CMap.

[Resource/Init/pdf_font.ps]

2009-01-06T14:38:01.194845Z Ken Sharp

Fix (pdfwrite): Missing glyphs in CIDFont causing errors.

Details:
Bug #690139: "Regression: Error writing PDF file: Missing glyph CID=0 in Bug689614.pdf".

When we find that a string in a PDF file uses a glyph which is not present in the current CIDFont we substitute the .notdef glyph (CID=0). However, if we do not have a width for the .notdef (this is the first missing glyph) we proceed to get one, and then attempt to run the CDevProc for the font.

This, unfortunately, attempts to use the original (missing) glyph, and so fails with a rangecheck error. Added a check to catch this condition and skip the CDevProc and caching.

Also improved the error message slightly.

[base/gdevpdtc.c]

2009-01-06T14:11:30.802229Z Igor Melichev

Fix (PDF interpreter) : A more explanatory message when a CID font is missing.

DETAILS :

Bug 688770 "/undefinedresource in --findresource--".

The patch prints which CID font is missing,
and a better explanation about CID font substitution and
about the related exit with error.  

[Resource/Init/pdf_font.ps]

2009-01-05T17:17:01.015629Z Marcos H. Woehrmann

Removed old code that failed in 2009.

[toolbin/bugsByEngineer.pl]

2009-01-05T14:02:04.227069Z Till Kamppeter

Added examples of PostScript files with CJK text

[examples/cjk examples/cjk/all_ag1.ps examples/cjk/iso2022.ps examples/cjk/all_aj1.ps examples/cjk/all_aj2.ps examples/cjk/all_ak1.ps examples/cjk/gscjk_ac.ps examples/cjk/iso2022v.ps examples/cjk/gscjk_ag.ps examples/cjk/gscjk_aj.ps examples/cjk/all_ac1.ps examples/cjk/article9.ps examples/cjk/gscjk_ak.ps]

2009-01-05T10:34:13.766328Z Till Kamppeter

Accidentally committed an obsolete patch. Reverted.

[base/gdevxini.c]

2009-01-04T20:20:47.824575Z Till Kamppeter

Fix sigbus/segfaults on sparc, hppa, etc. Debian bug 453903.

See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=453903 for details.

[psi/store.h]

2009-01-04T20:15:19.267170Z Till Kamppeter

Improved man pages of ps2pdf.

[man/ps2pdf.1 man/de/ps2pdf.1]

2009-01-04T20:13:28.072664Z Till Kamppeter

Fixed syntax error in gs.css.

[doc/gs.css]

2009-01-04T20:11:57.725211Z Till Kamppeter

Assorted script fixes.

[lib/ps2epsi lib/dumphint lib/dvipdf]

2009-01-04T20:07:04.350954Z Till Kamppeter

Fix insecure script in toolbin.

[toolbin/pre.tcl]

2009-01-04T20:05:41.434499Z Till Kamppeter

Typo fixes in "gs" man page.

[man/gs.1]

2009-01-04T20:03:38.607601Z Till Kamppeter

Fix segfault in X device when page size changes.

[base/gdevxini.c]

2009-01-04T20:01:10.696570Z Till Kamppeter

Adjust the margins for Epson dot matrix printer drivers

[base/gdevepsn.c]

2009-01-04T19:58:54.777417Z Till Kamppeter

Fix a problem with Brother 7x0 GDI, contributed to Debian by B. Janssen.

[base/gdevhl7x.c]

2009-01-04T19:57:07.064594Z Till Kamppeter

Fix segmentation fault on -sDEVICE=bbox, contributed to Debian by Yaroslav Halchenko.

Original issue reported in
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=250290 and
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=254877

[base/gdevbbox.c]

2009-01-03T22:45:50.335886Z Michael Vrhel

Debug raw dumping code that I have found useful in my debug of transparency and overprint issues.  

DETAILS : Open images with Photoshop in the raw format with the dimensions given in the file name.

EXPECTED DIFFERENCES :  None



[base/gxblend.c base/gxblend.h]

2009-01-03T19:51:08.451624Z Igor Melichev

Fix (graphics) : Incorrect bounds for clipping list.

DETAILS :

Bug 690060 "Regression: ball not round in Altona_Visual_1v2a_x3.pdf"

The bug persists since the repository was created. 
The revision 8020 brought an attempt to fix it,
but really it just replaced one wrong code with another wrong one.
Coding the right formula now.

[base/gxcpath.c]

2009-01-01T05:34:09.090806Z Alex Cherepanov

Continue to access the stream while reading a string (sgets()) until the
string is filled, EOF is reached, or an error occurs. Don't return after
first partial read. Bug 690152.

DETAILS:
Old code did this only for 1-byte reads, which commonly occur during
reading stdin one byte at a time. Repeated reading is now extended to
reads of any size.

[base/stream.c]

2008-12-30T18:58:17.371540Z Igor Melichev

Fix (garbager) : Wrong object marks when the object is freed by a garbager callback.

DETAILS :

Debugged on Vista x64 with running a 32 bits debug build of revision 9299 
with this command line :

..\..\gs-hd\bin\gswin32c.exe -IF:\AFPL\gs-hd\Resource\Init;f:\afpl\fonts -Z$?@ -r300 
       -dMaxBitmap=1000000  -dNOOUTERSAVE -sDEVICE=ppmraw -sOutputFile=out.ppm -dBATCH 
       -dNOPAUSE "H:\AuxFiles\CompareFiles\084-01.ps"  

1. The main change (gsalloc.c) :

The bug persists since the repository was created. 
When an object is freed after the garbager marking phase and before the
relocation phase, the heap consistency check misrecognizes it
as a free object pointed from an useful object. It happens because
the smark field was left unchanged ("marked") but the object status 
changed to 'freed', which must be unmarked.

In the test case such thing happens when a names subtable is freed
with this stack :
    i_free_object()  Line 721
    name_free_sub()  Line 541
    name_scan_sub()  Line 582
    names_trace_finish()  Line 416
    gs_gc_reclaim()  Line 371 

The patch resets the mark whenever i_free_object is called,
so that any freed object automatically becomes unmarked.
We could do it more delicate with checking whether a garbager
is on stack with a new special flag in gs_ref_memory_t,
but we don't see enough reasons for such complex check.

2. Minor change (igc.c) : 

Provide a right operand when gs_abort is called from  
gc_objects_set_reloc. The old code crashed due to dereferencing NULL.

[psi/igc.c base/gsalloc.c]

2008-12-29T18:25:08.338456Z Marcos H. Woehrmann

Script to print out open customer/P1/regression bugs by engineer.

Usage:  bugsByEngineer.pl >report.txt

[toolbin/bugsByEngineer.pl]

2008-12-29T06:43:42.727931Z Michael Vrhel

Fix for Bug 689895.  gx_put_blended_image_cmykspot was improperly inverting the alpha channel.   

[base/gxblend1.c]

2008-12-28T16:03:29.366807Z Alex Cherepanov

Use a proper destructor to free a file stream when access to the file is not
permitted in the safe mode, not just close the file and drop the rest of the
file structure. Bug 689975.

[psi/zfile.c]

2008-12-26T07:25:31.122671Z Alex Cherepanov

Fix 3 last cases of missing prototypes in MS Windows build.

[base/lib.mak psi/int.mak psi/zfcid1.c base/gxblend1.c base/gdevddrw.c]

2008-12-26T04:48:20.570500Z Alex Cherepanov

Remove the last 2 unused variables from Ghostscript code base.

[psi/dwtrace.c base/gdevdjet.c]

2008-12-24T20:33:22.470682Z Alex Cherepanov

Fix a buffer overflow in base font writer module of pdfwrite defice.
Allocate sufficient buffer for the worst case. Bug 690211.

[base/gdevpdtb.c]

2008-12-24T15:36:40.083208Z Ken Sharp

Fix (pdfwrite): Image with SMask fails when inside transparency group.

Details:
Bug #690139: "Regression: pdfwrite creates empty file".

The PDF Interpreter internally surrounds SMask images with an extra transparency group definition. If emitted to PDF this is invalid and causes Acrobat to complain. This was fixed in revision 6878 (bug 688767) by adding an extra parameter  'Image_with_SMask' to the dictionary.

The pdfwrite code checks for the existence of this in the group, and if present (and true) skips the transparency group begin. It also sets a flag in the device, to skip the end of the group as well.

However, the flag is only reset when a new transparency group is begun. If the SMask was nested inside a group then the flag remained set, causing the 'end' for all enclosing groups to be skipped as well. This caused empty output or, in extreme cases, a 'rangecheck' error in discardtransparencygroup, because we overflowed an internal stack.

We now set the device flag to false after we have skipped an end group.

[base/gdevpdft.c]

2008-12-23T09:05:30.676239Z Ken Sharp

Fix (pdfwrite): DSC comments interfering with Page Tree Orientation.

Details:
Bug #689922 "Rotation issues with pdfwrite and multiple operations".

When writing out a PDF file, pdfwrite adds /Rotate keys to individual pages, and if the document is gnerally rotated (eg landscape) will set a /Rotate key in the pages treee. This causes all pages which do not have their own value to inherit this as a default.

Unfortunately, the page tree code uses the same logic as the individual page, whch honours DSC '%%Orientation' and '%%ViewingOrientation' comments. If the last file processed contained one of these, this would become the default for all pages, regardless of their actual orientation. This would cause pages to be inappropriately rotated.

Fixed by clearing the DSC information before writing the orientation for the page tree, by this time all the pages that require it have already been written with their own value.

[base/gdevpdf.c]

2008-12-21T14:34:29.309508Z Igor Melichev

Fix (PS interpreter) : The operator 'gstate' leaked memory.

DETAILS :

Bug 689849 "gstate leaks memory"

The old code of gsave executes 'ref_save' without a clear reason. 
The patch disables it with #if 0.
For a while we keep the old code for an easier
understanding of an unexpected behavior difference, if any.
 

[psi/zdps1.c]

2008-12-21T07:46:52.896538Z Alex Cherepanov

Implement Algorithm 8.1 from PDF 1.6 Reference. Map /BBox of the appearance
stream transformed by /Matrix onto the annotation rectangle.
Bug 690195, customer 770.

[psi/zmatrix.c psi/int.mak Resource/Init/pdf_draw.ps]

2008-12-19T16:50:41.185072Z Ken Sharp

Fix: Problem with /DeviceN [/All].

Details:
Bug #690177 "Separation names become operator names.".

/DeviceN [/All] is technically illegal, but is allowed by Acrobat. We convert this to a /Separation /All colour space for compatibility. An error in the processing of this kind of space led to a string object being used in place of a name object to create the named space.

This led to 'peculiar' plate names instead of 'All', which caused no problems when rendering to CMYK (the alternate is used and sets all inks). However if rendering to a device with additional spot plates not alll plates would be marked as they should be for a /All space. Also pdfwrite produced incorrectly named plates in the output PDF file.

[psi/zcolor.c]

2008-12-19T01:53:18.887063Z Ralph Giles

Warn when the JPX ColorSpace key workaround is activated.

Details:

We don't use pdfformaterror because this is our failing, not the files.
But we call stderrprint to generate the output so it doesn't mangle
device output on stdout.

Suggested by Ray Johnston.

[Resource/Init/pdf_draw.ps]

2008-12-19T01:53:17.038875Z Ralph Giles

Assume unlabled JPXDecode streams are 8 bit DeviceRGB.

This is a work-around for bugs 688159, 689058 and 689509.

Details:

The PDF spec allows the ColorSpace and BitsPerComponent keys of a
JPXDecode filtered image dictionary to be left out, in which case
the interpreter is expected to obtain this information by examining
the stream.

This change does not implement that, but in most cases the image
is RGB, and 8 bits per component; assuming this format allows
correct rendering of all wild files we've seen of this type.

[Resource/Init/pdf_draw.ps]

2008-12-18T23:37:32.655756Z Alex Cherepanov

Change accessors to cmap data to support cmap subtables exceeding 64K-1 bytes.
Bug 690206, customer 870.

[Resource/Init/gs_ttf.ps]

2008-12-16T18:35:55.343539Z Ralph Giles

Fix a typo in commit r9288 which broke the X11 device build. Bug 690202.

Patch by Alex Cherepanov.

[base/gdevxini.c]

2008-12-16T17:52:13.417519Z Ralph Giles

Add the CVS directory to the romfs exclusion list. Bug 690205.

Details:

Currently the mkromfs script just includes the entire file tree under
Resource/ but the presence of any extraneous directories there confuses
the enumeration machinery. We have a exclusion for the .svn directory
so builds out of svn work, but apparently some people have a CVS mirror?

Anyway, it isn't difficult to add an additional exclusion for CVS
metadata. This isn't an issue for git, darcs or mercurial because they
keep all their repository data in the top-level directory.

[base/lib.mak]

2008-12-15T17:15:06.646171Z Ken Sharp

Enhancement (pdfwrite): Add support for the fillpage method.

Details:
The new fillpage device method can be used to detect occurences of erasepage more reliably (and probably more cheaply in performance terms) than the previous checks in the fill_rectangle methods. 

Removed the old code which checked the rectangle size against the page size, the colour against white, and the transparency stack depth, from the fill_rectangle methods. Added a new routine gdev_pdf_fillpage to implement the new fillpage device method.

[base/gdevpdfx.h base/gdevpdfd.c base/gdevpdfb.h]

2008-12-13T20:05:37.951803Z Igor Melichev

Enhancement (graphics) : Implement new device virtual method 'fillpage'.

DETAILS :

The new method improves the handling of 'erasepage' and 'fillpage'
for high level devices, bbox device. Also it is a preparation for
optimizing 'erasepage' for printer devices as for bug 690131.

When erasing a page, the old code passes fill_rectangle through
the device interface. However some devises need to recognize it
as a special high level operation and distinguish from an usual
rectangle filling. The old code implemented some trics for that.
This patch replaces the tricks with a strong logic for bbox device.
The pdfwrite device to be improved separately.

The old function gx_fillpage is now splitted into two parts,
one of which works before the device interface, and another one
after it. The second one looks as a default implementation
for the 'fillpage' device virtual method. Forwarding devices
implement new function gx_forward_fillpage.


[base/gdevrops.c base/gdevdflt.c base/gdevbbox.c base/gxcldev.h base/gxclipm.c base/gsovrc.c base/gxdevice.h base/gdevnfwd.c base/gspaint.c base/gdevddrw.c base/gxclip2.c base/gdevprn.h base/gdevp14.c base/gxdevcli.h base/gxclrect.c base/gdevxini.c base/gxclist.c base/gxclist.h base/gxclip.c base/gxclrast.c]

2008-12-13T16:54:17.751950Z Igor Melichev

Fix (graphics) : Redundant patterns in clist (continued 6).

DETAILS :

This is a further improvement for the bug 690133
"Regression: Ghostscript takes up all disk space when rendering eog or GIMP PDF output in 1200 dpi".
Also it is a preparation for a partial fix for the bug 690131 "Optimize consecutive setpagedevice". 

The last partch appears syntactically incorrect, now fixing.

[base/gxclpath.c]

2008-12-13T12:55:14.082194Z Igor Melichev

Fix (graphics) : Redundant patterns in clist (continued 5).

DETAILS :

This is a further improvement for the bug 690133
"Regression: Ghostscript takes up all disk space when rendering eog or GIMP PDF output in 1200 dpi".
Also it is a preparation for a partial fix for the bug 690131 "Optimize consecutive setpagedevice". 

The last partch wrongly distributed the saved pattern id for all bands
when writing a non-pattern color to all bands.
We believe it never happens the current revision with reasonable banding settings,
but fix fix it for code consistency and for avoiding problems
with further revisions.

[base/gxclpath.c]

2008-12-13T11:14:54.029422Z Igor Melichev

Fix (graphics) : Redundant patterns in clist (continued 4).

DETAILS :

This is a further improvement for the bug 690133
"Regression: Ghostscript takes up all disk space when rendering eog or GIMP PDF output in 1200 dpi".
Also it is a preparation for a partial fix for the bug 690131 "Optimize consecutive setpagedevice". 

This patch passes the coverage rectangle of a graphic element
for a better computation in cmd_put_drawing_color of the size 
would be consumed while serializing a color to clist
with copying to all covered bands.
When we need to force writing to all bands,
we pass a NULL instead the coverage rectangle.

[base/gxclpath.c base/gxclimag.c base/gxclrect.c base/gxclpath.h base/gxcldev.h]

2008-12-13T10:18:02.260144Z Ken Sharp

Fix (pdfwrite): Fonts with unusual FontMatrix generating incorrect FontBBox.

Details:
bug #689879 "wrong FontBBox in PDF file"

Fonts other than type 3 may not have a FontMatrix in PDF, these fonts are assumed to be on a 1000x1000 design grid. Most fonts already are, and embedded TrueType fonts are already catered for, but some unusual fonts have a non-standard (not [0.001 0 0 0.001 0 0]) FontMatrix. The matrix is accounted for when scaling the font, so the Tf operator is correct in the page content stream, but the FontBBox was calculated using the unscaled glyph outline.

We now scale the font outline into a 1000x1000 design grid before calculating the bounding box, so that the FontBBox entry will be correct.

[base/gdevpdtd.c]

2008-12-13T10:13:47.692668Z Ken Sharp

Fix (pdfwrite): Tidy up code.

Details:
Tidy up some code for bug #690118; When writing TrueType hmtx/vmtx, define a new function put_short which is functionally identical to put_ushort but doesn't truncate the sign bit. Use this instead of put_ushort when the value to be written may be negative. Add 0.5 to the floating point calculations and floor() the result so that we get the nearest approximation to the float when writing out the short.

A small number of files exhibit a number of single pixel differences in position or rendering of glyphs with this change. In all cases comparing the rendered result of the new PDF file with the rendered result of the original file shows no differences, so I consider these to be progressions.

[base/gdevpsft.c]

2008-12-10T19:10:43.669416Z Ralph Giles

Set standard properties on pdf_main.ps. Bug 690198.

[Resource/Init/pdf_main.ps]

2008-12-10T07:29:39.713832Z Igor Melichev

Fix (PDF interpreter) : Avoid extra erasepage, part 1.

DETAILS :

This is the first partial fix for the 
bug 690131 "Optimize consecutive setpagedevice".

The PDF interpreter calls extra setpagedevice for initializing the number of spot colors.
First it happens in pdfshowpage_setpage, and we merge that call
with another one that sets other multiple page parameters. 
Second in pdfshowpage_finish we replace it with .setpagedevice, 
which doesn't call .postinstall that calls erasepage.

[Resource/Init/pdf_main.ps]

2008-12-09T17:30:40.898715Z Marcos H. Woehrmann


Fix for weird math issue under AIX that cause problems in glpyh spacing when
writing type42 fonts for ps2write and pdfwrite.

This fixes bug 690118.

Details:

For reasons that I don't undertand under AIX (ushort) (double * double)
produces a 0 if the first double is > -1 and < 0 (and the sum is < -1).
Presumably the cast happens before the multiplication, but this isn't
reasonable and doesn't occur on other operating systems, even running
the same version of gcc.  Temporarily assigning the sum to a float and
then casting to a ushort resolves the problem.

The temporary assignment should be removed by the optimizer, so there
shouldn't be a performance hit (I did check, the optimized code is still
correct under AIX).


[base/gdevpsft.c]

2008-12-09T08:45:20.654566Z Ken Sharp

Fix (pdfwrite): regression with type 3 fonts using show charpath stroke combinations.

Details:
bug #690196 "regression: file for bug 689687"

The recent changes for text rendering modes caused a regression with Quark's type 3 font for special text effects, when optimising a show followed by charpath stroke into a single 'Tj' with a text rendering mode of 2 in the resulting PDF file.

Fixed by ceasing to treat type 3 fonts specially and applying the same optimisation as for other font types. A couple of other Quark files exhibit very small differences, comparing these to the rendered output of the original files the new result seems closer to the original. (ie a progression)

Also resolved a compiler warning.

[base/gdevpdtc.c base/gdevpdfd.c]

2008-12-09T08:01:43.121661Z Igor Melichev

Fix (graphics) : Redundant patterns in clist (continued 3).

DETAILS :

Bug 690133 "Regression: Ghostscript takes up all disk space when rendering eog or GIMP PDF output in 1200 dpi".

When filling a path with a pattern, the old code
stores the pattern to all bands that are covered with the path.
If the pattern is represented with a long clist, 
it consumes too big memory for the page clist.

If the pattern is big, the new code writes it 
to the "all bands" list instead replicating it to bands. 
Therefore the overall memory is smaller.

The decision about storing a pattern to "all bands"
should also depend on the number of bands.
This patch doesn't account that because current data flows
don't pass the number of bands to the point where
the decision must be taken. It may need a further improvement.

The threshold for "big" pattern is arbitrary set to 1Mb.
It may need an improvement also. It's another threshold 
than one for representing a pattern as a raster or a clist.

[base/gxclpath.c base/gxclutil.c base/gxcldev.h]

2008-12-09T07:58:55.697280Z Igor Melichev

Fix (graphics) : Redundant patterns in clist (continued 2).

DETAILS :

This patch is important for the bug Bug 690133 
"Regression: Ghostscript takes up all disk space when rendering eog or GIMP PDF output in 1200 dpi",
but it is not restricted with its case.

When writing a pattern color to a band,
the old code uses the "saved color" structure
for remembering which color has been stored for the band.
In the case of pattern it stores the client's pattern id.
However it doesn't provide enough resolution because
a client's pattern may be instantiated with various CTMs.
The new code uses the pattern tile id to distinguish the pattern instances.

We're not sure why saved color structure stores the client's pattern id only.
It should be so for pdfwrite, but need to check whether other
cases are possible. Therefore the current change is kind of hackish.
See comment in code.

[base/gxclpath.c]

2008-12-08T08:17:55.714566Z Ken Sharp

Fix (pdfwrite): Large type 1 or 2 fonts caused errors with text.

Details:
bug #690144 "Files render properly with gs, but are misformatted in ps2pdf"

Revision 8235 added support to pdfwrite for type 0 fonts with type 1 or type 2 (CFF) descendant fonts, emitting these as subsets of the original instead of rendering the glyphs and embedding type 3 fonts with bitmap images. This results in better quality and smaller files.

However type 1 or 2 fonts which are too large for an arbitrary Ghostscript limit (> 65537 glyphs) can not be copied. This 'should' have fallen back to the old mechanism, but some data had been altered which led to this failing.

The fix for this comprises 3 parts:

1) Mmodified scan_cmap_text to save the data we modify for subsetting, and restore it if pdf_obtain_font_resource_unencoded fails, which then falls back to the 'default' type 3 mechanism (in case of future problems in this area). 

2) Increased the limit of glyphs (for type 1 or 2 fonts) in gs_copy_font. Added a new parameter 'max_reserved_glyphs'. If this is -1 then we reserve enough space for the number of glyphs in the original font. Otherwise we reserve space for the specified maximum. This limit only applies to font type 1 or 2, and is used by pdfwrite to avoid making excessively large font copies.

3) Modified pdf_base_alloc so that if the font is large (and is not one of the standard 13 fonts), we don't allocate a complete copy for our 'subset', we only allocate as many glyphs as will fit in a standard Encoding, 256, plus  one for the required .notdef making 257 in total. We also avoid making a second 'complete' copy of the font, because we will never write the complete font.

[base/gdevpdtb.c base/gxfcopy.c base/gdevpdtc.c base/gxfcopy.h]

2008-12-05T07:39:06.671710Z Alex Cherepanov

Check the whole Decode array to detect special cases of identity and inverse
decoding. Previous test analyzed every channel separately and misidentified
decoding arrays like [0 1 1 0 0 1]. Bug 690178.

[base/gxipixel.c]

2008-12-05T04:44:51.989860Z Alex Cherepanov

Adds special, tolerant to singular matrix processing, to the case when
ImageMatrix is differs from the CTM by the translation vector only, which
happens in cached character rendering. The patch clears PostScript errors
during text rendering with singular CTM. Bug 690179, customer 870.

[base/gxipixel.c base/gsimage.c base/gxccache.c]

2008-11-29T14:33:26.712726Z Alex Cherepanov

Ignore /ToUnicode attribute when it points to an object other then a stream.
Bug 680138.

[Resource/Init/pdf_font.ps]

2008-11-29T12:27:04.428583Z Till Kamppeter

The pstopxl CUPS filter did not remove its temporary file.

[cups/pstopxl.in]

2008-11-27T15:05:37.010932Z Ken Sharp

Fix (pdfwrite): more issues with PDF Text rendering modes.

Details:
Bug #689692 Colour and linewidth is not set correct for text with rendermode STROKE
and FILLSTROKE
Bug #Bug690025 pxlmono driver prints some glyphs as squares when the input is PostScript generated by Ghostscript

This follows on from revision 9196 and further addresses problems with PDF text rendering modes. Fundamentally the problem is that the PDF text matrix (Tm) should not affect the stroke width. However PostScript only has one transformation matrix, so when we get a Tm, the PDF interpreter modifies the CTM accordingly. This alters the (effective) stroke width, resulting in incorrect output.

This patch modifies the CTM before executing a stroke in modes 2 & 6, and for mode 1 modifies the stroke width by calculating what it would have been if the CTM were the identity at the time the text block began. Since pdfwrite emits text in an identity CTM, this corrects the problem.

The pdfwrite code for combining show/charpath/stroke operations into a single text rendering mode has been modified to expect the CTM to be correct, and to utilise it, when emitting the combined operation.


[Resource/Init/pdf_ops.ps base/gdevpdts.c base/gdevpdfd.c base/gdevpdts.h base/gdevpdfg.c]

2008-11-27T05:20:05.725774Z Alex Cherepanov

Use the same name (/PDFType3Untitled) for all Type 3 fonts without /FontName
attribute. PDF interpreter doesn't need unique names and the previous attempt
to generate unique names didn't work. Bug 689358.

[Resource/Init/pdf_font.ps]

2008-11-27T01:58:54.354925Z Alex Cherepanov

Restore language level after loading pdfwrite.ps for consistency and
compatibility with PS utilities. Also pick a few nits that may cause errors
if some of start-up files ever loaded in level 1 mode. Thanks to SaGS
for the patch. Bug 688151.

[lib/pdfwrite.ps Resource/Init/gs_dpnxt.ps Resource/Init/gs_cff.ps]

2008-11-25T17:19:23.759068Z Till Kamppeter

Fixed paper tray selection for the PCL 4/5/5e drivers (bug 690182). Works fine now with "-dMediaPosition=..." and for all possible trays. Needs review to see whether it does not break anything else.

[base/gdevdjet.c]

2008-11-24T23:04:21.969628Z Alex Cherepanov

Skip everything before 'begincodespacerange' in ToUnicode CMap stream
to avoid PostScript errors in CMap headers. PDF interpreter doesn't
need any data from the header. Bug 689842, customer 870.

[Resource/Init/pdf_font.ps]

2008-11-24T19:15:04.507271Z Till Kamppeter

Fixed input tray selection support in the PCL-XL drivers ("pxlmono"/"pxlcolor"), fixes on CUPS filter and PPDs to make input tray selection actually work.

[base/gdevpx.c cups/pstopxl.in cups/pxlmono.ppd cups/pxlcolor.ppd]

2008-11-24T11:01:42.358113Z Till Kamppeter

Made the CUPS filters and PPDs for PCL-XL also work with PDF as input data format

[cups/pstopxl.in cups/pxlmono.ppd cups/pxlcolor.ppd]

2008-11-23T20:36:12.040586Z Igor Melichev

Fix (CID font emulation) : CID from another writing mode rendered a wrong glyph (continued)

DETAILS :

This improve3s the second partial fix for Bug 689304  
"improper handling of vertical japanese text", related to Comment #30, #31. 

The revision 9213 appears buggy.
When a SubstCID resource is not available,
the stack balance is broken.

[Resource/Init/gs_cidtt.ps]

2008-11-21T14:24:21.693040Z Till Kamppeter

The "cups" output device was logging way to much in CUPS' debug logging mode. Moved some logging to debug2.

[cups/gdevcups.c]

2008-11-21T05:31:10.447898Z Alex Cherepanov

Add a check for bogus '>>' after 'endstream' to recover files generated 
by 'Kroll Background Screening'. Bug 690161.

[Resource/Init/pdf_base.ps]

2008-11-20T21:11:09.954526Z Alex Cherepanov

Move validation of the page tree after installation of the decryption handler
because access to encrypted xref streams needs decryption. Fix regression
introduced by the rev. 8933. Bug 690175.

[Resource/Init/pdf_main.ps]

2008-11-20T19:31:36.700423Z Ralph Giles

Add AES support to the pdf interpreter.

This commit adds convenience wrappers around the aes stream
implementation to pdf_sec.ps, and calls them when appropriate,
based on the crypt filter methods defined in the file Trailer's
Encrypt dictionary. Bug 688958.

It also includes comment and whitespace cleanup.

[Resource/Init/pdf_sec.ps]

2008-11-17T19:43:47.727833Z Alex Cherepanov

Add missing initialization of read_id field in reusable streams.

DETAILS:
This error was detected by Valgrind. I don't have any samples where this fix
affects the output.


[psi/zfrsd.c]

2008-11-17T10:41:13.803460Z Ken Sharp

Fix (pdfwrite): Not considering all glyphs in a string when noting first/last character

Details:
Bug 690166: extra space after apostrophe when distilled
Revision 8235 added support for type 0 fotns with type 1 or 2 descendants, this required using pdf_adjust_first_last_char so that we correctly noted the used glyphs, and stored their widths.

An oversight in calling the function resulted in only the first glyph in the string being considered.

[base/gdevpdtc.c]

2008-11-16T14:47:49.851717Z Igor Melichev

Fix (PS interpreter) : Eliminate unuseful transfer of left side bearing to type42_finish.

DETAILS :

This change is algorithmically equivalent.

type42_finish never uses lsb data that could be passed to it via
operand stack from some clients. This patch removes those data
and related arguments of some C functions.

[psi/zchar42.c psi/zchar42.h psi/zchar.c]

2008-11-16T12:15:46.619814Z Igor Melichev

Fix (TT font handler) : Wrong glyph posiitions with vertical vcriting mode.

DETAILS :

Bug 689304 "improper handling of vertical japanese text".

This is third partial patch for the bug 689304.
The old formulas were obtained impirically and don't
give the right result. The new ones are coded with a better understanding
of the problem. See comments in code for more details. 

Rather the patch closes the bug, we want to do some additional
equivalent changes for cleaning the code. Another patch coming soon.

[psi/zchar42.c]

2008-11-15T14:07:27.807825Z Ken Sharp

Fix PS interpreter: issues with ICCBased spaces

Details:
Bug #690169 Regression: seg fault reading  Bug689830.pdf, Bug689831.pdf, and annots.pdf

The 9218 revision to restore the 'optional' nature of the Alternate in ICCBased colour spaces was unfortunately incomplete. This led to us trying to set a 'null' colour space when a PDF file had a damaged and unusable ICC specification.

We now use the technique specified in the PDF Reference, take the value of 'N' from the space and use that to select an appropriate alternate, when one is not specified.

[psi/zcolor.c]

2008-11-13T14:23:05.749468Z Alex Cherepanov

Skip null entries in /Annots array. Bug 690161.

[Resource/Init/pdf_main.ps]

2008-11-13T02:02:49.620374Z Ray Johnston

Revert 8.63 behavior where the /Alternate key/value pair in ICCBased param dictionaries
is optional. Bug 690165 for customer 850.

DETAILS:

This allows:

[ /ICCBased << /N 3 /DataSource (srgb.icc) (r) file >> ] setcolorspace

to work, where srgb.icc is the path to an 'input' ICC color profile.

Until Ghostscript has support for ICC profiles throughout, this is useful to
allow for setting the Resource/ColorSpace/Default*** colorspaces (or
defining the ColorSpace resources) using ICC profiles.

[psi/zcolor.c]

2008-11-10T19:01:57.531817Z Igor Melichev

Fix (clist writer) : A crash when transparent object appears over the page top.

DETAILS :

Bug 690149 "PDF-file can not be converted".

The transparency compositor cropping caused an attempt to
Write to a non-existing band over the page top.
This patch skips writing such compositor commands. 


[base/gxclimag.c]

2008-11-09T20:38:08.817663Z Igor Melichev

Fix (CID font emulation) : CID from another writing mode rendered a wrong glyph (part 2).

DETAILS :

This change fixes the previous change's commitment error.
This log message describes the union of the 2 changes.

This is a second partial fix for Bug 689304
"improper handling of vertical japanese text", related to Comment #30, #31.

When emulating a CID font with an Open Type font, a CID is first
mapped to an OpenType encoding and then to a glyph index.
However OpenType provides same character codes for glyph variants,
which render differently depending on writing mode.
The glyph '(' is an example.

This patch works for OpenType fonts only, which provide a GSUB for vertical 
writing mode.
It is not working for True Type collections with no GSUB.
They need a further improvement.

The patch assumes that all interpreters initialize a Type 42 font with 
zeroing all its fields.
Postscript interpreter does so since a long ago, but we're not sure about 
others.
They may need an improvement.

1. Define a new resource category SubstCID (Resource/Init/gs_ciddc.ps).

2. Provide a tool for generating resources for that category 
(toolbin/GenSubstCID).

3. Provide resources for various orderings (Resource/SubstCID/CNS1-WMode,
Resource/SubstCID/GB1-WMode, Resource/SubstCID/Japan1-WMode, 
Resource/SubstCID/Korea1-WMode).

4. When loading a TrueType or OpenType font for a CID font emulation, 
associate an
appropriate SubstCID resource to it (Resource/Init\gs_cidtt.ps).
(We do associate the resource with TrueType hoping that some
True Type fonts may provide GSUB).

5. Define a new structure gs_subst_CID_on_WMode_s for storing that 
information
for the graphics library (base\gxfcid.h), and its garbager descriptor 
(base/gsfcid.c).
Since it may duplicate for several fonts, it is shared and 
reference-counted.

6. The new function get_subst_CID_on_WMode loads the resource data for the 
graphics library
in psi\zfcid1.c . Note it is implemented for PS interpreter only.

7. Generalized gs_type42_substitute_glyph_index_vertical with providing a 
CID in base/gstype42.c
and made it be a virtual function of gs_font_type42 (base/gxfont42.c).
We're not sure how other interpreters initialize the font, so
we're checking it for NULL for safety and use 
gs_type42_substitute_glyph_index_vertical
as a default implementation.

8. font11_substitute_glyph_index_vertical is another implementation of that 
function, which
accounts gs_subst_CID_on_WMode_s data for providing a right glyph depending 
on WMode.
Rather a SubstCID resource provides a substitution, currently
we only use the fact that a CID is substituted, and never use
the substituting CID. Nevertheless we prefer to define and store the 
resource
in the complete form for possible improvements in future (zfcid1.c).

9. release_subst_CID_on_WMode automatically releases the resource data
when all fonts (that use it) are released.

10. Added SubstCID to the ROM file system in psi/psromfs.mak .

11. Minor unrelated fix : propagate errors from gs_font_notify_register for 
(7) in base/gstype42.c .

[psi/zchar42.c Resource/Init/gs_ciddc.ps Resource/Init/gs_cidtt.ps psi/int.mak psi/zfcid1.c psi/zfont42.c]

2008-11-09T19:09:30.285684Z Igor Melichev

Fix (CID font emulation) : CID from another writing mode rendered a wrong 
glyph (part 1).
This revision is incomplete due to a commitment error. Please use next 
revision.

DETAILS :

This is a second partial fix for Bug 689304
"improper handling of vertical japanese text", related to Comment #30, #31.

When emulating a CID font with an Open Type font, a CID is first
mapped to an OpenType encoding and then to a glyph index.
However OpenType provides same character codes for glyph variants,
which render differently depending on writing mode.
The glyph '(' is an example.

This patch works for OpenType fonts only, which provide a GSUB for vertical 
writing mode.
It is not working for True Type collections with no GSUB.
They need a further improvement.

The patch assumes that all interpreters initialize a Type 42 font with 
zeroing all its fields.
Postscript interpreter does so since a long ago, but we're not sure about 
others.
They may need an improvement.

1. Define a new resource category SubstCID (Resource/Init/gs_ciddc.ps).

2. Provide a tool for generating resources for that category 
(toolbin/GenSubstCID).

3. Provide resources for various orderings (Resource/SubstCID/CNS1-WMode,
Resource/SubstCID/GB1-WMode, Resource/SubstCID/Japan1-WMode, 
Resource/SubstCID/Korea1-WMode).

4. When loading a TrueType or OpenType font for a CID font emulation, 
associate an
appropriate SubstCID resource to it (Resource/Init\gs_cidtt.ps).
(We do associate the resource with TrueType hoping that some
True Type fonts may provide GSUB).

5. Define a new structure gs_subst_CID_on_WMode_s for storing that 
information
for the graphics library (base\gxfcid.h), and its garbager descriptor 
(base/gsfcid.c).
Since it may duplicate for several fonts, it is shared and 
reference-counted.

6. The new function get_subst_CID_on_WMode loads the resource data for the 
graphics library
in psi\zfcid1.c . Note it is implemented for PS interpreter only.

7. Generalized gs_type42_substitute_glyph_index_vertical with providing a 
CID in base/gstype42.c
and made it be a virtual function of gs_font_type42 (base/gxfont42.c).
We're not sure how other interpreters initialize the font, so
we're checking it for NULL for safety and use 
gs_type42_substitute_glyph_index_vertical
as a default implementation.

8. font11_substitute_glyph_index_vertical is another implementation of that 
function, which
accounts gs_subst_CID_on_WMode_s data for providing a right glyph depending 
on WMode.
Rather a SubstCID resource provides a substitution, currently
we only use the fact that a CID is substituted, and never use
the substituting CID. Nevertheless we prefer to define and store the 
resource
in the complete form for possible improvements in future (zfcid1.c).

9. release_subst_CID_on_WMode automatically releases the resource data
when all fonts (that use it) are released.

10. Added SubstCID to the ROM file system in psi/psromfs.mak .

11. Minor unrelated fix : propagate errors from gs_font_notify_register for 
(7) in base/gstype42.c .

[Resource/SubstCID/CNS1-WMode base/gxfcid.h Resource/SubstCID base/lib.mak Resource/SubstCID/GB1-WMode Resource/SubstCID/Japan1-WMode base/gsfcid.c base/gxfont42.h psi/psromfs.mak base/gstype42.c toolbin/GenSubstCID.ps Resource/SubstCID/Korea1-WMode]

2008-11-07T18:49:34.403723Z Ralph Giles

Remove a duplicate typedef for stream_arcfour_state.

Details:

The duplicate (opaque pointer) typedef in gdevpdfx.h was
redundant and any users that dereferenced members or allocated
the struct on the stack already included sarc4.h.

I believe the idea here was just to hide the structure details
from some hypothetical user of the pdf_crypt api. However, the
stream state structure should either be opaque, with only the
typedef in sarc4.h or it should be public and using it requires
sarc4.h. The duplication isn't justified in either case.

Since stream state structures generally are public so they can
be stack-allocated, we decided to remove the duplicate typedef.

Also adds a missing dependency to the makefile.

Issue originally reported by the coverity hfa checker.

[base/gdevpdfx.h base/devs.mak]

2008-11-06T23:51:27.600449Z Marcos H. Woehrmann

Updates to nightly regressions to allow them to run under Mac OS X.  

Details:

Change uname parameters from '-m -o' to '-m -s'
Don't appened ".db" to filename when opening database.
Replace sendmail python function with call to /usr/bin/sendmail.
Archive daily rasters.
Change location of gscdef.c from src to base.
Call time from /usr/local/bin (/usr/bin/time doesn't take -f option).

Note that some of these changes are not compatible with peeves.

[toolbin/tests/make_baselinedb.py toolbin/tests/gscheck_raster.py toolbin/tests/testdiff.py toolbin/tests/compare_checksums.py toolbin/tests/gscheck_pdfwrite.py toolbin/tests/build_revision.py toolbin/tests/check_dirs.py toolbin/tests/compare_checksumdb.py toolbin/tests/gsconf.py toolbin/tests/get_baseline_log.py toolbin/tests/run_nightly.py toolbin/tests/gstestgs.py toolbin/tests/run_regression.py toolbin/tests/update_baseline.py]

2008-11-06T23:30:55.150402Z Marcos H. Woehrmann

Stopped generating 600 dpi raster files when running make_missing since they were never being tested.

[toolbin/tests/gsparamsets.py]

2008-11-06T23:27:54.191464Z Marcos H. Woehrmann

Made some messages prettier.

[toolbin/tests/testdiff.py]

2008-11-06T23:25:02.686517Z Marcos H. Woehrmann

Fixed typo.

[toolbin/tests/update_baseline.py]

2008-11-06T20:13:19.335714Z Igor Melichev

Fix (graphics) : A missed dependency in makefile.

[base/lib.mak]

2008-11-06T20:04:26.632073Z Igor Melichev

Fix (clist interpreter) : A faster procesing without a preliminary clearing of the band buffer.

DETAILS :

The preliminary cleaning of the buffer appears unuseful because erasepage
in the clist code performs same function.

[base/gxclread.c]

2008-11-06T19:09:39.284217Z Ralph Giles

Remove an unused variable.

[base/gdevpdtt.c]

2008-11-06T19:09:37.330669Z Ralph Giles

Add a missing include for pdf_prepare_stroke().

[base/gdevpdts.c base/devs.mak]

2008-11-05T20:41:22.951927Z Ralph Giles

Remove psromfs.mak from ugcclib.mak.

This makefile is ostensibly for the graphics library only.

[base/ugcclib.mak]

2008-11-05T20:41:06.620266Z Ralph Giles

Add -lpthread to ugcclib.mak. It is now required by sync=posync.

[base/ugcclib.mak]

2008-11-05T08:26:19.980667Z Ken Sharp

Fix (pdfwrite): several issues with PaintType 2 (stroked fonts) and PDF Text rendering modes.

Details:
Bug #690136 Differences in character stroke width
Bug #689970 major artefacts in pdfwriter output
Bug #688267 Ghostscript need native PDF graphic state
Bug #689654 pdfwrite ignores font /PaintType 1
Bug #689692 Colour and linewidth is not set correct for text with rendermode STROKE
and FILLSTROKE

The current implementation of text rendering modes has some problems. I've been able to address most of these in this patch by:

1) Making the charpath detection slightly less picky. This picks up more instances of filled text followed by 'charpath stroke', combining correctly into a PDF text  rendering mode.

2) Relaxing the criteria for detecting a Tr mode involving stroking.

3) Removing some spurious scaling, and applying a better scale factor when using stroked fonts (Paint Type 2).

There are still problems with this code, and they are insuperable in the current architecture of pdfwrite/PDF interpreter. Specifically; Text render mode 6 (fill, stroke and clip) doe snot work properly, text which is stroked using a linewidth set  outside the text block, and with a non-identity CTM and non-identity text matrix  results in incorrect stroke widths.

This will need to be addressed further under bug #688267, which is an enhancement. In the meantime this patch significantly improves the current implementation. Note; bug #689692 is still slightly incorrect with this patch, though improved. Bug #690025 is unchanged (still incorrect).

[base/gdevpdts.c base/gdevpdtt.c]

2008-11-04T05:07:32.360011Z Alex Cherepanov

Add support for indirect objects in /W and /W2 entries in the CIDFont
dictionary. Bug 690151.

[Resource/Init/pdf_font.ps]

2008-11-04T03:33:52.379523Z Alex Cherepanov

Export (i.e. don't undefine) runpdfpagerange procedure for the benefit
of PDF manipulation utilities. Bug 690153.

[Resource/Init/pdf_main.ps]

2008-11-03T06:26:32.640021Z Alex Cherepanov

Fix a bug in object stream handling that sometimes dropped incremental
updates. Bug 690141.

DETAILS:
An incremental update can replace only some of the objects in the
object stream. Old code didn't check xref tables and resolfed all 
unresolved objects from the stream. Once resolved, an object is no
longer accessed through xref.

[Resource/Init/pdf_base.ps]

2008-11-03T04:28:51.792909Z Ray Johnston

Fix Floating Point excpetion caused by improper initializer of a private device
structure subclassed (in the klunky C ghostscript fashion) from the gx_device_printers_s
structure. Restructure a macro in base/gdevprn.h to help prevent similar bit rot in the
future.  Bug 690122.

DETAILS:

The problem was with devices that use the contrib/lips4/gdevlprn.h header
files. The lp_duplex_device_body_rest_ and lp_device_body_rest_ macros that
initialized the prn_device structure 'common' elements were out of date with
respect to the revision in the gx_device_printer_s structure made for the
multi-threaded rendering. The num_render_threads_requested integer was added.

I restructured the prn_device_body_rest2_ in base/gdevprn.h so that the
contrib/lips4/gdevlprn.h initialization macro could use this to minimize the
likelihood of bit rot in the future.

I did a search for other devices that might have the same problem and did not
find them (although I may have missed them).

[base/gdevprn.h contrib/lips4/gdevlprn.h]

2008-10-28T03:15:52.084170Z Alex Cherepanov

Don't assume that the top of the dictionary stack is writable or can be made
writable by allocating a new PDF graphic state. The latter cannot be done in
pdfinflt.ps and similar clients. This patch replaces my previous fix (r. 9124)
for the bug 690088. Bug 690134.

[Resource/Init/pdf_base.ps]

2008-10-28T00:43:49.468966Z Alex Cherepanov

Ignore named encodings for known symbolic fonts. Bug 690135, customer 580.

DETAILS:
Acrobat reader appears to know that /WinAnsiEncoding is not compatible with
Wingdings2. The patch looks up the font name in a table to determine whether
the font is symbolic because corresponding /Flags attribute is unreliable.

[Resource/Init/pdf_font.ps]

2008-10-27T21:53:17.877952Z Ralph Giles

Update the documentation reference to psromfs.mak.

This file moved from base to psi in r9126.

[doc/Develop.htm]

2008-10-25T04:34:30.742669Z Michael Vrhel

Fix for bug 690103.  This issue was introduced with r8868 where spatial interpolation in the source color space was introduced.  The part that was missing in that commit was to handle the case where we had 8 bit image data that was non CIE based and NOT encoded with [0 1] .

DETAILS:

This patch was tested with forced interpolation on a set of files that are known to have issues with interpolation. It performed properly on those and on the customer's bug file. 

The part that was missing in the old code was the case where we have encoded
(not [0 1]) nonindexed 8 bit image data that is not CIE based.	For this case,
it was not getting properly decoded prior to interpolation.  

[base/lib.mak base/gscspace.h base/gxiscale.c base/gscspace.c]

2008-10-24T14:51:44.819826Z Igor Melichev

Fix (TT font handler) : Properly process a broken TTC header.

DETAILS :

Bug 690105 "seg fault reading pcl file"

1. Check for TTC version header and print error if it is unknown.
2. Fixing the formatting according to C-style.htm .

[base/gstype42.c]

2008-10-23T04:33:29.326096Z Marcos H. Woehrmann

Make gx_sort_ht_order() deterministic.

DETAILS:

The gx_sort_ht_order() routine sorts the halftone mask values.
These values are often the same and qsort() does not guarantee the
order of equal elements.  However, the order appears to be significant
for the output (differences in the nightly regression are seen on
different computers).  And it's also possible that this indeterminism
is part of the cluster regression problem.

This revision sorts equal masks by index value.

DIFFERENCES EXPECTED:

Some of the pbmraw or pkmraw nightly regressions may have minor
differences in the dithering pattern.

[base/gsht.c]

2008-10-23T04:28:42.566180Z Marcos H. Woehrmann

Changed decleration of det from float to double in gs_matrix_invert().  

DETAILS:

On peeves the results of gs_matrix_invert() change depending on
whether or not compiler optimization is enabled if det is declared
as a float.  I believe this is due to the optimized code never
storing the det value so it never get shortened to a float; by
declaring it as a double the unoptimized code should act the same.

[base/gsmatrix.c]

2008-10-21T18:09:59.854984Z Ralph Giles

Fix a makefile dependency which should have been added in r8872.

[base/lib.mak]

2008-10-21T16:26:09.248809Z Igor Melichev

Fix (PS intetreter) : Crash in garbager when resetting marks in names table.

DETAILS :

Bug 690129 "MSVC8 x64 debug build crashes in names_trace_finish"

1. The real bug : the old code sometimes removes an element from nt->sub table with name_scan_sub,
and then resets marks in the element that has same table index. 
If the removed element is the last one,
it tryes to process an uninitialised element and crashes indeterministically.
The new variable save_count works for that.
The bug persisted since the repository was created.

2. Minor change : an optimization : The old code checked twice
for the loop exit condition. To fix it we changed the type of
the variable 'i' and changed the loop condition.

[psi/iname.c]

2008-10-21T10:35:52.809111Z Ken Sharp

Fix (pdfwrite): Conversion of PaintType 0 fonts to text rendering mode
1 sometimes produced incorrect stroke width.

Details:
Bug #690116 "StrokeWidth of outline font too small"

pdfwrite converts fonts with a PaintType of 0 (outline fonts) to a normal
font, but sets the text rendering mode to 1. The calculation of the 
required stroke width was insufficient in some cases.

[base/gdevpdts.c base/gdevpdtt.c base/gdevpdts.h]

2008-10-19T20:32:03.940940Z Alex Cherepanov

Search for 'startxref' instead of '%%EOF' in PDF recovery code because
'%%EOF' is mangled more ofthen than 'startxref'. Bug 690071, customer 384.

[Resource/Init/pdf_rbld.ps]

2008-10-19T01:23:28.662366Z Alex Cherepanov

Extend the size of the array for procedures scheduled for binding in DELAYBIND
mode to 2000. Prevent an overflow when 3rd party code (such as Ubuntu CJKV
patch) binds many new procedures. Bug 690124.

[Resource/Init/gs_init.ps]

2008-10-18T10:52:42.057112Z Till Kamppeter

Fixed bug #690032: bjc600/bjc800 drivers do not work with PDF input

[base/gdevcdj.c]

2008-10-18T03:11:41.445457Z Alex Cherepanov

Fix a bug in a new reusable stream implementation introduced in rev. 8810.
Take into account unread data left in the stream buffer before refilling
the buffer. Bug 690090, customers 384, 581, 661.

[psi/zfrsd.c]

2008-10-17T22:58:21.764880Z Ralph Giles

Update properties for cups driver files.

[cups/pstoraster.in cups/pdftoraster.c cups/pstopxl.in cups/pxlmono.ppd cups/cups.mak cups/gdevcups.c cups/pxlcolor.ppd]

2008-10-17T22:57:38.635737Z Till Kamppeter

Use $(PDFTORASTER_XE) for path to compiled pdftoraster binary

[cups/cups.mak]

2008-10-17T21:46:27.567328Z Till Kamppeter

Put new files under MIT license,

[cups/pdftoraster.c cups/pdftoraster.convs]

2008-10-17T20:50:06.903656Z Igor Melichev

Fix (clist writer) : Wrong compositor cropping when a shading is entirely clipped out (continued).

DETAILS :

Bug 690106 "Regression: /unregistered in --run--" 

The recent patch for the subject is not sufficient because
an empty clipping condition cannot be anticipated in the clist writer.
To fix it we introduce a new flag gx_device_clist_writer_s::cropping_saved
especially for clist_fill_path to know whether it was called recursively
for passing an untrivial clipping path for a shading. The cropping must be restored
in the outer call iff it is set.

[base/gxclpath.c base/gxclist.c base/gxclist.h]

2008-10-17T20:27:04.052662Z Till Kamppeter

Added Ghostscript-based pdftoraster filter

[cups/pdftoraster.c cups/cups.mak cups/pdftoraster.convs]

2008-10-17T16:49:58.474885Z Till Kamppeter

Fixed several bugs, like crash if input is PDF (bug #690101), duplex not working, ...

[cups/gdevcups.c]

2008-10-17T13:44:34.259593Z Alex Cherepanov

Consider /Identity CMap compatible with any CIDFont /Ordering. Bug 690120.

[Resource/Init/gs_cidcm.ps]

2008-10-17T09:31:35.914027Z Ken Sharp

Fix (pdfwrite): ICCBased color spaces in input PDF files, /Alternate space converted to
ICCBased in output PDF file.

Details:
Bug #690038 "Regression: ghostscript cannot read ghostscript produced PDF file."

The PDF interpreter always runs with (in effect) /UseCIEColor set to true. This converts
process spaces to CIE color spaces, which are emitted in the PDF as ICCBased color
spaces when using pdfwrite/ps2write.

However, for ICCBased color spaces this caused the /Alternate space of the ICCBased
space to become another ICCBased space, which is legal but silly, and caused the GS PDF
interpreter problems.

Modified the alternate space extraction routines so that they can use the UseCIE flag in
the color handling code to prevent the base space being  substituted with a CIE space,
when the parent space is an ICCBased space.

Also discovered in passing that zfsample.c and zfunc4.c use zcolor.h but the makefile
did not have dependencies for them. Fixed.

[psi/zcolor.c psi/zfunc4.c psi/zcolor.h psi/int.mak psi/zfsample.c]

2008-10-15T17:47:00.008618Z Ray Johnston

Switch file I/O of 'opdfread.ps' to 'strmio' that supports the %rom% file system
as well as the default (%os%) file system. Bug 690074.

[base/gdevpdfu.c base/devs.mak]

2008-10-15T07:06:40.437422Z Ken Sharp

Revision 9154 accidentally left a temporary C++ style comment in place.

[psi/zicc.c]

2008-10-15T04:51:30.597312Z Michael Vrhel

Fix for bug 689961.

There was a problem with the testing to determine if a color space mapping was linear within a triangle and along a line.  The old code assumed the number of components was the same in the client and device color space.  In general this is not true, especially if we have a DeviceN color space with one color and a CMYK output device, which was the test case given.  

[base/gscspace.c]

2008-10-15T01:32:43.847670Z Ralph Giles

Exclude local repository files from other version control systems
from clusterpush.

[toolbin/clusterpush.sh]

2008-10-15T01:32:39.731625Z Ralph Giles

Read git commit names if an svn revision number isn't available.

[toolbin/clusterpush.sh]

2008-10-15T01:32:33.815878Z Ralph Giles

Update the clusterpush script for the new source locations.

Previously we copied the baseline from the last ghostpcl run on the
cluster, but since the ghostpdl tree moved to the public repository it
runs in an updating directory like gs.

Also, compare return codes numerically instead of as a string.

[toolbin/clusterpush.sh]

2008-10-14T18:27:24.066580Z Ken Sharp

Fix (PS interpreter): .seticcspace leaving operand on stack.

Details:
Bug #690039 "failure to read ICC profiles generated by  
Adobe Photoshop Version 7 and 9".

ICC profiles in PostScript comments are handled by the comment 
parsing code in gs_icc.ps, using the .seticcspace operator. After
the recent change to handle colour in 'C' rather than PostScript,
the .seticcspace operator was not removing its argument from the 
operand stack.

This led to the comment processing for other purposes (specifically
pdfwrite in this case) generating errors, as the stack had been disturbed.

Altered the 'seticc' routine (called by .seticcspace) to remove the
operand from the stack. Also required altering the C colour processing
to increment the operand stack and pass the operand that way, when 
calling seticc for PDF interpretation.

[psi/zcolor.c psi/zicc.c]

2008-10-13T21:03:48.526048Z Till Kamppeter

Make Duplex with the "pxlcolor" and "pxlmono" drivers work (standard command line options "-dDuplex" and "-dTumble").

[base/gdevpx.c]

2008-10-12T06:38:18.212672Z Alex Cherepanov

Remove spurious un-definition of GlobalSubrs attribute during loading of
OpenType CFF fonts as CIDFont resources. Bug 690113, customer 1110.

[Resource/Init/gs_cff.ps]

2008-10-10T08:51:42.858031Z Ken Sharp

The update for opdfread.ps in revision 8706 missed a required routine 'putu32'.

Details:
putu32, used to update the offsets of TrueType tables in the TrueType header, uses
putu16, which was accidentally omitted. This (oddly) didn't seem to cause a problem with
testing but did for the customer. Added the missing routine.

[Resource/Init/opdfread.ps]

2008-10-09T19:48:14.487705Z Alex Cherepanov

Scale widget annotations in x and y directions to fit the BBox of the
appearance stream into the annotation rectangle. Old code considered
y direction only. Bug 690109.

DETAILS:
This implementation is mainly based on the experiments with AR5.

[Resource/Init/pdf_draw.ps]

2008-10-09T17:53:10.358436Z Ray Johnston

Increase stack size to allow GS to run on older NT versions. Thanks to Alex
for pointing this out.

[psi/dw32c.def]

2008-10-08T15:03:58.878575Z Ray Johnston

Increase stack size to allow GS to run on older NT versions. Thanks to Alex
for pointing this out.

[psi/dwmain32.def]

2008-10-08T13:40:55.237034Z Ken Sharp

Log:
Fix: ps2write. Very large TrueType fonts (>64Kb), when converted to Type 42
fonts for use in PostScript, must contain an /sfnts entry, which is an
array of strings comprising the TT font. There are restrictions on where
the original data is split to form the strings, which ps2write was not
honouring.

DETAILS:
Bug #690044 "Printer error (49,4C02) with ps2write output"
Bug #690012 "Error with ps2write output ps file when Unicode font is used"
Bug #690030 "Issue with NeverEmbed flag with ps2write device for some of the fonts"

There are five changes made to opdfread.ps in order to fix these problems:

1) The VM allocation mode used by opdfread is now local throughout, where 
   previously it was global. Judging by the number of local hacks, this 
   has frequently caused problems in the past.

2) There was a problem if a Font Descriptor contained neither a FontFile
   nor a FontFile2 entry. This was due to not embedding fonts, but caused
   the code to enter an infinte loop looking for one or the other.

3) After encountering the 'xref' in the PDF file, the code simply
   flushed the input file. This could potentially cause a problem if the
   EOF was not signalled back to the interpreter. This was theorised to
   be one of the issues, and fixed in passing, even though it was not
   in fact causing a problem.

4) The sfnts array is now built up from strings which follow the rules
   laid out in the Type 42 Font Format specification (tech note 5012)
   In particular the glyf table is now split on glyph boundaries. This
   only seems to cause problems for Adobe interpreters.

5) The 'post' table processing was modified to use an array of strings
   instead of a single string, if the table was >64Kb.

[Resource/Init/opdfread.ps]

2008-10-08T07:43:52.342922Z Igor Melichev

TT fonts : An initial implementation of GSUB.

DETAILS :

This is a partial fix for bug 689304  
"improper handling of vertical japanese text".
It works for brackets and punctuation signs orientation
when a vertical CJK text is painted with an 
Open Type font that defines a GSUB table.

The curent implementation always chooses a Format 1 
substitution table that substitutes single glyphs to single glyphs.
It doesn't account LangSys and feature tables.
Such logic is owned from the CJK patch attached to the bug 689304.
It may need further improvements.

Opposite to CJK group we implement it in C to allow
to it to work for other interpreters besides Postscript.

Interpreters may need to add an explicit call to 
the new function gs_type42_substitute_glyph_index_vertical
to involve the new functionality. This happens due to
a compatibility to PS interpreter that needs to call
the new function from the interpreter code rather than from
the graphics library.

See comments in code for more details.

[psi/zchar42.c base/gxfont42.h base/gstype42.c Resource/Init/gs_ttf.ps]

2008-10-08T05:56:27.963219Z Ray Johnston

Fix Windows stack overflow when NumRenderingThreads > 0. This was identified
during testing for bug 690108 (see comments, #1 and #2). This is a work around
as it does not address the excessive stack usage, but does work around the
problem by throwing memory at it. Bug 690198.

[base/gp_wsync.c]

2008-10-07T20:05:58.844384Z Ray Johnston

Restore function of NumRenderingThreads > 0 that was inadvertently disabled
by previous commit to this module.

DETAILS:
The segfault was fixed by making sure that the clist structure was initialized
as a 'reader', but this included setting ymin=0, which meant that the following
test for crdev->render_threads == NULL always reverted to single threaded
rendering.

Note that this also will return the error if "clist_close_writer_and_init_reader"
returns an error value (<0), which is consistent with the behavior of the
clist_get_bite_rectangle function (NumRenderingThreads==0).

[base/gxclthrd.c]

2008-10-05T17:51:25.414873Z Ray Johnston

Fix SEGV when NumRenderingThreads > 0 caused by improper clist reader phase
initialization. Bug #690108.

DETAILS:
Make sure that the clsit device is initialized to 'reader' mode before checking
the 'render_threads' element of the reader device. Prevents a SEGV when the
corresponding element of the 'writer' device structure was non-zero at the end
of the page since the render_threads table will not have been allocated and
some other (invalid) pointer would be used instead.

[base/gxclread.c base/gxclthrd.c]

2008-10-02T19:33:22.695690Z Ralph Giles

Move psromfs.mak to the interpreter source tree.

This file defines variables used by lib.mak, but the resources are all 
related to the ps interpreter, so it makes more sense to keep it there.
It is only included by top-level makefiles, so this doesn't violate
the dependency boundary.

[psi/os2.mak base/bcwin32.mak base/ugcclib.mak base/psromfs.mak psi/psromfs.mak base/macosx.mak base/watcw32.mak base/Makefile.in base/unix-gcc.mak base/unixansi.mak ijs/unix.mak psi/msvc32.mak base/macos-mcp.mak]

2008-09-30T19:01:35.905183Z Ray Johnston

Clean up a few coverity gripes (nothing important)

[base/gxclthrd.c]

2008-09-27T01:39:36.090759Z Alex Cherepanov

Set the temporary value of PDFDEBUG flag using 'gput' procedure instead of
'def' because initial PDF graphic state is represented by a read-only
dictionary. Bug 690088.

[Resource/Init/pdf_base.ps]

2008-09-25T23:48:03.662203Z Alex Cherepanov

Process invalid PDF operator QBT as Q BT .
Bug 690089, customer 384.

[Resource/Init/pdf_draw.ps]

2008-09-25T13:36:55.133901Z Igor Melichev

Fix (printer devices) : Allow retries for raster buffer allocation when BufferSpace is default.

DETAILS :

Bug 690055 "seg fault at higher resolutions". 

1. The old code implements a branch with increasing the buffer space
when a clist writer initialization fails with limitcheck and
the buffer size is default.
However the clist writer initialization never returns limitcheck,
it does return rangecheck instead. I guess the bug is in the
retry condition so I change it to rangecheck.

2. When the buffer space size is not default,
the old code crashes while setpagedevice,
if the device was opened. The clist initialization
returns with an inconsistent clist writer state 
and the device still has is_open flag set.
The new code resets is_open if the clist writer initialization
fails while setpagedevice.    

Thanks to Ray for participation.


[base/gxclist.c base/gdevprn.c]

2008-09-25T10:10:03.369546Z Igor Melichev

Fix (clist writer) : Wrong compositor cropping when a shading is entirely clipped out.

DETAILS :

Bug 690078 "clist error in fts_41xx.xps and fts_39xx.xps".

clist_fill_path implements a special processing of a clipping path for shadings.
It falls back to gx_default_fill_path, which accounts both filling path and clipping patch.
Doing so, gx_default_fill_path passes the clipping path to the clist writer
as a high level object with calling clist_fill_path with a NULL color.

However the 2 calls to clist_fill_path differently processed the
case of the empty clipping : the first call did not return immediately
and restored the compositor cropping interval after returning from gx_default_fill_path, 
but the second call does return immediately and did not save the interval before
the clipping path is written. Thus the interval was restored to a wrong state 
that occasionally left from a preceeding filling operation.

This patch moves the check for empty clipping ahead the main
processing in clist_fill_path, so that the 2 calls do same thing
about the skipping of an empty clipping.

[base/gxclpath.c]

2008-09-24T11:07:46.268855Z Ralph Giles

Initial support for aes decryption streams.

Details:

This adds an AESDecode filter to the interpreter which wraps the
new aes stream implementation.

[psi/zfaes.c psi/int.mak]

2008-09-24T11:07:43.989804Z Ralph Giles

Initial support for aes decryption streams.

Details:

This adds support for compiling the xyssl aes implementation added
in r8870, and a stream library wrapper which calls it.

Note that while an s_aes_set_key() procedure is provided to set a
key in an allocated stream state, it merely stores the key, and the
actual allocation of the aes_context structure and initialization
with the key happen the first time the stream's process() method is
called.

This is because a typical call to filter_read() in the interpreter
binding will end up memcpy()ing this to its own separately allocated
stream state. This preserves any static initialization performed by
the caller, such as passing in the key, but the xyssl aes_context
structure includes an internal pointer, and this is not updated when
the state is copied.

The internal pointer provides an indirect reference to support optional
storage of the sbox in secure memory. We're not using this feature, so
we could remove it, or update the pointer ourselves when our process()
method is first called. However, working around the issue by delaying
all opaque initialization until the stream is working is more robust.

[base/saes.c base/lib.mak base/saes.h]

2008-09-23T18:57:30.153977Z Igor Melichev

Fix (PS interpreter) : Incorrect data in garbager descriptor for reusable stream state.

DETAILS :

The bug was introduced in rev 8810.
It defines a wrong offset for a relocating pointer.
The reason is an inaccurate copy-and-replace coding.
Fortunately the offset pointed to a static data pointer,
which the garbager filtered out with an error message.

[psi/zfrsd.c]

2008-09-22T10:56:52.199700Z Ken Sharp

Remove a number of no longer required includes from the source, and update the makefile to remove the dependencies.

Local regression testing shows no differences, local builds correctly generate executable.

[base/gdevpdfm.c base/gdevpsdp.c base/gdevpdt.c base/gdevpdfo.c base/gdevpdf.c base/gdevpsdu.c base/gdevpdfd.c base/gdevpdfu.c base/gdevpdfv.c base/gdevpsdi.c base/gdevpdfg.c base/devs.mak]

2008-09-19T23:31:25.043936Z Ralph Giles

Fix a double fclose().

fuzzy_diff_images() doesn't open the files it reads from, so it should
not close them when cleaning up. The caller takes care of this on line
764, right after calling fuzzy_diff_images().

[toolbin/tests/fuzzy.c]

2008-09-19T21:45:10.190751Z Ralph Giles

Correct two typos in error message strings.

[toolbin/tests/fuzzy.c]

2008-09-19T21:45:09.139047Z Ralph Giles

Move the freport initizialization out of fuzzy_diff_images() to silence
a gcc uninitialized variable warning.

[toolbin/tests/fuzzy.c]

2008-09-19T21:45:08.203062Z Ralph Giles

Remove trailing whitespace.

[toolbin/tests/fuzzy.c]

2008-09-19T21:45:06.338528Z Ralph Giles

Fix a gcc warning. Bug 690054.

Details:

The gs_note_error() macro can't be called like a normal function. In
non-debug builds it reduces to its argument, generating an empty
statement. Placing it after a return or on the right hand side of an
assignment prevents this warning.

[base/gdev8510.c]

2008-09-19T16:22:32.262870Z Ralph Giles

Include our math_.h wrapper instead of math.h.

Details:

We have header_.h wrappers for most system headers which include various 
platform-specific #ifdef trees to ensure the symbols we use are defined.

Except for some of the bootstrap code, these wrappers should always be 
used instead of the system headers.

[psi/zcolor.c psi/int.mak]

2008-09-19T16:08:02.308202Z Ralph Giles

Also remove gscolor1.h from the zcolor.c dependency list.

[psi/int.mak]

2008-09-19T13:44:55.520555Z Ken Sharp

Remove gscolor1.h. We no longer use gs_setcmykcolor here and so this header is not required.

[psi/zcolor.c]

2008-09-19T00:01:51.675092Z Ralph Giles

Use a portable path separator in gs.mak.

[base/gs.mak]

2008-09-18T23:55:26.486186Z Ralph Giles

Remove a spurious $(_I) and add use portable $(D_)...$(_D) for defines
as needed by the openvms build. Bug 690084.

[base/libpng.mak base/devs.mak]

2008-09-18T23:50:07.487730Z Ralph Giles

Fix typos in third-party library paths introduced in r6514. Bug 690084.

[base/openvms.mmk]

2008-09-18T23:31:16.150062Z Ralph Giles

Additional leading space characters before colons in makefiles. Bug 690084.

[base/lib.mak contrib/contrib.mak]

2008-09-18T20:32:08.326447Z Ralph Giles

Space makefile colons for the benefit of VMS. Bug 690084.

OpenVMS supports a basic makefile syntax, but requires a space on both 
sides of the dependency colon. We try to maintain this in our 
cross-platform makefiles. 

[contrib/contrib.mak base/contrib.mak base/devs.mak]

2008-09-18T18:23:22.617130Z Ralph Giles

Move time_.h to the top of the include list.

[base/mkromfs.c]

2008-09-18T00:37:45.093298Z Ralph Giles

The SunPro compiler doesn't handle variable length arrays in structs.

Bug 689079. Patch from Jon Peatfield.

[contrib/opvp/opvp.h]

2008-09-18T00:37:43.189925Z Ralph Giles

Clean up whitespace in the opvp device source.

[contrib/opvp/opvp.h contrib/opvp/gdevopvp.c]

2008-09-18T00:37:41.259902Z Ralph Giles

Fix: default to MITER line joins in the opvp device. Bug 689079.

The previous default was BUTT, which is a line cap, not a join. This
looks like it was a cut-and-paste error. Patch from Jon Peatfield.

[contrib/opvp/gdevopvp.c]

2008-09-18T00:37:38.655050Z Ralph Giles

Fix: don't treat char as unsigned in the opvp device. Bug 690079.

[contrib/opvp/gdevopvp.c]

2008-09-18T00:12:11.086491Z Ralph Giles

Enable jasper assembly optimizations with _MSC_VER instead of _WIN32 so the MSVC-specific inline code won't be passed to gcc in mingw builds.

Bug 690070.

[jasper/src/libjasper/jpc/jpc_qmfb.c]

2008-09-16T00:29:06.813229Z Ralph Giles

Remove an inadvertent semicolon in gs_throw_code, added in r9037.

[base/gserror.h]

2008-09-14T12:20:56.043501Z Alex Cherepanov

Allocate missing FontInfo dictionary in a matching global or local memory and
use .forceput to override read-only status of the font directory. Bug 690063.

[Resource/Init/pdf_font.ps]

2008-09-13T20:22:25.237944Z Ralph Giles

Move the dxmain.c and dxmainc.c front ends to the interpreter source 
directory.

[base/dxmain.c psi/dxmain.c base/unix-dll.mak base/dxmainc.c psi/dxmainc.c]

2008-09-12T08:05:54.684727Z Ken Sharp

The CIEBasedDEF/DEFG colour space validation did not insist that the dictionary contain a
/Table entry, which is a required entry. It also did not limit the numeric values in the
/Table array to integers, reals are not allowed.

[psi/zcolor.c]

2008-09-11T16:03:58.760444Z Ray Johnston

Add support for passing the requested number of copies through to the PXL
output file. Tested on an actual HP printer.

[base/gdevpx.c]

2008-09-10T21:35:24.802228Z Ralph Giles

Change two more printf(%x) uses with pointers to use %p.

Update copyright.

[base/gxclmem.c]

2008-09-10T21:33:26.724052Z Ray Johnston

Replace non-standard %P with %p for pointer printing.

[base/gxclmem.c]

2008-09-09T21:00:54.348833Z Ralph Giles

Ask gcc to warn about declarations beyond the start of a block.

[base/configure.ac]

2008-09-09T20:31:37.982033Z Ralph Giles

Move variable declarations to the top of blocks in the fontconfig 
support code.

Also fixes a gcc warning about passing int 0 instead of NULL to 
terminate an argument list.

[base/gp_unix.c]

2008-09-09T18:45:27.627887Z Ralph Giles

Add a space to the product name between the family and release names.

[base/gscdef.c]

2008-09-09T17:48:26.542519Z Ralph Giles

Move some interpreter headers from base to psi.

These were missed in the original merge of the reorganization patch.
Also, add missing makefile dependencies for these new headers.

[base/zcolor.h base/zicc.h psi/zcolor.h psi/zicc.h base/zcie.h psi/zcie.h psi/int.mak]

2008-09-09T14:33:31.847337Z Ken Sharp

Henry's coverage test revealed that a couple of 'belt and braces' checks in the RGB->HSB
conversion were impossible to trigger. Removed those checks.

[psi/zcolor.c]

2008-09-06T09:57:38.114441Z Ken Sharp

Address some more issues raised by Coverity. Check return values in some places which were
not previously checked, initialise some variables, and remove some dead code.

Local regression testing of pdfwrite shows no differences.

[base/gdevpdtd.c base/gdevpdtt.c base/gdevpdte.c base/gdevpdtf.c base/gdevpdfe.c base/gdevpdtw.c base/gdevpdti.c]

2008-09-04T15:46:56.923276Z Igor Melichev

Fix : Divide gdevp14.c into 2 modules.

DETAILS :

This change is syntactically equivalent.
The purpose is to minimize dependencies between projects.
The new module gxblend1.c keeps color blending algorithms moved from gdevp14.

[base/gdevp14.c base/lib.mak base/gdevp14.h base/gxblend.c base/gxblend1.c base/gdevdevn.h base/gxblend.h]

2008-09-04T14:06:17.707413Z Igor Melichev

Fix (graphics) : Preovide a right check for incorrect call to pdf14_pop_transparency_group.
 
DETAILS :

This patch doesn't change behavior with regular runs.
In hypothetic cases, when .entransparencygroup is called with no
L
due to unreferencin null pointer.

[base/gdevp14.c]

2008-09-04T10:05:54.831940Z Ken Sharp

More minor issues reported by Coverity. An unchecked return code from cos_dict_find_c_key,
and some dead code.

[base/gdevpdfm.c]

2008-09-04T10:04:10.193139Z Ken Sharp

A couple of issues detected by Coverity. Firstly an error condition could lead to a file being
left open. Secondly a call to pdf_restore_viewer_state which didn't check the return value.

[base/gdevpdfu.c]

2008-09-04T10:02:04.794387Z Ken Sharp

More very minor dead code removal, again as noted by Coverity.

[base/gdevpdtb.c]

2008-09-04T10:01:12.562540Z Ken Sharp

Remove some dead code from cmap handling, as noted by Coverity.

[base/gdevpdtc.c]

2008-09-04T09:59:11.733313Z Ken Sharp

Check the return code from pdf_write_resource_objects when closing a page. Fixes Coverity
warning.

[base/gdevpdf.c]

2008-09-03T20:49:13.486158Z Ray Johnston

Add protection for the "finish" exit point for potential (no longer exists
since rev 9062) case when f==NULL when code >= 0. Belt and suspenders couldn't
hurt to improve maintainability (prevent future problems). Original problem
reported by Coverity analysis.

[base/gxclmem.c]

2008-09-03T12:20:27.869178Z Igor Melichev

Fix : gcc compiler warnings (continued).

DETAILS :

Repair a file broken due to Far 1.70 editor glitch on Vista.

[psi/zfunc4.c]

2008-09-03T11:42:35.783010Z Igor Melichev

Fix : gcc compiler warnings.

DETAILS :

This patch fixes only those ones which either were approved or belong to my ownership.

[base/gxclread.c base/gxpcopy.c base/gxclpage.c psi/zfunc4.c base/gxclutil.c base/gxclmem.c base/lib.mak base/gxiscale.c base/gxclmem.h base/gdevpdtd.c psi/int.mak psi/zfsample.c base/gdevpdte.c base/gximage1.c base/gsovrc.c base/gdevprn.c base/gxstroke.c psi/zfunc.c base/gspath1.c base/gxshade6.c psi/zfrsd.c base/gxclpath.c psi/zfunc.h psi/igcstr.c base/mkromfs.c base/gstype42.c base/gdevdsha.c base/gxfill.c base/gxclrast.c]

2008-09-02T18:37:07.959806Z Till Kamppeter

Fixed small bug in the patch to add a PJL command for setting the resolution to
the pxlmono/pxlcolor drivers (rev 9060).

[base/gdevpxut.c]

2008-09-02T09:06:41.787945Z Till Kamppeter

Let pxlmono/pxlcolor drivers add resolution setting to the PJL header. Printers need the PJL command to set the resolution (see bug 689230). Now the printing resolution can be easily controlled with the "-r" command line option.

[base/gdevpxut.c]

2008-09-01T17:03:20.988497Z Alex Cherepanov

Fix incorrect error code test in the calculator function validation
procedure.

[psi/zfunc4.c]

2008-09-01T16:53:43.689721Z Ken Sharp

Resolve another gcc compiler warning. The test was incorrect, now it is correctly taking the
text render mode into account.

Local regression testing shows no differences.

[base/gdevpdts.c]

2008-09-01T08:49:44.722693Z Ken Sharp

Fix a warning from older versions of gcc. Spotted by Russell Lang when doing OS/2 build. 
Oddly, newer versions of gcc don't spot this, even though the code was technically
redundant.

Also remove some commented out code that should not have been present, and fix a couple
of warnings produced by recent versions of gcc regarding unused local variables and code.

Local regression testing exhibits no differences.

[base/gdevpdtt.c]

2008-08-31T00:28:20.047781Z Russell Lang

Add a makefile target for a Windows source zip file, 
used in building a release.

[psi/winint.mak]

2008-08-30T23:23:04.017387Z Alex Cherepanov

Make PDF interpreter run our /Install procedure after the user's procedure
because: (1) PDF interpreter caches the CTM, (2) the user's procedure may
replace CTM by calling setmatrix. Bug 689914, customer 770.

[Resource/Init/pdf_main.ps]

2008-08-30T14:07:29.736170Z Igor Melichev

Fix (PS interpreter) : Wrong dependencies in makefile.

[psi/int.mak]

2008-08-30T13:38:27.563236Z Russell Lang

Fix gcc warning on OS/2.

[base/gdevdsp.c]

2008-08-30T13:31:29.235544Z Russell Lang

Fix the OS/2 build after the source reorganization.
Remove the os2pm device and the old DLL interface for OS/2, 
to avoid direct links from the graphics library into the 
PS interpreter.

[base/gp_os2.c base/os2.mak psi/dpmain.c psi/gsos2.def base/gsos2.icx doc/Develop.htm psi/gsos2.rc base/pcwin.mak base/dpmain.c base/gsos2.def psi/os2.mak base/mkromfs.c base/gsos2.rc psi/gsdllos2.h psi/gsos2.icx base/gp_os2fs.c base/gdevpm.c psi/gsdll2.def base/devs.mak]

2008-08-29T19:47:13.384972Z Ralph Giles

Update the Visual Studio project file generator for
the new source locations. Untested.

[toolbin/msvcxml.bat]

2008-08-29T18:46:21.860372Z Ralph Giles

Split the source tree into two new directories.

PSSRC files are now in 'gs/psi'.
GLSRC files are now in 'gs/base'.

This is to facilitate build modularization and merging in the ghostpdl 
tree.

NOTE: msvc32.mak is now in psi, not src.

[/trunk/ghostpdl/language_switch/pspcl6_msvc.mak /trunk/ghostpdl/main/pcl6_gcc.mak src /trunk/ghostpdl/tools/check_deps.py doc/Develop.htm psi /trunk/ghostpdl/svg/svg_gcc.mak /trunk/ghostpdl/xps/xps_msvc.mak /trunk/ghostpdl/main/pcl6_msvc.mak /trunk/ghostpdl/doc/ghostpdl.tex /trunk/ghostpdl/psi/psitop.c doc/API.htm doc/Issues.htm /trunk/ghostpdl/svg/svg_msvc.mak /trunk/ghostpdl/language_switch/pspcl6_gcc.mak doc/Make.htm doc/Drivers.htm base autogen.sh doc/Release.htm doc/C-style.htm /trunk/ghostpdl/doc/ghostpdl.txt /trunk/ghostpdl/xps/xps_gcc.mak]

2008-08-28T19:47:00.816950Z Ralph Giles

Replace 3d with 3rd in the documentation and regularize '3(r)d party' as 
'third-party'. Bug 690004.

[doc/Use.htm doc/Lib.htm]

2008-08-28T02:40:07.463083Z Ralph Giles

Use the new gs_rethrow_code() macro in svgwrite.

[src/gdevsvg.c]

2008-08-28T02:40:06.379728Z Ralph Giles

Add gs_throw_code() and gs_rethrow_code() macros for use in situations
where the normal error string does not fit or is redundant.

[src/gserror.h]

2008-08-28T02:40:04.423296Z Ralph Giles

Fix some code style issues in the svgwrite device.

We can't use gs_note_error() as we were because it returns the error
code which generates an empty statement warning with gcc. Use gs_throw()
instead for now.

[src/gdevsvg.c]

2008-08-28T00:36:33.257400Z Ralph Giles

Update warnings policy; we agreed to fix all warnings.

[doc/C-style.htm]

2008-08-28T00:03:40.520992Z Ralph Giles

Document the motivation for a source style item.

Details:

There has been some controvesy over the rule that single-statement 
bodies of control structs must be on their own line. Specifically:

  if (code < 0)
    return code;

instad of:

  if (code < 0) return code;

despite the latter being less obtrusive for common error checks.

Several developers have requested this because it allows setting a 
breakpoint directly on the return statement instead of a conditional 
return on the conditional line, or a breakpoint at the return inside
the single source line. This is therefore a practical issue, not just
one of readability and style.

[doc/C-style.htm]

2008-08-27T17:27:24.986727Z Ralph Giles

Fix more html conformance problems with the documentation.

[doc/Ps2ps2.htm doc/Fonts.htm doc/Use.htm doc/Ps2pdf.htm doc/Develop.htm doc/Deprecated.htm doc/Install.htm doc/API.htm doc/Issues.htm doc/Make.htm doc/Drivers.htm doc/Release.htm doc/C-style.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm]

2008-08-27T02:57:23.718740Z Ralph Giles

Remove Humor.htm.

The joke has gotten old, and blogs are a better medium for this sort of 
thing.

[doc/Humor.htm doc/Readme.htm]

2008-08-27T02:16:43.113337Z Ralph Giles

Remove the obsolete HTML style guidelines.

We no longer expect readers to look at the raw html in a text editor. 
Documentation should declare its format specification and conform to it, 
attempting to match local style where appropriate.

[doc/Htmstyle.htm doc/Readme.htm]

2008-08-27T02:14:10.447789Z Ralph Giles

Replace the awkward <b><tt> construction with css-styled <code> elements.

[doc/History7.htm doc/Fonts.htm doc/Projects.htm doc/Ps2ps2.htm doc/Use.htm doc/Readme.htm doc/Develop.htm doc/Ps2pdf.htm doc/Deprecated.htm doc/Source.htm doc/Helpers.htm doc/Psfiles.htm doc/Lib.htm doc/Install.htm doc/Htmstyle.htm doc/API.htm doc/gs.css doc/DLL.htm doc/Make.htm doc/Drivers.htm doc/Unix-lpr.htm doc/Commprod.htm doc/C-style.htm doc/Ps-style.htm doc/Release.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm doc/Ps2epsi.htm]

2008-08-26T21:50:26.926408Z Ralph Giles

Cast away signed/unsigned char warnings in gdevsvg.

Patch from Igor Melichev. Also cleaned up some trailing whitespace.

[src/gdevsvg.c]

2008-08-26T21:40:55.546109Z Ralph Giles

Remove references to bits64 from the source style documentation. It is 
superceeded by the stdint types.

[doc/C-style.htm]

2008-08-26T15:59:38.718117Z Igor Melichev

Fix (PDF interpreter) : Implementing a temporary option for development needs of images with soft mask. 

DETAILS :

It doesn't chamge the behavior for regular runs.
The new temporary option is for development purpose only.
It will be removed after the complete implementation of images with soft mask is done.

[Resource/Init/pdf_draw.ps]

2008-08-26T15:31:03.416051Z Igor Melichev

Fix (PDF interpreter) : A wrong comment about procedure operands for is_big_mask .

DETAILS :

It changes a comment only.

[Resource/Init/pdf_draw.ps]

2008-08-26T07:02:55.610521Z Igor Melichev

Fix (graphics) : Scanline algorithm missed pixels at horizontal boundaries.

DETAILS :

Bug 689402 "Regression: differences in dina3_watermark.pdf".

The defect looks as an unimplemented branch.
which persists since Ghostscript 8.00 released on Decebmer 2002
or longer. We could get a similar problem when runnung Bug687832.pdf
with Ghostscript 7.04 (it can't handle dina3_watermark.pdf),
and our reading of its code shows that the problem presents in it.
So the problem is really antique.
 
The bottom of the problem is that fill adjustment was not applied 
to some horizontal segments. Due to that some pixel centers are not covered 
when they must be.

[src/gxfillsl.h]

2008-08-23T16:39:21.950258Z Alex Cherepanov

Fix 6 Coverity warings about local variables hiding function arguments
by renaming local variables.

[src/gsbitops.c]

2008-08-23T01:05:47.610764Z Russell Lang

Remove reference from Windows image window code back to PostScript interpreter,
to allow the image window code to be used with non-interpreter builds.

[src/dwimg.h src/winint.mak src/dwmain.c src/dwmain.rc doc/Develop.htm src/dwmainc.c src/dwmain.h src/dwimg.c src/dwres.h]

2008-08-22T16:34:36.763761Z Ralph Giles

Move the dw source files from GLSRC to PSSRC. Items in GLSRC shouldn't 
depend on items in PSSRC. This is in preparation for the code 
reorganization.

Details:

A number of these files, dwtext, dwtrace, and with some modifications 
dwimg don't actually have PSSRC dependencies, but it's easier to keep 
all the files built by winint.mak there for now. They can be moved back
into the base library later when they're useful for other builds.

[src/winint.mak]

2008-08-22T01:13:28.560292Z Ralph Giles

Remove an unnecesary iapi.h include.

[src/winint.mak src/dwimg.c]

2008-08-22T01:11:24.167807Z Ralph Giles

Remove trailing whitespace.

[src/dwimg.h src/dwimg.c]

2008-08-21T23:26:24.907412Z Ralph Giles

Add a missing return value check. Coverity issue 1847.

[src/zcolor.c]

2008-08-21T22:55:00.562927Z Ralph Giles

Correct a double free introduced in r9005.

[src/gp_unix_cache.c]

2008-08-21T21:51:24.194924Z Ralph Giles

Remove trailing whitespace.

[src/ztrans.c]

2008-08-21T08:35:09.363063Z Ken Sharp

Submission for revision 9008 initialised the wrong 'pfn' variable. 

Details:
Accidentally changed the use in 'zbuildfunction' instead of 'buildfunction'. Correcting.

[src/zfunc.c]

2008-08-21T08:33:31.319105Z Ken Sharp

Fix some more Coverity warnings

Details:
Two places where a return value (from names_ref) was not being checked, one inadvertent
piece of dead code (duplicating a previous error check) and one genuine case of a variable
which could potentially be used uninitialsed.

[src/zcolor.c]

2008-08-21T08:28:49.451522Z Ken Sharp

Silence an 'uninitialised variable' warning from Coverity.

Details:
Function initialisation is a bit round about. We pass a function pointer to
make_sampled_function, which assigns it to a local variable. That variable is passed to
gs_function_Sd_init, which immediately zeros it....

Since the pointer is never actually used, setting it to NULL should silence the warning.

[src/zfunc.c]

2008-08-20T23:58:43.536642Z Ralph Giles

Replace an abs() call with our any_abs() macro. Also remove an 
unnecessary math_.h include.

Details:

A call to abs() was added in r8942. Technically the prototype for this 
is in stdlib.h, but it's a built-in in most compilers so this didn't 
raise a warning. We do include stdlib.h elsewhere, usually for qsort() 
or malloc(), but abs() is only called from comment pseudo code; in 
practice the any_abs() macro or fabs() from math.h are used instead.
Because this isn't in an inner loop, speed isn't important, so we prefer 
the macro to a system header include for consistency.

Sine the beginning of repository history, gdevbit.c has included math.h, 
but I don't see any math library calls now, so it as been removed.

[src/gdevbit.c src/devs.mak]

2008-08-20T23:22:49.144680Z Ralph Giles

Check for and propagate failures to find matching component indexes in 
jpx streams.

[src/sjpx.c]

2008-08-20T22:09:49.649774Z Ralph Giles

Further cleanups to the unix persistent cache error handling.

[src/gp_unix_cache.c]

2008-08-20T21:32:28.795836Z Ralph Giles

Fix memory and file handle leaks in the unix persistent cache error 
handling. Also document that it is not re-entrant.

[src/gp_unix_cache.c]

2008-08-20T19:46:20.907096Z Ralph Giles

Remove trailing whitespace.

[src/gp_unix_cache.c]

2008-08-20T19:09:44.615235Z Ralph Giles

Add a cast in svgwrite to be explicit that we're only using the lower 24 
bits of the color index.

[src/gdevsvg.c]

2008-08-20T18:26:10.369143Z Ralph Giles

Fix __func__ on the default (non-C99) gcc build.

Details:

__func__ is a variable in C99. The earlier __FUNCTION__ is a magic 
preproccessor define in MSVC 7 and later, so the #if defined() clause 
enabled it. However, in GCC it is a magic string literal instead and so 
this clause did not enable it. Therefore we add an explicit check for 
the appropriate GCC version and define the same substitution for that 
compiler.

[src/gserror.h]

2008-08-20T01:54:36.820847Z Ralph Giles

Add the svgwrite device to the default windows build.
Bug 690028.

[src/msvc32.mak]

2008-08-19T04:07:40.862102Z Ralph Giles

Remove the jasper dependency from jpxtopdf. It's straightforward to 
parse the image header ourselves.

[toolbin/jpxtopdf.c]

2008-08-17T12:31:25.491176Z Alex Cherepanov

Fix a bug in error checking code introduced in the rev. 8996 in pamcmyk32
device. Bug 689583.

[src/gdevpbm.c]

2008-08-17T06:19:35.130662Z Alex Cherepanov

Check return values from all stdio functions in all pnm drivers and propagate
error codes upwards. Bug 689583.

[src/gdevpbm.c]

2008-08-17T01:19:23.099945Z Alex Cherepanov

Add one more NMAKE version recognized as MSVC 7.
Bug 689816, customer 351.

[src/msvc32.mak]

2008-08-16T04:18:20.474141Z Alex Cherepanov

Work around a bug in a PDF file produced by "Nitro PDF Driver". Assume invalid
operator '-' to be a number 0. Bug 690012, 

[Resource/Init/pdf_main.ps]

2008-08-16T02:00:51.387588Z Alex Cherepanov

Fix parsing of large embedded TrueType fonts by ps2write header: (1) read the
file into multiple strings for sfnts array. (2) use multiple reads to skip
over large parts of the file. Also modify Type42 font reader to allow TrueType
objects to span sfnts string boundaries. Bug 690012.

[src/gxttfb.c Resource/Init/opdfread.ps]

2008-08-14T17:54:06.399403Z Alex Cherepanov

Use GNU iconv.h header in compatibility mode unless we link with GNU libiconv.
This is needed for compiling gs with gcc under HP-UX 11.11.

DETAILS:
gdevopvp.c uses some basic functionality from iconv library but none of GNU
extensions. So the native implementation is searched first.

GNU header uses different names in the library and defines some macros to map
iconv* names to GNU libiconv* names.

gcc looks for GNU version of iconv.h first, which requires a compatibility
flag to link with the native libraries.

So the compatibility flag is set when iconv* functions are not found but
libiconv* functions are found.

[src/configure.ac contrib/opvp/gdevopvp.c]

2008-08-13T01:56:36.856132Z Ray Johnston

Update the fonts to those that the nightly and cluster regressions have
been using all along. The -Ifonts in the regression script was causing
the contents of Resource/Font to be ignored. These fonts are the std-8.11
version.

Note we probably next need to move to the newer version of these fonts
with the metrics fixed, but this is a first step.

DETAILS:
These are files that were part of the distribution 8.11 files that really
can't live in the Resource/Font directory since some applications or
test files will enumerate (with 'resourceforall') the directory and will
get errors if files are there that are not fonts.
___________________________________________________________________________
				README:
This is release 1.0.7pre22 of Valek Filippov's improved versions of the URW
type 1 font collection, repackaged for distribution with Ghostscript.

Cyrillized free URW fonts.

These fonts were made from the free URW fonts distributed with ghostcript.
There are NO changes in the latin part of them (I hope).
Cyrillic glyphs were added by copying suitable latin ones
and painting oulines of unique cyrillic glyphs in same style as the others.
For all modification pfaedit was used.
The license for result is (of course) same as for original fonts,
i.e. GPL with an exception that you can put these fonts in your own non-GPLed
documents. (Looks like LGPL from my point of view =).

The "sources" of these fonts in the native pfaedit format are available
at ftp://ftp.gnome.ru/fonts/sources

The great font editor pfaedit is available at http://pfaedit.sf.net.
That page also includes some links to fonts created by
George Williams -- the author of pfaedit.

Acknowledgements:
I would like to thank George Williams, the pfaedit's author and developer.
He is the most bug-reporter/feature-requester friendly developer
I ever saw in my not so short life. At some moment in the future
I must write a book about him: "George Williams and my best experience
in bug-reporting." George also greatly helped me bug-hunting these fonts,
explained to me some very important things about fonts and font design,
quickly adopted pfaedit to my needs (or pointed me to The Right Place in
documentation where I found better way of doing things).

I would like to thank Alexey Novodvorsky (aka AEN), who
pointed me to pfaedit and George Williams' fonts, explained
The Task to me. He is also one of the main participators in the
development of Sysiphus -- free repository of free software.
I didn't loose my time for compiling/installing and supporting
my linux box coz I used the result of Sysiphus developers' works.

I would like to thank Sergey Vlasov, who tested these fonts and reported
about bugs. Also he help me to make some bug-reports to George about
pfaedit bugs.

I would like Dmitry 40in, who did big QA for some font outlines, drawn some glyphs,
and explain some The Truths for me.

I would like to thank Vlad Harchev (aka hvv), who
proofread this text for me.

Also I have to thank RMS for GPL and URW for releasing the fonts
under it.

Thank you very much!
Valek Filippov frob@df.ru
(C)opyLeft 2001
______________________________________________________________________________________
				TODO:
- fix all missed glyphs.
- change suitable glyphs with references.
- improve bearings of glyphs (thanks Dmitry 40in who pointed me to this)
- improve outlines of some cyrillic glyphs 
______________________________________________________________________________________
				Changelog:
2002-11-22  Valek Filippov  <frob@df.ru>

    Fixed bug that broke printing from QT.
    
2002-11-16  Valek Filippov  <frob@df.ru>

   Fixed some cyrillic (russian) glyphs in NimbusMono.
   NimbusMono Ascend/Descend were changed to match the visible
   size of the other font if same point-size is used.

2002-10-12  Valek Filippov  <frob@df.ru>

   Regenerated coz I screwed up UIDs.
   Partly applied Owen Tailor tweaks.
   (Really GWW changed pfaedit autohinter after OT sugggestion,
   so other OT tweaks are aoutomade by pfaedit)
   
2002-08-17  Valek Filippov  <frob@df.ru>

    Regenerated from 9-aug pfaedit version.
    Mostly for testing of new cubic->quad bezier conversion.

2002-07-22  Valek Filippov  <frob@df.ru>

    Regenerated from 22-07 pfaedit version.
    I still haven't enough time for correct serbian glyphs from Danilo
    integration =(

2002-05-19  Valek Filippov  <frob@df.ru>

    Regenerated from 18-05 pfaedit version.
    Restored original UIDs.
    Made otf versions again =)

2002-03-06  Valek Filippov  <frob@df.ru>

    Added pfms. Forced using of original kerning.
    d* and s* files were missed (fixed now).

2002-03-04  Valek Filippov  <frob@df.ru>

    Improved Bookman and Gothic. All fonts were regenerated
    (fix 'Delta', improved hinting). pfms are temporary excluded.

2002-02-03  Valek Filippov  <frob@df.ru>

    Improved Bookman Light/DemiBold. At 2002-01-07 I put
    non latest version of Chancery -- fixed.

2002-01-18  Valek Filippov  <frob@df.ru>

    All fonts regenerated again, coz AEN found bug in names translation.
    NimbusRomNo9-Regu greatly improved. NimbusRomNo9-Bold, NimbusSans{Cond}-{Regu,Bold}
    partially improved.

2002-01-07  Valek Filippov  <frob@df.ru>

    Bookman improved. Chancery added.

2002-01-04  Valek Filippov  <frob@df.ru>

    All fonts were regenerated.
    TTF-instructions were improved, some non-russian cyrillic
    fixed, "fi" and "fl" ligatures ligaturized where were not.
    Implemented some changes that Dmitry suggested,
    NimbusMono-Regular is partially made by him.
    Added COPYING. Generated pfm-files.
    Added fonts.dir and fonts.scale from gnu-gs-fonts.
    
2001-12-14  Valek Filippov  <frob@df.ru>

    Full tarball was made.

    NimbusRomNo9 regenerated. Added 'numero sign',
    'infinity' and 'Omega' (in Regu -- by Dmitry 40in).
    OTF versions removed until the best time.
    Dmitry supposed that URW'd presented 'beta'-version
    of fonts to community, coz bearings for original URW
    are not perfect. 1st attempt to fix it.  

2001-12-12  Valek Filippov  <frob@df.ru>

    Schoolbook extended to 'val3' and regenerated.
    Palladio extended to 'val3' and regenerated.
    Bookman extended to 'val3' and regenerated.
    Gothic extended to 'val3' and regenerated.
    Some glyphs still missed.       

    NimbusMono regenerated with modern pfaedit
    (bug with xterm fixed). Some 0x4** glyphs fixed.
    Added "number sign" and "infinity". Thanks to
    Dmitry 40in and Anton Zinoviev who criticized me
    about it. 

2001-12-08  Valek Filippov  <frob@df.ru>

    Added updated version of NimbusSansCond.
    Changes same like for NimbusSans
    (except: otf version not added).
    
2001-12-07  Valek Filippov  <frob@df.ru>

    Added updated version of NimbusMono.
    (Lat Ext-A, full 0x400 except 'glagolic', some chars are still
     missed; ttf hinting regenerated; otf version added;
     'Cyr De, de, L, l, Ch, ch' fixed).

2001-12-06  Valek Filippov  <frob@df.ru>

    Added updated version of NimbusSans.
    (Lat Ext-A, full 0x400 except 'glagolic', some chars are still
     missed; ttf hinting regenerated; otf version added;
     'Cyr De, de, L, l, Ch, ch' fixed).
    
2001-12-05  Valek Filippov  <frob@df.ru>

    Kern pairs from original URW had missed at the 11-nov version.
    Added OpenType version of fonts.

2001-11-11  Valek Filippov <frob@df.ru>
    
    NimbusRomanNo9
    Regular: added all uni0400 (except ancient cyrillic /glagolic?/).
             04bc-04bf, 04a8-9, 04d8, 04da still missed.
	     added all glyphs from Lat Ext-A (uni0100-017F) that was missed
	     in original URW (45 glyphs).
	     Most of accented chars and part of cyrillics changed
	     with references.
	     TTF hinting regenerated with modern PfaEdit.
    Bold: same but also missed 0494, 04a6, 04c3
    Italic, BoldItalic: same but missed many non-russian cyrillics.
______________________________________________________________________________________
				README.tweaks
Nimbus Sans L Regular, Nimbus Mono L Regular, Nimbus Mono L Oblique
all come from a more recent version of the cyrillic URW fonts.

The hints on Nimbus Sans Regular have been modified in the
following ways:

25 June 2002

 - Added ghost hint to the top of 4 to keep it from being
   taller than the other digits.
 - Reduced the width of the left stem hint for H to 83
   (probably no real differences)
 - Changed the StemSnapV values from [78 85 94] to [78 83 92]
   (and fixed up StdVW accordingly)
   This corresponds to the values in the font (which are 83/93
   for lower case and upper case stems) better and makes
   the width-88 stems on M and N snap to to upper case 
   widths not lower-case widths.

29 June 2002

 - Removed odd vertical stem hints (width of horizontal
   stems) from f, F, t, E, yen sign, fi ligature, 
   fl ligature, AE ligature, R, Lstroke, OE ligature,
   lstroke, E" variants, t, variants, Eth, Dstoke, etc.
 - Fixed hints on 1 to be two ghost hints instead of one
   hint the height of the font
 - fix bottom stem of u to have integer coordinates
 - fixed hints on |
 - fixed hints on inverted exclamation mark

The hints on Nimbus Mono L Oblique have been modified in the
following ways:

 - Removed vertical stem hints from horizontal serifs on
   roman characters.
  
Owen Taylor

[Resource/Font/URWPalladioL-BoldItal Resource/Font/NimbusSanL-Bold Resource/Font/NimbusRomNo9L-Medi Resource/Font/Dingbats Resource/Font/URWChanceryL-MediItal Resource/Font/CenturySchL-Roma Resource/Font/NimbusMonL-Bold Resource/Font/NimbusRomNo9L-MediItal Resource/Font/NimbusSanL-BoldItal Resource/Font/URWGothicL-Demi Resource/Font/StandardSymL Resource/Font/URWBookmanL-DemiBold Resource/Font/NimbusRomNo9L-Regu Resource/Font/URWGothicL-Book Resource/Font/NimbusSanL-ReguCond Resource/Font/CenturySchL-Bold Resource/Font/URWBookmanL-Ligh Resource/Font/NimbusRomNo9L-ReguItal Resource/Font/URWBookmanL-DemiBoldItal Resource/Font/NimbusMonL-ReguObli Resource/Font/NimbusSanL-ReguCondItal Resource/Font/CenturySchL-Ital Resource/Font/URWPalladioL-Roma Resource/Font/CenturySchL-BoldItal Resource/Font/URWBookmanL-LighItal Resource/Font/NimbusSanL-BoldCond Resource/Font/NimbusSanL-BoldCondItal Resource/Font/NimbusMonL-BoldObli Resource/Font/URWGothicL-DemiObli Resource/Font/NimbusSanL-Regu Resource/Font/URWPalladioL-Bold Resource/Font/NimbusMonL-Regu Resource/Font/NimbusSanL-ReguItal Resource/Font/URWGothicL-BookObli Resource/Font/URWPalladioL-Ital]

2008-08-12T23:44:53.919723Z Ray Johnston

Remove 'Actual Fonts' references in the Fontmap that connected the URW FontName
to an 8.3 filename that we no longer use.

[Resource/Init/Fontmap.GS]

2008-08-12T21:04:38.048281Z Ray Johnston

Move opdfread.ps to Resource/Init since this is needed by the 'ps2write' device.

[lib/opdfread.ps Resource/Init/opdfread.ps]

2008-08-12T14:42:02.961911Z Ken Sharp

Fix: Genoa file renders incorrectly with current color code

Details:
A typo in the DeviceGray code used an array of doubles instead of floats, causing incorrect
values to be returned by currenthsbcolor.

[src/zcolor.c]

2008-08-12T13:41:08.386171Z Ken Sharp

Yet another minor change in the color work.

The test file 'foo0-ge-64k.pdf' demonstrated an error with NChannel processing. The old
PostScript based code simply ignored errors when setting the NChannel Colorant spaces, we
now do the same.

[src/zcolor.c]

2008-08-12T09:17:56.269901Z Ken Sharp

Another small change to the color code. The issue Michael has been looking at (#689950)
uses a DeviceN space with an NChannel Colorants dictionary. A mistake in the NChannel
parameter checking meant that the Colorants were never evaluated.

[src/zcolor.c]

2008-08-12T07:37:45.162884Z Igor Melichev

Fix (PS interpreter) : Wrong glyph positions with CIDFontType 2 WMode 1.

DETAILS :

Bug 688058 "Vertical Japanese characters shift upper right direction". 
Bug 689559 "centerline of vertical CJK text is wrong when external TrueType CJK font is used.". 

The old code wrongly computes glyph positions when a CIDFontType 2 WMode 1
font has no metrics and includes vmtx. The patch properly computes
the V vector using top side bearing and font bounding box.
See comments in code.

This patch fixes the glyph positions and closes the original bugs, 
but we still observe other 2 problems with the 688058 test case :

1. 2 characters are substitutes with hollow boxes.
2. pdfwrite generates a PDF with a wrong glyph positions.

Opened bugs 690006, 690007 for them. 

[src/zchar42.c]

2008-08-12T07:35:33.506225Z Igor Melichev

Fix (TT interpreter) : AVector bug workaround was wrong.

DETAILS :

Bug 689820 "rendering of embbeded font with very low quality".

The problem may happens only when a glyph is bigger than [-UnitsPerEm*2, UnitsPerEm*2].
The old code includes a workaround for an antique AVBector bug.
However for detecting it the old code supplied a glyph bbox 
with a wrong coordinate representation (scale).

The test case supplies a glyph, in which some points have x-coordinate
greater than UnitsPerEm*2, so the workaround
converted all curves into lines. 

The patch provides the right bbox data.

[src/ttfmain.c]

2008-08-12T07:31:19.650883Z Igor Melichev

Fix (graphics) : A clist-based pattern supplied a wrong clipping box.

DETAILS :

Bug 689851 "Portions of output missing".

The test document paints an imagemask with a pattern 1 color, 
which contains a Type 1 image, which represents the graphics 
that one can view there.

The pattern appears so big as Ghostscript converts it into a clist.
When rendering the inner image to the clist,
It calls get_clipping_box to know whether the image portion
falls inside the painting area. But the old code
appears to use a wrong implementation of the get_clipping_box method, 
which was inherited from the page clist writer and retrieves the page size.
Here we need the pattern cell size instead the page size.
The patch sets up the right implementation for get_clipping_box.

[src/gxpcmap.c src/gximask.c]

2008-08-12T01:49:02.711432Z Alex Cherepanov

Fix single '~' expansion in generic POSIX persistent-cache implementation.

[src/gp_unix_cache.c]

2008-08-12T01:31:32.498041Z Alex Cherepanov

Fix a potential crash after failed memory allocation in RAM-based command list.

[src/gxclmem.c]

2008-08-12T00:53:52.298682Z Alex Cherepanov

Fix a typo in get_data() macro used by PDF 1.4 composition devices
because the typo caused dependency on the side effect order.

[src/gdevp14.c]

2008-08-11T23:01:09.304118Z Alex Cherepanov

Add a missing break statement after 16-bit Burn blending mode case.

[src/gxblend.c]

2008-08-11T19:11:45.049525Z Ralph Giles

Clean up the configure help entries for optional features.

[src/configure.ac]

2008-08-11T18:58:27.188200Z Ralph Giles

Don't run configure if autoconf failed to regenerate it.

[autogen.sh]

2008-08-11T18:31:30.295468Z Ralph Giles

Add a --disable-cairo option to block linking to libcairo for packagers.
Bug 689999.

[src/configure.ac]

2008-08-11T15:10:06.472831Z Ken Sharp

Further to the PostScript color work, clear up a couple of warnings which exhibit using gcc
on Linux, but not MSVC.

[src/zfunc.c src/zfunc4.c]

2008-08-11T14:16:18.397362Z Ken Sharp

Move the interpretation of PostScript (and PDF) color spaces from PostScript into C. 

DETAILS:
This has required a large number of changes, there are a few new .c or .h files, a
number of PostScript files have been removed, and a few others simplified. A few
documentation '.htm' files have also been modified to reflect these changes.

[src/int.mak src/zpcolor.c src/zicc.c Resource/Init/gs_devn.ps src/zcssepr.c Resource/Init/gs_cspace.ps src/zcie.c src/zicc.h src/zcie.h src/zcspixel.c Resource/Init/gs_lev2.ps Resource/Init/gs_ciecs3.ps Resource/Init/gs_sepr.ps src/zcolor.c src/ifunc.h src/zfunc4.c src/zcsdevn.c src/zcolor.h Resource/Init/gs_patrn.ps src/zfsample.c doc/Develop.htm src/zfunc.c Resource/Init/gs_ll3.ps src/zcsindex.c doc/Psfiles.htm Resource/Init/gs_icc.ps Resource/Init/gs_devpxl.ps src/gscolor2.h Resource/Init/gs_init.ps Resource/Init/gs_devcs.ps Resource/Init/gs_indxd.ps Resource/Init/gs_ciecs2.ps]

2008-08-11T12:19:24.825877Z Ken Sharp

Change the description for the -dNOCIE switch, since it wasn't apparently clear enough
which device spaces were substituted for which CIEBased spaces.

[doc/Use.htm]

2008-08-08T05:39:21.132225Z Ralph Giles

Re-add pdf_draw.ps which was dropped in r8954, since the CET regression
requires it.

[Resource/Init/pdf_draw.ps]

2008-08-08T04:22:38.494595Z Ray Johnston

Massive commit discussed before the freeze to move the PostScript initialization
files to Resource/Init. This obviates the need for geninit when COMPILE_INITS=1.
A followup change will enhance mkromfs to allow it to 'strip' comments and white
space from PostScript input files somewhat reducing the compressed storage needed
for the files in Resource/Init. All files mentioned in int.mak with 'ADDMOD ...
-ps ...' are included as well as those that would have been included via gs_init.ps
%% Replace lines.

Builds tested on Windows and Cygwin for the various executables (gs, pcl6, pspcl6
and gxps).

The default LIBPATH and GenericResourceDir are adjusted accordingly.

[Resource/Init/gs_typ32.ps /trunk/ghostpdl/main/pcl6_gcc.mak Resource/Init src/cfonts.mak lib/gs_dbt_e.ps Resource/Init/gs_dscp.ps lib/gs_statd.ps lib/gs_fapi.ps Resource/Init/gs_devn.ps Resource/Init/gs_agl.ps lib/cidfmap src/iccinit0.c lib/gs_epsf.ps lib/gs_dpnxt.ps lib/pdf_draw.ps lib/gs_icc.ps lib/gs_diskf.ps src/all-arch.mak Resource/Init/gs_fapi.ps lib/gs_init.ps lib/pdf_font.ps lib/gs_ciddc.ps lib/gs_diskn.ps src/ccfont.h lib/pdf_base.ps Resource/Init/gs_dps.ps lib/gs_sym_e.ps lib/gs_btokn.ps Resource/Init/xlatmap Resource/Init/gs_epsf.ps lib/gs_resmp.ps Resource/Init/gs_init.ps src/gs.mak src/wmin.mak lib/gs_wan_e.ps src/Makefile.in Resource/Init/gs_indxd.ps Resource/Init/gs_cidtt.ps src/macos-mcp.mak Resource/Init/gs_img.ps lib/gs_type1.ps lib/pdf_cslayer.ps Resource/Init/gs_setpd.ps lib/gs_dps1.ps Resource/Init/gs_mgl_e.ps src/psromfs.mak lib/gs_lev2.ps lib/gs_pdf_e.ps Resource/Init/gs_fonts.ps src/icfontab.c Resource/Init/gs_mex_e.ps Resource/Init/gs_ttf.ps lib/gs_pdfwr.ps Resource/Init/gs_std_e.ps lib/gs_cidfn.ps /trunk/ghostpdl/common/msvc_top.mak src/geninit.c src/bcwin32.mak src/imain.c Resource/Init/pdf_cslayer.ps lib/gs_ll3.ps lib/Fontmap Resource/Init/gs_dps1.ps src/iccinit1.c Resource/Init/gs_lev2.ps lib/gs_css_e.ps lib/gs_ccfnt.ps Resource/Init/gs_l2img.ps lib/gs_frsd.ps Resource/Init/gs_cet.ps lib/gs_devpxl.ps lib/gs_trap.ps Resource/Init/FCOfontmap-PCLPS2 src/macosx.mak Resource/Init/gs_patrn.ps Resource/Init/pdf_main.ps lib/gs_ciecs2.ps Resource/Init/gs_res.ps Resource/Init/gs_il1_e.ps lib/gs_cidcm.ps lib/gs_cmap.ps src/openvms.mmk lib/gs_typ32.ps Resource/Init/gs_frsd.ps Resource/Init/gs_mro_e.ps Resource/Init/gs_devpxl.ps Resource/Init/gs_devcs.ps Resource/Init/gs_trap.ps Resource/Init/gs_ciecs2.ps Resource/Init/gs_fntem.ps lib/gs_cspace.ps lib/gs_agl.ps Resource/Init/gs_cmap.ps Resource/Init/gs_typ42.ps Resource/Init/gs_cidfm.ps Resource/Init/pdf_rbld.ps src/int.mak lib/pdf_sec.ps src/msvclib.mak src/imainarg.c /trunk/ghostpdl/main/pcl6_msvc.mak Resource/Init/gs_cff.ps Resource/Init/gs_cspace.ps lib/gs_dps.ps src/msvc32.mak src/unix-gcc.mak lib/xlatmap Resource/Init/pdf_sec.ps src/zfile.c lib/pdf_ops.ps Resource/Init/gs_dbt_e.ps Resource/Init/gs_statd.ps lib/gs_indxd.ps lib/gs_cidtt.ps lib/gs_dps2.ps src/unixansi.mak lib/gs_img.ps Resource/Init/cidfmap lib/gs_setpd.ps Resource/Init/gs_dpnxt.ps Resource/Init/gs_icc.ps lib/gs_mgl_e.ps Resource/Init/gs_diskf.ps Resource/Init/pdf_ops.ps src/winint.mak lib/gs_fonts.ps Resource/Init/gs_ciddc.ps Resource/Init/pdf_font.ps Resource/Init/gs_dps2.ps Resource/Init/gs_diskn.ps lib/gs_mex_e.ps lib/gs_ttf.ps lib/gs_std_e.ps Resource/Init/pdf_base.ps lib/gs_resst.ps Resource/Init/gs_sym_e.ps Resource/Init/gs_btokn.ps src/wctail.mak lib/Fontmap.GS src/watclib.mak /trunk/ghostpdl/language_switch/pspcl6_msvc.mak lib/gs_sepr.ps lib/gs_ciecs3.ps lib/gs_l2img.ps Resource/Init/gs_resmp.ps lib/gs_cet.ps Resource/Init/gs_wan_e.ps src/iccfont.c lib/FCOfontmap-PCLPS2 lib/gs_patrn.ps lib/pdf_main.ps Resource/Init/Fontmap.GS Resource/Init/gs_type1.ps lib/gs_res.ps lib/gs_il1_e.ps /trunk/ghostpdl/language_switch/pspcl6_gcc.mak Resource/Init/gs_ciecs3.ps Resource/Init/gs_sepr.ps lib/gs_mro_e.ps Resource/Init/gs_pdf_e.ps lib/gs_devcs.ps src/openvms.mak Resource/Init/gs_pdfwr.ps Resource/Init/gs_cidfn.ps src/watcw32.mak lib/gs_fntem.ps Resource/Init/Fontmap Resource/Init/gs_ll3.ps Resource/Init/gs_css_e.ps src/os2.mak lib/gs_cidfm.ps lib/gs_typ42.ps lib/pdf_rbld.ps src/ugcclib.mak lib/gs_dscp.ps lib/gs_devn.ps lib/gs_cff.ps Resource/Init/gs_cidcm.ps]

2008-08-08T04:03:54.625369Z Ray Johnston

Fix 'rangecheck in showpage' with NumRenderingThreads>0 if the lines requeested do
not range from 0 forward or height-1 backwards. Bug from customer 531 and 850.
Also fix problems with reversion to non-multithreaded rendering with file and memory
based BAND_LIST_STORAGE.

DETAILS:

The 'clist_get_band_from_thread' logic had a known deficiency if the device did not
request lines ranging from the top or bottom of the page. The fix assumes that the
normal direction is from line 0 forward unless the first line requested is the last
line of the page, setting the lookahead_direction. If a request is made for a band
other than the next one in the expected direction, the lookahead_direction is 
reversed and threads are started for the requested band and the bands following in
the new direction. This effectively recovers from an incorrect guess, but since
there is no limit on the number of times that the recovery is performed, also allows
for lines/bands to be requested in arbitrary order.

The customer uses a custom device, but the 'bit' devices were recently enhanced
with -dFirstLine= and -dLastLine= parameters to allow testing.

The re-opening of the clist files was changed to use 'a+' to avoid erasing the
file if multi-threaded rendering was shut down (clist_teardown_render_threads),
and rendering was reverted to single threaded mode.

The memory based clist (BAND_LIST_STORAGE=memory) was supplemented to better
track re-opening and allow for 'a' mode and avoid memory leak of the original
'base' named memfile structure. The customers mentioned above also use the
BAND_LIST_STORAGE=memory for performance reasons (realizing a 10% gain in
throughput over file based clist).

[src/gxclmem.c src/gxclthrd.c src/gxclmem.h]

2008-08-07T19:20:04.322235Z Igor Melichev

Fix (graphics) : Redundant patterns in clist (continued),

DETAILS :

Bug 689995 "segfault with 09-34.PS"

1. (the bug fix) A recent patch doesn't account patterns with no tile,
which represent an empty pattern.  
This change inserts checks for empty tiles
and process them with no optimization (redundantly), 
because they are small and are not cached.
See comments in code.

2. pcls->band_complexity.uses_color accummulated a pattern address bits instead
a real data. This bug was introduced when serializing colors to clist.
nevertheless this bug has no visible effect because 'pure' is overlayed with 
a tile address, which can't be equal to 0 or 0xffffff.
So formally this part of the change is algorithmically equivalent,
but it is important for redability. 

Note that when serializing a pattern to clist, 'uses_color' is not properly
computed and needs further development. see new bug 689997.

Minor change : removed the second call to gs_dc_get_pattern_id for a faster code.

[src/gsptype1.c src/gxclpath.c]

2008-08-07T05:20:08.759100Z Alex Cherepanov

A pointer to allocated memory was used before checking it for 0. This bug
was discovered by Klocwork static code analyzer.

[src/scfd.c]

2008-08-07T00:02:14.784953Z Ralph Giles

Add the PSSRC dir to the includes of contrib devices that depend on
the ps interpreter so they can be build when that directory is different
from src.

[contrib/contrib.mak]

2008-08-07T00:02:13.283150Z Ralph Giles

Use graphics library instead of interpreter error codes in the gomni
device.

[contrib/gomni.c]

2008-08-06T19:57:07.199634Z Ralph Giles

Remove references to malloc/free memory management not used since r8192.

[src/lib.mak src/gsncdummy.c]

2008-08-06T19:51:21.189161Z Ralph Giles

Remove trailing whitespace.

[src/gsncdummy.c]

2008-08-06T19:49:05.961384Z Ralph Giles

Use graphics library instead of interpreter-level rangecheck errors.    

[src/gsncdummy.c]

2008-08-06T18:28:20.524086Z Ray Johnston

Add a capability to select the first and last line to be emitted to the
output file. This was needed to support some customers (531 and 850) that
do something similar in their devices. Adds -dFirstLine=# and -dLastLine=#
to this device. Line numbers are from 0 to height-1, and may be in reverse
order. Probably not much use other than testing, but it doesn't hurt if it
is there.

[src/gdevbit.c]

2008-08-06T07:22:26.679682Z Igor Melichev

Fix (graphics) : Redundant patterns in clist.

DETAILS :

Bug 689865 "clist stores redundant patterns".

The change is pretty simple because the clist reader already implememnts
a pattern cache. We just add pattern id to gx_clist_state
and provide a short format (just the id) when writing and reading
a pattern color to/from clist at second time. A new function gs_dc_get_pattern_id
allows to access the pattern id through closures of color elements.

Note it remembers up to 2 pattern ids for a band
(one for the specific band, and another for "all bands").
A better way would be to remember all patterns cached for a band,
but it would need to save all cached ids individually for each band while clist writing.
We don't want to enlarge the clist writer storage now.

Minor change : Some dependencies of gxclpath.c were missed in makefile. 

[src/gsptype1.c src/lib.mak src/gsptype1.h src/gxcldev.h src/gxclpath.c]

2008-08-06T06:24:44.864622Z Igor Melichev

Fix (graphics) : Memory leak from Indexed color space.

DETAILS :

Bug 689990 "pcl6.exe crash with gs revision 8928".

This change partially unwinds the revision 8928 change
and reopens the bug 89822 "Memory leaks during rendering clist."
See comment in code. 

[src/gscolor2.c]

2008-08-05T20:44:34.621109Z Ralph Giles

Move pointer dereferences to after the NULL check.

[src/ttobjs.c]

2008-08-03T17:54:46.281366Z Alex Cherepanov

Detect and reject PDF files with circular references in the page tree.
Avoid an infinite loop. Bug 689954.

[lib/pdf_main.ps]

2008-08-03T17:23:40.990280Z Ralph Giles

Update ignore list for the ijs directory.

[ijs]

2008-08-03T17:17:10.771824Z Ralph Giles

Clean up the cairo minimum version check introduced in r8929.

[src/configure.ac]

2008-08-03T16:30:42.166329Z Igor Melichev

Fix (graphics) : A slow stroking with big patterns.

DETAILS :

Bug 689966 "c329.bin hang with bitcmyk in clist code".


1. The stroking algorithm includes a branch for a 'faster' rasterizing
with an idempotential color. That branch paints each stroke independently of others.
However that branch doesn't apply an optimization for big patterns,
which the general filling algorithm implements. It caused the too slow rendering,
because a clist-based pattern is played back for each parallelogram.
This change disables the 'faster' srtoking with big patterns,
so that the faster filling algorithm works fine for stroking.

2. Revert the revision 8851 change, which was a temporary workaround for the problem,
The default value for MAX_PATTERN_BITMAP_SIZE is now restored back to 1Mb.

[src/lib.mak src/gxpcmap.c src/gxstroke.c]

2008-08-03T15:47:58.770546Z Alex Cherepanov

Cairo device requires at least v. 1.2.0 of the Cairo library to build.

[src/configure.ac]

2008-08-03T12:26:41.949878Z Igor Melichev

Fix (graphics) : Memory leak from Indexed color space.

DETAILS :

Bug 689822 "Memory leaks during rendering clist."

The finalize function doesn't release 'table,
which is allocated when use_proc == 1.

Minor change : improved a debug printing in gsmchunk.c :
A meanful name is better than an unknown address.
 

[src/gsmchunk.c src/gscolor2.c]

2008-08-03T12:25:39.705021Z Alex Cherepanov

Give a name to a continuation operator %ztoken_continue to avoid printing
its address, which varies between builds and causes spurious regression
reports.

[src/ztoken.c]

2008-08-03T07:49:59.678670Z Russell Lang

Fix the OS/2 build, which was broken because it was trying to use the 
Windows synchronisation code.  
While OS/2 does support thread synchronsation, there is no ghostscript 
implementation for the OS/2 platform, and no interest in writing one.

[src/os2.mak]

2008-08-02T15:10:41.076927Z Alex Cherepanov

Replace a conditional expression with an 'if' statement. The former
requires a prototype for mkstemp64() that is not available on AIX.

[src/gp_unifs.c]

2008-08-01T21:43:44.587346Z Ralph Giles

Document needing to remove autom4te.cache from the jasper directory.

[doc/Release.htm]

2008-08-01T21:43:42.361706Z Ralph Giles

We can no longer run the full build with -dBufferSpace=100000. The
minimum to complete the smoke test seems to be around 120000, but
use 200000 as future insurance.

[doc/Release.htm]

2008-08-01T20:57:40.076512Z Alex Cherepanov

Reduce heap size limit (/Zm) on MSVC6 to fix internal compiler error
when COMPILE_INITS=1.

[src/msvccmd.mak]

2008-08-01T20:55:00.712414Z Ralph Giles

Add a mapping of commit ids to author names.

This is used by split_changelog.py to do the replacement when building 
the History files. The changes to that script to make use of this file
were inadvertently included in r8917.

[doc/AUTHORS]

2008-08-01T20:22:16.068978Z Ralph Giles

Bump the version and product name post-release.

[doc/News.htm toolbin/split_changelog.py lib/gs_init.ps src/gscdef.c src/version.mak]

2008-08-01T18:08:18.641815Z Ralph Giles

Update change logs for the 8.53 release.

[doc/Changes.htm doc/History8.htm doc/Details8.htm doc/Details.htm]

Version 8.63 (2008-08-01)

This is the fourth scheduled release in the stable Ghostscipt 8.6x series. It corresponds to the 1.53 release of GhostPDL.

Approximately 238 bugs have been fixed since version 8.62. Of particular note are robustness and performance improvements with large files, invalid PDF, and font handling.

The major new feature of this release is multithreaded rendering. This can be requested by passing -dNumRenderingThreads=n on the command line. The input document is first parsed, and then each page is split into n bands which are rendered concurrently. This can provide a significant reduction in processing time on multi-core systems.

Images are now always interpolated in their source colorspace. This improves correctness for XPS documents and avoids bypassing the custom color management callbacks for interpolated images. Interpolation and color management are both expensive operations, so this affects performance with large images. The effect can be positive or negative depending on the file and the target resolution. If performance is a problem, we suggest running with -dNOINTERPOLATION.

Support for OpenPrinting Vector devices has been upgraded to version 1.0.

There are two new devices in this release, both experimental. Behdad Esfahbod has contributed a cairo output device which uses the cairo graphics library to generate PDF, SVG, EPS, or PNG files, based on the requested filename extension. The svgwrite device directly outputs Scalable Vector Graphics, the W3C XML vector graphics format. Both support only vector art at this point; text and images will not be represented efficiently.

The following bugs were open at the time of release:

226943, 430175, 465936, 493348, 535932, 578865, 614298, 626295, 686747, 686853, 686865, 687000, 687011, 687084, 687095, 687146, 687193, 687257, 687271, 687280, 687295, 687297, 687303, 687327, 687375, 687414, 687475, 687492, 687514, 687520, 687536, 687561, 687593, 687608, 687630, 687650, 687666, 687674, 687677, 687695, 687697, 687702, 687715, 687721, 687728, 687729, 687731, 687775, 687780, 687782, 687793, 687796, 687805, 687850, 687887, 687903, 687904, 687915, 687931, 687950, 687957, 687981, 687983, 688007, 688022, 688024, 688026, 688032, 688036, 688042, 688058, 688061, 688064, 688066, 688081, 688095, 688129, 688130, 688151, 688159, 688166, 688184, 688187, 688204, 688207, 688210, 688215, 688227, 688267, 688269, 688280, 688288, 688312, 688318, 688320, 688333, 688342, 688359, 688361, 688363, 688372, 688378, 688386, 688387, 688389, 688395, 688413, 688436, 688437, 688440, 688448, 688473, 688475, 688483, 688495, 688500, 688515, 688528, 688533, 688539, 688540, 688542, 688557, 688565, 688573, 688580, 688581, 688588, 688601, 688604, 688605, 688616, 688617, 688619, 688627, 688636, 688638, 688647, 688651, 688653, 688655, 688673, 688696, 688697, 688699, 688708, 688709, 688710, 688714, 688717, 688728, 688731, 688736, 688739, 688757, 688770, 688774, 688777, 688778, 688797, 688818, 688829, 688843, 688846, 688871, 688872, 688876, 688908, 688918, 688919, 688923, 688926, 688933, 688942, 688943, 688949, 688952, 688958, 688969, 688976, 688978, 688986, 688990, 688994, 688999, 689003, 689011, 689013, 689022, 689025, 689028, 689031, 689032, 689040, 689044, 689046, 689048, 689057, 689058, 689060, 689070, 689076, 689077, 689078, 689080, 689081, 689093, 689094, 689098, 689116, 689128, 689129, 689130, 689133, 689137, 689145, 689146, 689148, 689150, 689153, 689154, 689161, 689167, 689174, 689184, 689188, 689195, 689198, 689199, 689209, 689222, 689224, 689230, 689236, 689247, 689248, 689252, 689253, 689264, 689278, 689279, 689280, 689283, 689289, 689290, 689295, 689304, 689305, 689308, 689313, 689331, 689335, 689340, 689341, 689358, 689361, 689363, 689370, 689376, 689378, 689392, 689396, 689402, 689418, 689419, 689421, 689422, 689423, 689431, 689438, 689439, 689444, 689450, 689451, 689456, 689460, 689462, 689463, 689471, 689484, 689487, 689489, 689490, 689498, 689500, 689502, 689506, 689507, 689509, 689512, 689518, 689521, 689522, 689546, 689547, 689549, 689554, 689557, 689559, 689560, 689561, 689563, 689566, 689567, 689571, 689573, 689574, 689581, 689583, 689584, 689585, 689591, 689592, 689595, 689598, 689601, 689606, 689610, 689616, 689618, 689623, 689625, 689627, 689628, 689632, 689636, 689641, 689652, 689653, 689654, 689657, 689658, 689663, 689666, 689669, 689670, 689674, 689681, 689682, 689684, 689689, 689690, 689691, 689692, 689697, 689698, 689702, 689704, 689705, 689709, 689710, 689711, 689715, 689716, 689721, 689722, 689725, 689726, 689727, 689729, 689734, 689737, 689741, 689747, 689752, 689756, 689758, 689759, 689760, 689761, 689767, 689769, 689772, 689773, 689775, 689778, 689781, 689786, 689789, 689790, 689792, 689793, 689794, 689799, 689801, 689805, 689808, 689816, 689817, 689820, 689822, 689823, 689826, 689834, 689835, 689836, 689840, 689842, 689849, 689850, 689851, 689853, 689856, 689858, 689859, 689860, 689861, 689862, 689865, 689868, 689869, 689870, 689871, 689872, 689877, 689878, 689879, 689880, 689881, 689883, 689885, 689890, 689891, 689895, 689901, 689902, 689903, 689904, 689905, 689909, 689910, 689914, 689915, 689916, 689917, 689922, 689923, 689928, 689929, 689930, 689931, 689933, 689935, 689937, 689938, 689939, 689940, 689941, 689942, 689943, 689947, 689950, 689951, 689952, 689954, 689955, 689957, 689961, 689966, 689968, 689969, 689970, 689972, 689974, 689975, 689980.

Incompatible changes

The maximum number of color components has been reduced to 8 (from 252) as a performance improvement. Eight is the largest number commonly used and the largest number for which we support continuous tone images. Users with special needs can restore the previous behavior by setting the GS_CLIENT_COLOR_MAX_COMPONENTS preprocessor symbol to the required number of components at compile time.

The -Z: debugging option now uses 'realtime' instead of 'usertime' when reporting timing information on unix-like systems. This has always been the case on windows-like systems.

Obsolete makefiles for the DesqView environment have been removed.

Changelog

2008-08-01T17:53:17.331788Z Ralph Giles

Bump the product name an date for the 8.63 release.

[doc/History7.htm doc/Projects.htm doc/History8.htm man/dvipdf.1 man/ps2ascii.1 doc/Use.htm doc/Readme.htm doc/Source.htm doc/Deprecated.htm man/ps2epsi.1 doc/Install.htm src/gscdef.c doc/API.htm doc/Issues.htm doc/DLL.htm doc/Drivers.htm man/pfbtopfa.1 doc/Release.htm doc/Commprod.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm man/gs.1 src/version.mak man/pf2afm.1 doc/Ps2ps2.htm doc/Fonts.htm man/printafm.1 doc/Ps2pdf.htm doc/Develop.htm doc/Helpers.htm man/pdf2dsc.1 doc/Psfiles.htm doc/Lib.htm doc/gs-vms.hlp doc/Htmstyle.htm man/font2c.1 man/gsnd.1 man/pdfopt.1 doc/News.htm man/pdf2ps.1 man/ps2pdf.1 doc/Make.htm doc/Details8.htm doc/Unix-lpr.htm doc/C-style.htm doc/Ps-style.htm doc/History1.htm doc/History2.htm man/gslp.1 man/wftopfa.1 doc/History3.htm man/ps2ps.1 doc/Ps2epsi.htm doc/History4.htm man/ps2pdfwr.1 doc/History5.htm doc/History6.htm]

2008-07-31T21:06:50.284451Z Ralph Giles

Update change logs for 8.63rc3.

[doc/History7.htm doc/Projects.htm doc/History8.htm man/dvipdf.1 man/ps2ascii.1 doc/Use.htm doc/Readme.htm doc/Source.htm doc/Deprecated.htm man/ps2epsi.1 doc/Install.htm doc/Changes.htm doc/API.htm doc/Issues.htm doc/DLL.htm doc/Drivers.htm man/pfbtopfa.1 doc/Release.htm doc/Commprod.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm man/gs.1 src/version.mak man/pf2afm.1 doc/Ps2ps2.htm doc/Fonts.htm man/printafm.1 doc/Ps2pdf.htm doc/Develop.htm doc/Helpers.htm man/pdf2dsc.1 doc/Psfiles.htm doc/Lib.htm doc/gs-vms.hlp doc/Htmstyle.htm man/font2c.1 man/gsnd.1 man/pdfopt.1 doc/News.htm man/pdf2ps.1 man/ps2pdf.1 doc/Make.htm doc/Details8.htm doc/Unix-lpr.htm doc/C-style.htm doc/Ps-style.htm doc/History1.htm doc/History2.htm man/gslp.1 man/wftopfa.1 doc/History3.htm man/ps2ps.1 doc/Details.htm doc/Ps2epsi.htm doc/History4.htm man/ps2pdfwr.1 doc/History5.htm doc/History6.htm]

2008-07-29T20:35:41.916113Z Ray Johnston

Fix problem with NumRenderingThreads>0 with devices that request data from
the bottom up such as the 'bmp*' devices. Bug 689985.

[src/gxclthrd.c]

2008-07-29T19:11:31.677116Z Alex Cherepanov

Add support to NULL pointers in t_structs or t_astructs objects to execstack
operator. Thanks to Ken for the analysis. Bug 689535.

DETAILS:
The issue is to do with devices handling patterns as high-level objects, which
is why it affects pdfwrite (which can handle patterns itself) but not regular
rendering. In zpcolor.c, pattern_paint_prepare(), there are two control paths,
one for devices which handle patterns as high-level objects, and one for
devices which don't. If the device can't handle high level objects, we install
a pattern accumulation device.

In this case, the flag internal_accum is set, we create the pattern accumulator
device and open it:

    if (internal_accum) {
	gs_memory_t *storage_memory = gstate_pattern_cache(pgs)->memory;

	pdev = gx_pattern_accum_alloc(imemory, storage_memory, pinst,
"pattern_paint_prepare");
	if (pdev == 0)
	    return_error(e_VMerror);
	code = (*dev_proc(pdev, open_device)) ((gx_device *) pdev);
...
...
}

Later the two control paths rejoin and we put some objects on the execution
stack:

    push_mark_estack(es_other, pattern_paint_cleanup);
    ++esp;
    make_istruct(esp, 0, pdev);

Now notice that we construct the structure on esp using pdev, but we *don't*
create pdev if we can handle patterns, so its left as NULL and we end up
pushing an empty t_struct.

Leo's question in comment 10 is whether this is legal, the answer appears to be
yes, but its debatable. 

In pattern_paint_finish we do this:

    gx_device_forward *pdev = r_ptr(esp - 1, gx_device_forward);

    if (pdev != NULL) {
	gx_color_tile *ctile;
	int code = gx_pattern_cache_add_entry((gs_imager_state *)igs,
					  pdev, &ctile);

That is, if the structure *isn't* NULL we do something with it, we ignore it if
it is NULL. Either way we then do this:

    esp -= 3;

Removing all the objects from the execution stack that we added. Notice that
the structure we pushed onto the execution stack isn't actually 'executed', its
just data used by the pattern handler.

Now, all this works just fine in normal practice, however the job here uses a
CIEBased colour space, and being from an Adobe application it tries to set the
ColorRendering. Since we don't implement a ColorRendering resource category,
this causes an error (handled in a stopped context).

The default error handler uses execstack, and this is where the actual error
finally occurs, because execstack can't handle the empty structure.

[src/zcontrol.c]

2008-07-29T18:06:37.196198Z Ralph Giles

Update change logs for 8.63rc2.

[doc/History7.htm doc/Projects.htm doc/History8.htm man/dvipdf.1 man/ps2ascii.1 doc/Use.htm doc/Readme.htm doc/Source.htm doc/Deprecated.htm man/ps2epsi.1 doc/Install.htm doc/Changes.htm doc/API.htm doc/Issues.htm doc/DLL.htm doc/Drivers.htm man/pfbtopfa.1 doc/Release.htm doc/Commprod.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm man/gs.1 src/version.mak man/pf2afm.1 doc/Ps2ps2.htm doc/Fonts.htm man/printafm.1 doc/Ps2pdf.htm doc/Develop.htm doc/Helpers.htm man/pdf2dsc.1 doc/Psfiles.htm doc/Lib.htm doc/gs-vms.hlp doc/Htmstyle.htm man/font2c.1 man/gsnd.1 man/pdfopt.1 doc/News.htm man/pdf2ps.1 man/ps2pdf.1 doc/Make.htm doc/Details8.htm doc/Unix-lpr.htm doc/C-style.htm doc/Ps-style.htm doc/History1.htm doc/History2.htm man/gslp.1 man/wftopfa.1 doc/History3.htm man/ps2ps.1 doc/Details.htm doc/Ps2epsi.htm doc/History4.htm man/ps2pdfwr.1 doc/History5.htm doc/History6.htm]

2008-07-29T11:01:11.006826Z Russell Lang

Allow compilation with Microsoft Visual Studio 2008 (VC 9.0).
Include lib files in the Windows installer when using COMPILE_INITS=1.

[src/winint.mak src/msvc32.mak]

2008-07-28T22:23:04.128314Z Michael Vrhel

Fix for Bug 689983.  This was introduced with the source space interpolation code.  Fixes indexing direction in source data when we have indexed data, interpolation and a negative xx value in the geometric transformation.

[src/gxiscale.c]

2008-07-28T20:44:43.542926Z Ralph Giles

Update change logs for 8.63rc1.

[doc/Changes.htm doc/History8.htm doc/News.htm doc/Details8.htm doc/Details.htm]

2008-07-28T19:41:25.163173Z Ralph Giles

Fix a syntax error from r8548.

This wasn't noticed because double.dev isn't part of the default build.

[src/zdouble.c]

2008-07-28T18:58:41.634974Z Ralph Giles

Update release date and product name for 8.63rc1.

[doc/History7.htm doc/Projects.htm doc/History8.htm man/dvipdf.1 man/ps2ascii.1 doc/Use.htm doc/Readme.htm doc/Source.htm doc/Deprecated.htm man/ps2epsi.1 doc/Install.htm src/gscdef.c doc/API.htm doc/Issues.htm doc/DLL.htm doc/Drivers.htm man/pfbtopfa.1 doc/Release.htm doc/Commprod.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm man/gs.1 src/version.mak man/pf2afm.1 doc/Ps2ps2.htm doc/Fonts.htm man/printafm.1 doc/Ps2pdf.htm doc/Develop.htm doc/Helpers.htm man/pdf2dsc.1 doc/Psfiles.htm doc/Lib.htm doc/gs-vms.hlp doc/Htmstyle.htm man/font2c.1 man/gsnd.1 man/pdfopt.1 man/pdf2ps.1 man/ps2pdf.1 doc/Make.htm doc/Details8.htm doc/Unix-lpr.htm doc/C-style.htm doc/Ps-style.htm doc/History1.htm doc/History2.htm man/gslp.1 man/wftopfa.1 doc/History3.htm man/ps2ps.1 doc/Ps2epsi.htm doc/History4.htm man/ps2pdfwr.1 doc/History5.htm doc/History6.htm]

2008-07-28T18:55:01.811159Z Ralph Giles

Update news for 8.63rc1.

[doc/News.htm]

2008-07-28T12:01:51.595271Z Alex Cherepanov

Fix extraction of the default subfile from PDF file collection on save
level 0. Export the file name as a PS name from PDF interpreter instance
to protect the name from restore. Bug 689981.

DETAILS:
Exporting this value as a global composite object doesn't work when PDF
interpreter runs on the save level 0. If we ever implement processing of
multiple files from PDF collection the interface will need some changes.

[lib/pdf_main.ps]

2008-07-28T10:10:53.373341Z Igor Melichev

Fix (clist writer) : Improve the logic about zero tile id.

DETAILS :

Thanks to Peter for participation. See comment in code.

[src/gxclrect.c]

2008-07-28T07:52:42.264750Z Igor Melichev

Fix (printer) : A check for buffer space overflow was dramatically overestimated.

DETAILS :

In the old code :

    new_height < max_ulong/(mem_space + (new_height * pdf14_trans_buffer_size))

Where pdf14_trans_buffer_size is (raster * NUM_PDF14_BUFFERS).

equivalent to :

    
    new_height * (mem_space + (new_height * (raster * NUM_PDF14_BUFFERS))) < max_ulong


equivalent to :

    new_height * mem_space + new_height * new_height * raster * NUM_PDF14_BUFFERS < max_ulong


So it counts new_height quadratically, but it must be the linear multiple by the raster.

Debugged with the test case of the bug 689982.
It creates a 15Mb raster, but could not switch off the banding
even with -dMaxBitmap=1000000000 .

[src/gdevprn.c]

2008-07-27T21:06:38.633515Z Igor Melichev

Fix (shading) : Empty clipping was entirely lost.

DETAILS :

Bug 689982 "A wrong shading raster".

The old code doesn't account that gx_cpath_from_rectangle
may normalize the given rectangle.

[src/gxfill.c]

2008-07-27T19:10:02.737363Z Ralph Giles

Metadata updates for the new zfile header.

[src/zfile.h doc/Develop.htm]

2008-07-27T16:07:30.174721Z Ray Johnston

Remove (complete) duplication of the contents. Cosmetic change only.

[src/zfile.h]

2008-07-27T16:01:28.177923Z Igor Melichev

Fix (clist) : Skip writing unuseful data with linear color triangle.

DETAILS :

This fixes a minor problem what was discovered while working on 
bug 689918 "Ghostscript 8.62 and 8.63 segmentation fault".

cmd_write_trapezoid_cmd wrote an unused data to clist when 
processing a linear color triangle. The variables ybot, ytop are never used
while a clist interpretation. In same time the data are not initialized
in that case, so they imply an indeterministic content and length of the clist. 

[src/gxclrast.c src/gxclrect.c]

2008-07-27T09:38:42.451745Z Igor Melichev

Fix (True Type font loader) : Can't work around unsorted 'loca' when 'loca' is not loaded.

DETAILS :

Bug 689893 "Regression: CID font emulation is broken." 

A work around against unsorted 'loca' and its recent improvements
assume that 'loca' presents in sfnts. It is not true
when a CID font is emulated with a True Type disk font,
because in that case the font machinery delay loading
'loca' and 'glyp' elements until a real request from a document.
For more details see comments added in code.

[src/bfont.h src/zfcid1.c src/gstype42.c src/zfont42.c]

2008-07-27T09:29:37.311275Z Igor Melichev

Fix (PDF interpreter) : A temporary work around huge images with a soft mask.

DETAILS :

Bug 689080 "PDF Crash with Transparency at 2880 dpi".

 
This is a temporary workaraound for the problem,
see comment in code.

With this patch the test case doesn't crash,
but it needs  -dBufferSpace=500000000 to complete in 15 minutes
on Core 2 Duo 2.4 MHz with debug build.
The test case is pretty big anyway - it generates a 4.2 gigapixel raster.

Thankls to Ray for obtaining the buffer space from a device.

I think the old code is incorrect because it looks applying the
mask two times : first when installing a mask buffer with
.begintransparencymaskimage in doimagesmask, and second time when
processing a Type 103 image in C code. The raster difference
is likely caused by that. I don't perform a deeper analyzis,
because it's a temporary fix which needs to be replaced soon.
All that is written in this paragraph are not sure,
because there is no time for a deeper analyzis before 8.63 release.
When we'll complete Type 103 images (with rasterizing after clist
and with a proper handling in pdfwrite), .begintransparencymaskimage
will likely go away.

[lib/pdf_draw.ps]

2008-07-27T07:03:42.852634Z Russell Lang

When building the Windows installer with COMPILE_INITS=1, 
do not include the Resource and lib initialization files as
separate files in the installer zip archive.

[src/winint.mak]

2008-07-27T02:52:11.521293Z Alex Cherepanov

Fix direct access to a subfile in the %rom% file system by reusable
stream. Bug 689976, customers 661, 580.

DETAILS:
1. Open the source file of the reusable stream as a general stream,
   rather than an os-based file stream.
2. Take into account file_offset member when accessing the stream.

[src/zfile.h src/gsiorom.c src/int.mak src/zfrsd.c src/zfile.c]

2008-07-25T22:51:14.900519Z Russell Lang

Change Windows installer to remove "GPL Ghostscript Fonts" target.
Ghostscript now includes fonts in the Resource directory, 
and no longer needs the fonts previously installed in 
"C:\Program Files\gs\fonts".

[src/dwsetup.rc src/winint.mak src/dwsetup.h src/dwsetup.cpp]

2008-07-25T01:10:39.451286Z Alex Cherepanov

Use reusable stream when the data stream of type 0 function doesn't fit into
a string. Bug 689978, customer 770.

[lib/pdf_draw.ps]

2008-07-24T17:28:51.809318Z Ralph Giles

Fix source style warnings from the nightly regression.

[src/aes.h doc/Develop.htm toolbin/clusterpush.sh]

2008-07-24T02:06:07.385871Z Michael Vrhel

Clean up of // comment in code and debug ifdef that should have been removed for r8868

[src/gxiscale.c]

2008-07-24T00:42:06.095459Z Ralph Giles

Change the XYSSL AES implementation to better match our conventions.

[src/aes.h src/aes.c]

2008-07-24T00:42:04.729720Z Ralph Giles

Change the XYSSL AES implementation to build in isolation.

[src/aes.c]

2008-07-24T00:42:02.863201Z Ralph Giles

Replace Brian Gladman's AES implementation with a no-advertising BSD
version from XYSSL 0.9. Used with permission of Christophe Devine.

[src/aes.h src/aes.c]

2008-07-24T00:42:01.337493Z Ralph Giles

Fix some compile problems in Brian Gladman's AES implementation
and disable 'on the fly keying' routines we don't need.

[src/aes.h src/aes.c]

2008-07-23T23:29:39.935990Z Michael Vrhel

Fix for Bug 689246.  When performing interpolation, the interpolation is now performed in the source colorspace as opposed to the device space.  Custom color callback is no longer bypassed by direct concretization as it was previously.

DETAILS:

Previous code would take device color 8 bit values and do the interpolation.  That portion of the code is the same.   For cases where we have nondevice color the handling is now different.  Indexed colors are mapped to their base space and interpolated.  This is followed by a remap operation.  Device independent colors are interpolated followed by a remap operation.  

Note that for cases where there is a significant enlargement occurring and we are not in a device color space, there can be a performance cost due to current inefficiencies in our color remapping operations.  This can be costly if you have a CMYK CRD MLUT for example.  There is currently a project underway to improve the efficiency of the color flow.  For the current time, if this is an issue, improved speed can be achieved by invoking -dNOINTERPOLATION

[src/lib.mak src/gxiscale.c src/gxcolor2.h src/gximage.h src/gscindex.h src/gscolor2.c]

2008-07-23T22:52:50.086155Z Ray Johnston

Fix possible use of uninitialized variable 'mem_space'. Compute the value
when no-transparency is in effect prior to adding in the space needed for
transparency. Thanks to Michael Vrhel for spotting this.

[src/gdevprn.c]

2008-07-23T21:55:21.014656Z Igor Melichev

Fix (graphics) : Write tile id into a pattern clist (continued).

DETAILS :

Bug 689818 "Regression: Test file imagemask-with-pattern.ps fails with banding and pbmraw ".

The last patch appears incomplete, now fifing it.

[src/gxclrast.c]

2008-07-22T21:03:07.709088Z Ray Johnston

Turn off the NOISY 'VERBOSE' setting by default.

[src/rinkj/rinkj-epson870.c]

2008-07-22T18:32:34.998275Z Ray Johnston

Change the default GS_CLIENT_COLOR_MAX_COMPONENTS to 8 (down from 252).
This improves the performance for files with many images. This limits
the number of DeviceN components and the number of separations that
can be generated in the default build and causes 'limitcheck' errors
on CET tests that attempt to set a 250 component DeviceN space.

THIS IS NOT BACKWARDS COMPATIBLE, but the change in ths single file
so this can readily be rebuilt by customers that need more components
or anyone that demands conformance to this implementation dependent
result on the CET. Note that not all Adobe implementations support
250 components as CPSI does.

Currently only the tiffsep and psdcmyk devices can generate more than
8 separations, and then only when USE_COMPRESSED_ENCODING is used to
fit more than 8 components in a 64-bit color value.

This partly reverts rev 7159.

[src/gsccolor.h]

2008-07-22T14:23:25.922113Z Ken Sharp

Fix (pdfwrite): limit checking of CIDfonts for 'fixed width' property.

Details:
Bug 689963 "Infinite loop converting PostScript to PDF"

In fact the loop is not infinite, but it does take a long time. When checking to see if a
font is non-proportional, ie all glyphs have the same width, and the font is a CIDFont, we
did not stop testing when the CID exceeded the maximum CID in the font instance. Instead
we continued to the full CID range (0xffffffff). Because the TrueType code returns a
default for missing glyphs if the font was truly non-proportional then it would take a
long time to search the entire range.

(zfcid1.c): In z11_enumerate_glyph, check the requested CID against the CIDCount for the
font. Return a rangecheck if we exceed it.

I believe only pdfwrite uses this code currently.

[src/zfcid1.c]

2008-07-22T06:24:14.072316Z Igor Melichev

Fix (graphics) : Write tile id into a pattern clist.

DETAILS :

Bug 689818 "Regression: Test file imagemask-with-pattern.ps fails with banding and pbmraw ".

The old code doesn't write a tile id when writing the tile to clist,
because the clist interpreter doesn't use tile id.
This causes a failure after we implemented clist-based patterns.
While playing back a pattrn clist to a page clist writer device, 
the clist writer does need a tile id
for choosing an entry of an internal hash table.

Actually the failure happens due to a strange check 
"tile->id != gx_no_bitmap_id" in 
clist_strip_tile_rectangle in gxclrect.c ln 479.
It is not clear what it was intended for.
When a tile id is zerfo, the check skips writing tile size to clist,
so that a zerodevide happens during the clist playback.
 
We decided to provide meanful ids 
because the clist writer needs them anyway.
Fixing the check to be a subject of a separate patch
(if a fix is really necessary).

This patch simply writes tile id when the clist
is for a pattern. A new nacro IS_CLIST_FOR_PATTERN(cdev)
Defines the condition for that. 
Some internal functions change prototypes
with adding a new boolean argument for_pattern to know
whether a clist is for a pattern.

[src/gxclbits.c src/gxclist.h src/gdevprn.c src/gxclrast.c]

2008-07-21T23:23:13.534369Z Ralph Giles

Update the license statement for Kevin Hartig's hana fonts.

They are now under the SIL Open Font License 1.1 with reserved font
names Calligraphic-Hiragana and Calligraphic-Katakana.

See Bug 688674 for the relicensing declaration.

[lib/Fontmap.GS]

2008-07-21T20:22:21.005889Z Ray Johnston

Remove obsolete and probably non-working support for ancient DesqView (DOS
multi-taksing). This probably should have been dropped when we dropped 16-bit
support.

[src/dvx-tail.mak src/dvx-gcc.mak src/dvx-head.mak]

2008-07-21T18:55:31.311238Z Alex Cherepanov

Wrap string data source into a procedure when /ImscaleDecode filter is
installed, to ensure repeated reading of the string when the imagemask
needs more data than has the string. Allocate new composite objects
with the same global status as old ones. Bug 689889, customer 330.

[lib/gs_img.ps]

2008-07-18T20:53:54.538069Z Ray Johnston

Fix for Seg fault caused by wrap around of an unsigned long. Seen at 600 dpi
to pkmraw with Bug689369.pdf and -dBufferSpace=32000000.

DETAILS:

While the pdf14_trans_buffer_size was small enough, the mem_space calculation
would wrap around.

[src/gdevprn.c]

2008-07-17T20:11:52.225244Z Ray Johnston

Increase the default threshold for using the (much slower) pattern clist accumulator.
The 32Mb threshold is tolerable for most host systems and this can be modified during
the build with -DMAX_PATTERN_BITMAP_SIZE=___ (possibly using the makefile XCFLAGS).

Only embedded systems may want to set this to a smaller value.

This is a temnporary workaround for bug 689966. Improving the performance of the
pattern clist accumulator will be considered a future enhancement.

[src/gxpcmap.c]

2008-07-17T05:51:19.136291Z Ray Johnston

Update documentation to describe multi-threaded rendering (NumRenderingThreads)
and improve the documentation about the clist/banding parameters and the effect
on performance. Addresses issues raised in bug 689668.

[doc/Use.htm doc/Language.htm]

2008-07-17T02:34:01.869133Z Ralph Giles

Write pure white as a background in the pngalpha device. Bug 689934.

Details:

Russell Lang reports this caused problems originally, but it seems to 
work now, so reverting the behaviour per his request.

[src/gdevpng.c]

2008-07-16T17:19:29.238633Z Igor Melichev

Fix (transparency) : A mask buffer could left unreleased due to banding.

DETAILS :

Bug 689944 "Reference to free object".

See comment in code. 

[src/gdevp14.c]

2008-07-16T15:00:17.682927Z Alex Cherepanov

Ignore out-of-range UniqueID in embedded Type 1 PDF fonts. Bug 689973.

[lib/pdf_font.ps]

2008-07-15T20:29:13.383262Z Ralph Giles

Remove the obsolete pnga device. Bug 689971.

This was a test framework used in the development of the PDF 1.4
compositor. It's no longer used.

[src/devs.mak src/gdevpnga.c]

2008-07-15T13:27:29.996709Z Alex Cherepanov

Cache the pattern instance in the PDF pattern object to prevent reprated
pattern instantiation and improve performance. Bug 689896, customer 531.

[lib/pdf_ops.ps]

2008-07-14T18:53:40.636598Z Marcos H. Woehrmann


Allows the Epson AcuLaser device output to be sent to a pipe (closes bug 689953).

Thanks to j@uriah.heep.sax.de (Joerg Wunsch) for the patch.

[contrib/eplaser/gdevescv.c]

2008-07-13T22:06:19.770532Z Henry Stiles

Rop devices now require access to an allocator instance.  Fixes crash
in running pxl fts file T326.BIN with a halftoning device.  The bug
was reported by a potential customer and a bugzilla report was never
filed.

[src/gdevrops.c]

2008-07-12T01:43:13.151852Z Alex Cherepanov

Use /.notdef instead of null in the array of PostScript names of TTF glyphs.
This saves the trouble of checking for null values and fixes a case where
a null entry slipped through. Bug 689962, customer 384.

[lib/gs_ttf.ps]

2008-07-11T23:10:56.624279Z Ralph Giles

Restore the 2_fracs image class to the psl2lib device.

It was inadvertently removed in r8828.

[src/lib.mak]

2008-07-11T23:10:55.549110Z Ralph Giles

Make the search for the most recent ghostpcl revision more robust.
Thanks to Henry Stiles for the extra quoting idea.

[toolbin/clusterpush.sh]

2008-07-11T21:10:49.148153Z Ralph Giles

Merge clusterpush changes from the ghostpcl tree.

[toolbin/clusterpush.sh]

2008-07-11T18:00:13.808434Z Ralph Giles

Check return codes of remote commands and abort if there's a problem.

Previously we continued which could confusingly return the wrong
regression report at the end if the connection drops while waiting
for the run to complete.

[toolbin/clusterpush.sh]

2008-07-11T05:06:07.316809Z Alex Cherepanov

TrueType instruction definitions (IDEF) are addressed by a single byte index. 
So there cannot be mode than 256 different instructions. Nevertheless, a
request a for larger array for instruction definitions should not be a fatal
error. Bug 689960, customer 330.

[src/ttobjs.c]

2008-07-10T23:36:00.202299Z Ralph Giles

Add the so build directories to the clusterpush exclude list.

[toolbin/clusterpush.sh]

2008-07-10T23:35:56.971501Z Ralph Giles

Move the interpolation image class from the ps2 dev to the core graphics
library so it is available to all languages.

[src/lib.mak]

2008-07-10T17:00:39.840394Z Ralph Giles

Documentation update: we support Separation, DeviceN and a number of PDF 1.7 features.

[doc/Language.htm]

2008-07-09T22:59:00.503580Z Alex Cherepanov

Use '%PDF-' instead of '%PDF-1.' to recognize PDF files because PDFsharp 0.8.2
generates '%PDF-0.0' and Acrobat accepts this. Bug 689949, customer 384.

[lib/pdf_main.ps]

2008-07-07T14:17:54.881290Z Ken Sharp

Update the documentation for the NOCIE switch, noting that this also affects the CIEBasedDEF
and CIEBasedDEFG spaces, substituting DeviceRGB and DeviceCMYK for the CIE spaces.

[doc/Use.htm]

2008-07-07T13:43:38.233194Z Ken Sharp

Fix warnings from the JPX decoder when using Visual Studio 9.

Details:
A compiler warning was disabled if the MSVC_VERSION variable was exactly 8, changed to
>7 so that it is also disabled for later versions of the compiler

[src/msvccmd.mak]

2008-07-07T08:56:59.749169Z Ken Sharp

Fix (pdfwrite): Images ina DeviceN space with more than 60 inks caused a crash.

Details:
Bug #689864 "Regression: 09-34.PS core dumps with pdfwrite"

When emitting an image, using the Flate encoder, the number of colorants in 
the DeviceN space was not checked against the maximum permitted. Since the 
encoder uses a fixed buffer whose size depends on the maximum number of inks, this
could cause a write beyond the end of the buffer.

(spngpx.h) Increase the maximum number of colorants to 256
(spngp.c) Return error if the number of colorants in the space
          exceeds the maximum permitted.

I can't check the generated PDF file, as no PDF reader seems able to open a PDF 
file with more than 32 inks, the architectural limit in the current version 
of Acrobat.

[src/spngpx.h src/spngp.c]

2008-07-06T00:45:19.690811Z Ray Johnston

Fix address/value problem. How this ever seemed to work, who knows.
Thanks to Matthias Kilian for this patch.

[src/gdevwts.c]

2008-07-04T20:35:41.686667Z Alex Cherepanov

Fix a bug in the error recovery code that handles invalid font streams.
Bug 689936, customer 661.

[lib/pdf_font.ps]

2008-07-04T18:20:44.681886Z Ralph Giles

Parse common color space keys in JPXDecode filtered images and pass them
to the filter, allowing JPX-encoded CMYK images to display properly.
Fixes bug 688807.

DETAILS:

The fundamental issue is that the jasper library does not support the
ISO 15444-2 (JPX) extensions to the JP2 format for handling full ICC
and CMYK color spaces. So while the the PDF image dictionary and the
JPX streams both specify a CMYK ICC profile describing the image, jasper
ignores the extended colr boxes and marks the image as sRGB + an unknown
component, just based on it having three or more components. Our stream
implementation used this information and tried to return RGB pixels when
the graphics library expected CMYK, causing errors or hangs.

Jasper should be amended to handle these extensions. However, since in
PDF a color space in the image's stream dictionary overrides what is in
the stream, I felt implementing the override was the more useful
resolution.

This patch doesn't handle all color spaces, just Device* and ICCBased,
which are the most common. In the case of ICCBased spaces, we try to
look up the alternate, and use that if it is a Device* space; otherwise
we guess based on the number of components.

[src/zfjpx.c src/sjpx.c]

2008-07-03T18:25:55.494578Z Ralph Giles

Clean up the state machine in s_jpxd_process.

DETAILS:

The state machine didn't always respect the calling conventions for
filter process routines, and could return '0' (more input needed) when
'last' was true (no more input exists).

Also, the jas_stream member of the filter state isn't currently
necessary and has been moved to s_jpxd_decode_image(). Originally
it was envisioned that the jas_stream could seek on the filter's
source ghostscript stream and so would need a longer lifetime than
we're currently using. This has now been simplified to a local variable.

[src/sjpx.c src/sjpx.h]

2008-07-03T18:25:54.527696Z Ralph Giles

Fix a hang in s_jpxd_process. Bug 688807.

DETAILS:

The problem file contains a CMYK JPX stream, which jasper does not
recognize, treating it as sRGB with an extra component. This causes
us to try an return 3-component data, and end up looping forever if
only a fraction of the expected pixel is available at the end of a
line.

Check for this event and return an error instead.

[src/sjpx.c]

2008-07-03T18:25:52.592596Z Ralph Giles

Remove trailing whitespace from the jpx stream implementation.

[src/sjpx_luratech.h src/sjpx.c src/sjpx.h src/sjpx_luratech.c]

2008-07-03T13:03:11.896225Z Igor Melichev

Fix (clist writer) : Indeterminizm writing a degenerate curve.

DETAILS :

Bug 689911 Shifting raster data, Windows MSVC 8 non-debug build. 

In function cmd_put_path the variable 'prev' was wrongly localized 
in the loop body when need to save/pass data from the previous cycle.
It worked fine with debug build, because the compiler 
always commits variables to RAM for debug purpose. 
With release build the variable 'prev' never changes 
because formally speaking the program never uses its value
after it is initialized.

The bug persists since the repository was created on March 9 2000.
The old behavior may be indeterministic.

With MSVC8 the effect is occasionaly visible when a degenerate curve
{x y x y x y x y} is written into clist. 
See the simplified test case attached to the bug report.
 

[src/gxclpath.c]

2008-07-01T10:22:25.835951Z Igor Melichev

Fix (clist writer) : The maximal compositor command size was wrong.

DETAILS :

Bug 689927 "rangecheck in c_pdf14trans_write() causing 'unregistered' error". 

The bug was introduced in revision 8587.
See comments in code.
Thanks to Ray and Marcos for participation.
 

[src/gstparam.h src/gdevp14.c]

2008-06-30T23:56:04.281753Z Ralph Giles

Document the output filename behavior of ps2pdf in the manpage.
Bug 689920.

[man/ps2pdf.1]

2008-06-30T18:15:51.663545Z Ralph Giles

Add a missing header dependency.

[src/lib.mak]

2008-06-30T00:05:40.080596Z Alex Cherepanov

Add one more way to store data of the reusable stream: an array of strings.
Read the input stream into an array of strings during reusable stream
construction and use the array directly as a data storage.
Bug 689476, customer 190.

[src/int.mak src/gxshade.c lib/gs_frsd.ps src/zfrsd.c]

2008-06-28T14:53:32.570212Z Alex Cherepanov

Make /?dblacute and /?hungarumlaut glyph names equivalent in Type 1 fonts.
Add a missing glyph when the font is loaded if another glyph is defined.
Bug 689014, customer 580.

[lib/gs_type1.ps]

2008-06-26T19:17:37.366443Z Alex Cherepanov

Use extended name table by default and adjust the settings to have
up to 1M names of up to 1K characters long. Bug 689913.

[src/inamedef.h src/inameidx.h src/inamestr.h]

2008-06-25T16:18:57.687888Z Marcos H. Woehrmann

Fixed compile for Linux.

[contrib/opvp/gdevopvp.c]

2008-06-24T14:16:29.258940Z Igor Melichev

Fix (graphics) : Clean image enumerator before releasing it.

DETAILS :

Bug 688845 "Segmentation Fault on EPS 2 PDF conversion", comment #38.

Adobe Illustrator creates a Postscript document, 
in which an image data procedure executes 'save',
and the corresponding 'restore' appears after the image end.
DCue to that the image enumerator is freed at a higher save level than
it was allocated, so that gs_free_object works idle. 
Nevertheless pointers must not in the structure,
because they may point to blocks already released
by the client's subclass method for end_image.
Leaving them uncleaned caused a real crash in the garbager - see bug 688845.

The patch defines the new function gs_image_free_enum,
which is intendend for a safe releasing of an image enumerator
from Postscript interpreter.
It cleans the entire subclassed enumerator,
including all possible pointers created by subclasses.
All end_image implementations,
which may be called from Postscript interpreter,
must call this function for releasing image enumerators.

The 'memory' pointer moved from subclasses to gx_image_enum_common.
We believe that in the old code all subclasses define and initialize it.

Working on this patch we suspected memory leaks 
from image enumerators with some devices.
Particularly we suspect that subclasses if gx_device_vector
(pdfwrite, ps2write, etc.) never release image enumerators (not sure).
This patch does not do any attempt to re[pair such leaks, 
because we want the new code doesn't
change the behavour too much in order to simplify the testing.
A work on leaks to be done separately.

[src/gxiparam.h src/gxidata.c src/gsimage.h src/gdevvec.c src/gximage.h src/gximag3x.c src/gdevplnx.c src/devs.mak src/gdevvec.h src/gdevpdfi.c src/gxclimag.c src/lib.mak src/gdevpx.c src/gdevtrac.c src/gdevbbox.c src/gximage1.c src/gximage3.c]

2008-06-22T06:43:28.997699Z Ralph Giles

Rename the svg device to svgwrite to avoid conflict with the SVG interpreter.

The device is still selected as -sDEVICE=svg, just the name used internally
has been changed.

[src/Makefile.in src/gdevsvg.c src/devs.mak]

2008-06-21T14:06:00.424638Z Igor Melichev

Fix (TT interpreter) : A work around a wrong maxPoints.

DETAILS :

Bug 689907 "problem reading PDF: Failed to interpret TT instructions in font 80000001".

The test csae embeds a TT font subset with an incorrect maxPoints.
This is a simple work around that.
 

[src/ttobjs.c]

2008-06-16T16:12:37.522247Z Marcos H. Woehrmann

Updated to latest versions of files from ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/aj16.tar.Z

Closes bug 689735.

[Resource/CMap/UniJIS2004-UTF32-H Resource/CMap/UniJIS2004-UTF16-H Resource/CMap/UniJIS2004-UTF8-H Resource/CMap/UniJISX0213-UTF32-H Resource/CMap/UniJIS-UTF32-H Resource/CMap/UniJIS-UTF16-H Resource/CMap/UniJIS-UTF8-H Resource/CMap/UniJISX02132004-UTF32-H]

2008-06-11T16:24:24.671679Z Michael Vrhel

Undoing change introduced in rev 8794.  This change will need to occur after Bug 689889 is handled.   rev 8749 introduced 37 differences in the regression.  

[src/simscale.c]

2008-06-10T20:37:05.090668Z Michael Vrhel

For bug 689888.  This fixes the hang in the while loop.  If end of file occurs during the reading of the stream it is passed along by the filter.  However, proper output does not occur due to a different issue.  Another bug was opened related to this postscript noncompliance of string reading reuse in imaging operators.  See 689889.  

[src/simscale.c]

2008-06-09T23:02:50.347013Z Ralph Giles

Add a modified version of the clusterpush script from the ghostpcl tree.

[toolbin/clusterpush.sh]

2008-06-09T13:46:08.406410Z Alex Cherepanov

Use a dictionary (instead of an array) to represent cmap table in
a TrueType font because the array cannot accept fonts that have both
0x0 and 0xFFFF codes. Bug 689136, customer 870.

[src/icid.h src/zfcid1.c lib/gs_ttf.ps src/zcid.c]

2008-06-09T07:33:57.606022Z Igor Melichev

Fix (stroking) : Prevent unpainted gaps between neighbour strokes that could appear due to stroke adjustment.

DETAILS :

Bug 687974 "pdf file has banding with ghostscript but not with acrobat". 

The test case includes a gradient, which is represented
as a set of paralel strokes. Due to stroke widths equals to fractional pixels, 
stroke adjustment shifts some of them so that
an unpainted gap appears between strokes and the gradient looks striped.
Note the test document is created with Quark Express 4.11 .

This patch implements a hewristic recognizer for parallel contacting strokes
and suppresses stroke adjustment for them. See comments in code 
for more details.

Note that the recognizer data are associated with a device but they
are not a device property. We store them in a device structure because
we haven't got an associated structure in the graphic state,
and we don't want to introduce one now against extra complexity
with memory management. Also the recognizer code
Appears to be distributed along multiple functions and we would like
to apply a better incapsulation. Nevertheless the encapsulation
would cause CPU time expense for multiple small function calls
unless we create new macros. So commonly we're unhappy of
this code but we don't see a better solution.

Also note that the recognizer data is copied from/to clipper
device when the stroking algorithm installs and deinstalls a clipper.
So the data actually is not a property of a device.
Also they're not a part of graphic state because they must live
across gsave/grestore (the test case requires so). 
 

[src/gsimage.c src/gstext.c src/gxdevice.h src/gdevbit.c src/gspaint.c src/gxclip.c src/gxstroke.c src/gxdevcli.h]

2008-06-05T21:52:58.268146Z Ralph Giles

Remove the executable property from the included fonts.

[Resource/Font/URWPalladioL-BoldItal Resource/Font/NimbusRomNo9L-Medi Resource/Font/NimbusSanL-Bold Resource/Font/Dingbats Resource/Font/URWChanceryL-MediItal Resource/Font/CenturySchL-Roma Resource/Font/NimbusMonL-Bold Resource/Font/URWGothicL-Demi Resource/Font/NimbusSanL-BoldItal Resource/Font/NimbusRomNo9L-MediItal Resource/Font/StandardSymL Resource/Font/URWBookmanL-DemiBold Resource/Font/NimbusRomNo9L-Regu Resource/Font/URWGothicL-Book Resource/Font/NimbusSanL-ReguCond Resource/Font/CenturySchL-Bold Resource/Font/URWBookmanL-Ligh Resource/Font/NimbusRomNo9L-ReguItal Resource/Font/URWBookmanL-DemiBoldItal Resource/Font/NimbusMonL-ReguObli Resource/Font/NimbusSanL-ReguCondItal Resource/Font/CenturySchL-Ital Resource/Font/URWPalladioL-Roma Resource/Font/CenturySchL-BoldItal Resource/Font/URWBookmanL-LighItal Resource/Font/NimbusSanL-BoldCond Resource/Font/NimbusSanL-BoldCondItal Resource/Font/NimbusMonL-BoldObli Resource/Font/URWGothicL-DemiObli Resource/Font/NimbusSanL-Regu Resource/Font/URWPalladioL-Bold Resource/Font/NimbusMonL-Regu Resource/Font/URWGothicL-BookObli Resource/Font/NimbusSanL-ReguItal Resource/Font/URWPalladioL-Ital]

2008-06-05T00:26:20.566472Z Alex Cherepanov

Replace incorrect FontMatrix in CFF CIDFont with a most common value to
recover a PDF file that Acrobat 8 manages to shows correctly. Bug 688517.

[lib/gs_cidfn.ps]

2008-05-31T00:57:34.917939Z Alex Cherepanov

Add work-around for PDF files that misspell 'endobj' as 'endjobj'. Bug 689876.

[lib/pdf_base.ps]

2008-05-30T20:25:17.430208Z Alex Cherepanov

Dom't interpret ^D (0x04) as a self-delimeted character in PDF mode because
PDF doesn't need this hack. Bug 689875.

[src/iscan.c]

2008-05-28T21:52:03.844656Z Igor Melichev

Fix (True Type font loader) : Work around incorrect numGlyphs (continued).

DETAILS :

Bug 689516 "problem reading PDF: Failed to interpret TT instructions (ref 7814)".
Bug 689866 "Regression: with TrueType fonts (possibly related to loca); file Bug688467.ps" 

The last patch appears to cause a conflict with the revision 5707 change.
which introduced a hewristic for reapring fonts with unsorted loca.
When sortinmg the full loca (including glyphs behind numGlyps), the test cases
of bugs 688467 and 688461 cause overlapping glyphs,
so that the hewristic gives a wrong glyph length.

This patch improves the hewristic with checking the glyph length
obtained from the unsorted loca, and replaces it only if it looks incorrect.
f
which may need further adjustments.
 

[src/gstype42.c]

2008-05-28T18:16:26.144495Z Ralph Giles

Correct properties.

[src/sidscale.h src/sjbig2_luratech.h src/sjpx_luratech.h src/sidscale.c src/sjbig2_luratech.c src/sjpx_luratech.c]

2008-05-28T16:04:01.772433Z Marcos H. Woehrmann

Changed crlf to lf.

[src/sidscale.h src/sidscale.c]

2008-05-28T02:38:35.559910Z Alex Cherepanov

Fix a typo introduced in the rev. 8146 that prevented running PDF files from
stdin. Bug 689847.

[lib/pdf_main.ps]

2008-05-28T00:27:23.734030Z Michael Vrhel

Fix to enable proper custom color callback when indexed images with ICC profiles are used.  Bug 689863.

[src/lib.mak src/gscolor2.h src/gxcie.h src/gsciemap.c src/gscolor2.c]

2008-05-27T20:12:08.164024Z Michael Vrhel

Addition of debug code to dump embedded ICC profiles for external analysis.  

[src/gsicc.c]

2008-05-27T17:07:40.221072Z Alex Cherepanov

Enable printafm to emit a comment with UniqueID, that may be of some use when
investigating versions of fonts used. Thanks to Michail Vidiassov for the
patch. Bug 688610.

[lib/printafm.ps]

2008-05-26T19:04:05.563476Z Ralph Giles

Work around broken JBIG2Decode streams created by several versions of
Xerox WorkCentre. Bugs 689841 and 689852.

In these streams, a segment data length field is written as -1
expecting the decoder to infer it from the length of the remaining
data.

[jbig2dec/jbig2_page.c]

2008-05-25T07:28:53.119264Z Igor Melichev

Fix : MSVC warnings.

DETAILS :

Removed an extra debug printing that prints an unutialized variable.
 

[src/gdevpx.c]

2008-05-25T07:23:38.027951Z Igor Melichev

Fix (True Type font loader) : Work around incorrect numGlyphs.

DETAILS :

Bug 689516 "problem reading PDF: Failed to interpret TT instructions (ref 7814)".

The bug report supplies a PDF document, which embeds a TT font
with a too small numGlyphs. The loca table contains more glyphs and 
they are referenced in a text. The font is incorrect, but Acrobat handles the document.

This patch checks whether there are glyphs behind numGlyphs and 
extends numGlyphs to cover them. Also improved error handling in ttfmain.c .

Besides that, now we print a warning about an incorrect numGlyphs
in release build. The olkd code did with debug buil only.
I believe that users need to know whether a font is broken, and that
its rendering is hewristic.
 

[src/gstype42.c src/ttfmain.c]

2008-05-25T05:45:15.665594Z Alex Cherepanov

Revert the rev. 8509 because it is not needed after rev. 8774 but interferes
with FONTPATH search and memory font resources. Bug 689637.

DETAILS:
Since embedded PDF fints are now not registered as resources, there's no
need to distinguish between disk and memory font resources. Embedded fonts
bypass resource machinery; non-embedded fonts are loaded by name.
 

[lib/pdf_font.ps src/zfont.c]

2008-05-25T04:28:23.450067Z Alex Cherepanov

Continue the changes started by the rev. 8772. Remove one more definefont from
embedded TrueType font loader. Bug 689644, customer 243.

[lib/gs_ttf.ps]

2008-05-25T02:17:14.504731Z Alex Cherepanov

Change all shell scripts to treat a single dash '-' as a positional
parameter rather than an option. Bug 689846.

[lib/eps2eps lib/ps2ps lib/dumphint lib/ps2ps2 lib/dvipdf lib/pdfopt]

2008-05-23T05:05:20.013100Z Alex Cherepanov

Use embedded PDF fonts directly. Don't define them as resources and look them
up later by the name. Leave findfont operator for fetching non-embedded fonts
only, which are now unaffected by embedded fonts. Bugs 689510, 689514 from
customer 700.

DETAILS:
CIDFont resources should be handled in a similar way but this part
is not yet implemented.

[lib/pdf_font.ps lib/pdf_ops.ps]

2008-05-23T00:13:50.314402Z Ralph Giles

Implement sync_output as cairo_flush. Patch from Behdad Esfahbod.

[src/gdevcairo.c]

2008-05-22T18:06:22.983939Z Igor Melichev

Enhancement (graphics) : Delay applying type 1 raster patterns until clist interpretation (continued 4).

DETAILS :

The old code assumes that a pattern always fits into the clist writer buffer.
However ppmraw -r400 176-01.ps violates this assumption.
This patch implements a subdivision of a pattern into slices,
each of which is smaller than the buffer size.

1. The new function cmd_get_buffer_space retrives maximal available space
   in the clist writer buffer (gxclutil.c).

2. cmd_put_drawing_color now implements a cycle for slicing big patterns.
   Each slice writes to clist as a separate clist instruction (gxclpath.c).

3. gx_dc_pattern_write_raster drops the constraint that the pattern
   fits into a single buffer (gsptype1.c).

4. The clist interpreter is enhanced with composing a pattern from slices
   (gxclrast.c).

[src/gsptype1.c src/gxcldev.h src/gxclrast.c src/gxclpath.c src/gxclutil.c]

2008-05-22T09:52:18.876353Z Igor Melichev

Enhancement (graphics) : Delay applying type 1 raster patterns until clist interpretation (continued 3).

DETAILS :

Bug 689856 "Regression: 09-34.PS core dumps when banding".

Uninitialized fields in device color after restoring a pattern from clist.
Debugged with
..\..\gs-hd\bin\gswin32c.exe -IF:/AFPL/gs-hd/lib;f:\afpl\fonts -r300 -K1000000 -dMaxBitmap=10000 -dNOPAUSE -dBATCH -sDEVICE=pbmraw -sOutputFile=cur.ppm H:\AuxFiles\CET\09-34.PS

[src/gsptype1.c]

2008-05-21T19:46:53.581581Z Ray Johnston

Change parameters to gdev_prn_allocata_mesmory to explicit width and height to work
around a (suspected) bug in gdev_prn_allocate when new_width and new_height are 0
and the page has transparency. That issue will be adddressed separately.
Crash with multi-threaded rendering reported by customer #850.

[src/gxclthrd.c]

2008-05-21T19:46:47.112573Z Ralph Giles

In r8765 we concluded GS_IMAGE_MAX_PLANES was the same as
MAX_COMPONENTS. Make this change permanent by removing the
MAX_PLANES define entirely.

[src/gsimage.c src/zimage.c src/gxiparam.h src/gdevbbox.c src/gxidata.c src/gximage.c src/gsiparam.h src/gxclimag.c]

2008-05-21T19:46:43.711424Z Ralph Giles

Remove the lowercase "compatibility" versions of the GS_IMAGE_MAX_*
macros.

[src/zimage.c src/gdevtxtw.c src/gsimage.c src/gxiparam.h src/gxidata.c src/gximage.c src/dxmainc.c src/gdevpdtv.c src/gdevpdfb.h src/gdevpdtv.h src/macsystypes.h src/gdevmacttf.h src/gp_mac.h src/gxclimag.c src/iimage.h src/gxsamplp.h src/gdevmacxf.c src/gdevmac.c src/gsiparam.h src/gdevmac.h]

2008-05-21T19:05:31.529144Z Ray Johnston

Reduce the GS_IMAGE_MAX_PLANES to a sane number. The image cannot have more
planes than the number of CLIENT_COLORS we support (plus 1 for alpha).
This cures a stack overflow seen with the multi-threaded rendering on
Windows.

[src/gsiparam.h]

2008-05-21T18:27:42.905572Z Michael Vrhel

Fix for 689811.  Enables custom color callback when banding of images is occurs.

DETAILS:
This was a simple fix which puts the callback structure address into gslib_ctx instead of in the graphic state.  This fixes the customer's issue.  The postscript interface for custom color remains as it was with this commit.  Soon, in the future, we will be changing to a C API interface.  There does remain an issue with respect to object type tagging.  If high level images occur with banding, the object type is different than if there was no banding.  Opening a new bug in regard to this.

[src/gsnamecl.h src/gslibctx.c src/gxcmap.c src/iapi.c src/gslibctx.h src/gsncdummy.c src/gsciemap.c src/gscspace.c src/gsicc.c src/gscdevn.c src/gsnamecl.c src/gscie.c]

2008-05-21T18:13:13.037917Z Ralph Giles

Credit Behdad in the source.

[src/gdevcairo.c]

2008-05-21T13:42:08.542151Z Igor Melichev

Fix (Type 1 hinter) : The missed flex hewristic malfunctioned.

DETAILS :

Bug 689821 "SegFault in gxhintn.c".

The old code is buggy with a wrong index advance along a cyclic buffer range.

[src/gxhintn.c]

2008-05-21T10:12:14.199391Z Igor Melichev

Enhancement (graphics) : Delay applying type 1 raster patterns until clist interpretation (continued 2).

DETAILS :

Bug 689848 "C stack overflow on Windows and hang on linux 176-01.ps".

A patch from Ray, which eliminates an infinite recursion in the clist writer.
A further improvement is coming soon about noodling the big data 
while copying a pattern into a page clist.

[src/gxclutil.c]

2008-05-21T06:46:41.280250Z Ray Johnston

Ensure that the chunk wrapper is used on the non_gc allocator since doing GC
on chunks will be disastrous. This is protection only and causes no difference
since the only current client of the chunk wrapper is the multi-threaded clist
rendering which wraps non_gc_memory.

[src/gsmchunk.c]

2008-05-21T06:40:14.466289Z Ray Johnston

Upon one of our engineer's request, clean up the MSVC warning about use of an
uninitialized variable.

[src/gxclthrd.c src/gxclist.h src/gxclread.c]

2008-05-21T06:35:34.826889Z Ray Johnston

Add some missing information for the clist multi-threaded rendering files and
the chunk memory wrapper. This cleans up (som of) the nightly regression nags.

[doc/Develop.htm]

2008-05-21T01:37:08.729158Z Ralph Giles

Fix the autoconf build when libcairo isn't available.

The device properly disabled in r8752.

[src/configure.ac]

2008-05-21T01:26:49.215021Z Ralph Giles

Set properties on the new cairo device source file.

[src/gdevcairo.c]

2008-05-21T01:24:45.439819Z Ralph Giles

Whitespace cleanup. Also comment out the warning about setlogop; this
isn't important for most documents.

[src/gdevcairo.c]

2008-05-21T01:24:44.147836Z Ralph Giles

Don't compare a NULL extension string.

[src/gdevcairo.c]

2008-05-21T01:24:42.046903Z Ralph Giles

Rename the cairo device parameter CairoSurface to CairoOption.

Better handling of libcairo errors.

Add (untested) support for passing a libcairo context pointer
through the CairoContext device parameter for rendering to a
client drawable.

Details:

CairoSurface was renamed with the expectation that it will in
the future take additional options that might not be surface
specific. Also, the CairoSurface name was chosen with the idea
that a client could pass a pointer to an already allocated
cairo_surface_t, but it's just as easy to pass the result
of calling cairo_create() on such a surface as a context
pointer. Therefore we've added CairoContext and renamed the
old CairoSurface parameter to CairoOptions.

The new command line would be:

 gs -sDEVICE=cairo -sCairoOptions=ps -o - test.ps

to set the output format to ps.

[src/gdevcairo.c]

2008-05-21T01:24:40.923940Z Ralph Giles

Protect the use of pkg-config for libcairo.

[src/configure.ac]

2008-05-21T01:24:38.762206Z Ralph Giles

New 'cairo' output device using the libcairo graphics library.
Patch by Behdad Esfahbod.

Details:

This output device uses the LGPL cairo library to create file output in
a variety of formats. Currently supported are png, svg, pdf, ps, eps.

The output format can be specified with the CairoSurface device
parameter. If this parameter isn't set, the device will guess
based on the filename extension given in OutputFile. Thus, these
two command lines are equivalent:

gs -sDEVICE=cairo -sCairoSurface=svg -o tiger.svg examples/tiger.eps
gs -sDEVICE=cairo -o tiger.svg examples/tiger.eps

Other output formats are selected like so:

gs -sDEVICE=cairo -o tiger.png examples/tiger.eps
gs -sDEVICE=cairo -o tiger.pdf examples/tiger.eps
gs -sDEVICE=cairo -o tiger.ps examples/tiger.eps

Only vector drawing is implemented at this point; images and text are
handled by fallback and will not give compact results. The resolution
for rasterization is set by the -r parameter as usual.

[src/Makefile.in src/configure.ac src/gdevcairo.c src/devs.mak]

2008-05-20T20:34:52.772461Z Ray Johnston

Add double inclusion protection to cure nag from nightly regression.

[src/gsmchunk.h src/gxclthrd.h]

2008-05-20T16:18:40.306550Z Ray Johnston

Clean up properties to get rid of nightly regression warnings.

[src/gsmchunk.c src/gxclthrd.c src/gsmchunk.h src/gxclthrd.h src/gdevsvg.c]

2008-05-20T00:52:25.121469Z Alex Cherepanov

Consider Index object in CFF font as empty if the offset element size is
incorrect. Bug 689854, customer 580.

DETAILS:
The rationale behind this decision is that the index is, probably,
not used when it is malformed but the file survives in the wild.

[lib/gs_cff.ps]

2008-05-19T14:47:52.443966Z Igor Melichev

Enhancement (graphics) : Delay applying type 1 raster patterns until clist interpretation (continued).

DETAILS :

Bug 689807 "segfault with 09-34.PS".

The last patch for the subject appears incomplete.
This one allows to write and read null patterns.
Debugged with 09-34.PS .

[src/gsptype1.c]

2008-05-17T21:33:47.003946Z Alex Cherepanov

Permit opening of temporary files in the safe mode. Fix /invalidaccess
error during interpretation of PDF 1.7 file collections in the safe mode.
Bug 689847.

[lib/pdf_main.ps src/zfile.c]

2008-05-17T12:58:01.814886Z Alex Cherepanov

Ignore annotation appearance stream when it has a wrong type i.e. not a
dictionary. Bug 689839.

[lib/pdf_main.ps lib/pdf_base.ps lib/pdf_draw.ps]

2008-05-17T01:02:02.764582Z Alex Cherepanov

Replace various access techniques to PDF annotations with 'knownoget'
in preparation to fix the bug 689839.

[lib/pdf_draw.ps]

2008-05-16T23:34:14.372367Z Ralph Giles

Add support for linecap/join and miterlimit.

[src/gdevsvg.c]

2008-05-16T12:48:24.645580Z Alex Cherepanov

Use PDFScanRules to scan ToUnicode CMap. Fix a case where CMap stream has
a name starting with 2 slashes that should not be parsed as an immediately
evaluated name. Bug 689642, customer 870.

[lib/pdf_font.ps lib/pdf_base.ps]

2008-05-16T00:05:42.149140Z Ralph Giles

Accumulate imaging state changes and write a new group only when
drawing. Add support for the linewidth parameter. We're pretty
close to properly handling tiger and other vector-only files.

[src/gdevsvg.c]

2008-05-16T00:05:41.073469Z Ralph Giles

Correct stroke and fill attribute overrides based on the path type.

Also includes some whitespace cleanup.

[src/gdevsvg.c]

2008-05-16T00:05:40.066267Z Ralph Giles

Store clipping rectangles as a clip path and ignore other non-drawing
paths.

[src/gdevsvg.c]

2008-05-15T21:24:13.840635Z Ralph Giles

Set the document size and scale based on the page size and resolution
from the device parameters.

[src/gdevsvg.c]

2008-05-15T21:24:12.705572Z Ralph Giles

Return proper negative error codes on allocation failure.

Also some minor formatting.

[src/gdevsvg.c]

2008-05-15T21:24:11.342484Z Ralph Giles

Be explicit about clearing the current fill or stroke color when
none is set.

[src/gdevsvg.c]

2008-05-15T16:17:48.102316Z Michael Vrhel

Fix for previous commit.  I had the wrong version number test in the define.

[jbig2dec/config_win32.h]

2008-05-15T16:12:17.999197Z Michael Vrhel

Minor change in JBIG configuration file related to using Visual Studio Version 9 (2008).  stdio.h has a definition for vsnprintf which conflicts with the define in config_win32.h

[jbig2dec/config_win32.h]

2008-05-15T00:00:24.616940Z Marcos H. Woehrmann

Improve white-on-mask drawing mode.

Details:

This patch is provided by Hin-Tak (see bug 688372); his comments:

This is a patch which I have created, to make the pxlmono/pxlcolor driver
bebaves much better in the white-on-mask situation, without breaking
normal drawing.

I haven't quite work out all the details nor understand the
reverse-mask-draw code properly yet, but this patch improves the situation
a great deal, to the point all the icons are shown correctly except for
having its background draw solid white rather than transparent


[src/gdevpx.c]

2008-05-14T23:49:09.954483Z Marcos H. Woehrmann


Add support to pxlcolor and pxlmono for 24 bpp images.

Details:

Previous to this revision the pxlcolor and pxlmono devices would revert
to using gx_default_begin_image() when bits_per_pixel==24, resulting
in very large images.  Now the image data is written directly into the
pxl stream.  In the case of pxlmono the image is converted to 8 bpp via
the lum_*_weight values from gxlum.h.


[src/gdevpx.c]

2008-05-13T19:52:08.912983Z Ralph Giles

Fix an incorrect curveto coordinate.

[src/gdevsvg.c]

2008-05-13T18:47:23.939753Z Ralph Giles

Disable drawing in the SVG output device after the first output_page call.

Even for single-page output we receive an erasepage fill after the showpage
from gdevvec, which overwrites whatever we've drawn. This should be avoided
in a more sophisticated way (ideally in the superclass) but this method is
helpful for current development.

[src/gdevsvg.c]

2008-05-13T18:47:23.279847Z Ralph Giles

Support setting stroke and fill colors.

[src/gdevsvg.c]

2008-05-13T18:47:21.967012Z Ralph Giles

Import the current state of the svg driver. Doesn't work.

[src/Makefile.in src/gdevsvg.c src/devs.mak]

2008-05-13T03:58:10.005759Z Alex Cherepanov

Reduce generation of garbage and the time spent on garbage collection by
placing gstate into the 2nd element of the patterm implementation array
in Adobe compatibility mode only. Ghostscript doesn't use this gstate
at all. Bug 689488.

[lib/gs_lev2.ps src/zmisc.c]

2008-05-11T17:00:17.181464Z Alex Cherepanov

Fix a bug that leaves a junk value on the stack for every empty row on the
page during execution of a redefined showpage. Bug 689832.

DETAILS:
The bug was introduced in rev. 2602 and stayed undetected for a while because
most files don't depend on the contents of the operand stack after executing
showpage.

[lib/ps2epsi.ps]

2008-05-10T22:02:03.546959Z Alex Cherepanov

Ignore OutputIntent attribute if it is not an array; recover a broken PDF file.
Bug 689831.

[lib/pdf_main.ps]

2008-05-09T16:44:54.615805Z Ray Johnston

Fix missing dependency that caused builds that included the 'bmpa' devices
to fail because the locking memory code wasn't included. Currently PCL
builds still had the bmpa devices included, so they failed.

[src/lib.mak]

2008-05-09T14:00:44.027651Z Ralph Giles

uncodes 33 and 34 repeat a zero code length symbol id, not the previous
symbol like runcode 32. Bug 689824.

Thanks to Justin Greer for the fix.

[jbig2dec/config.h jbig2dec/configure jbig2dec/jbig2_text.c]

2008-05-09T04:12:01.814716Z Alex Cherepanov

Reject incorrect ICC profile that has 0 offset in one of the tags
and use alternate color space. Bug 689830.

[icclib/icc.c]

2008-05-09T02:18:14.475665Z Ray Johnston

This is the "final" merge of the mtrender (multi-threaded clist rendering)
branch into the trunk. The default behavior is still the same, i.e., the
clist rendering is done in the same thread as the parsing (main thread).

The 'gsmalloc' memory allocator now ALWAYS uses a mutex to lock accesses
in case it is used by a multi-threaded client. This was determined to
result is less than 1% performance hit on a single threaded client.

Refer to the log messages on the mtrender branch for details on the
design of the multi-threaded clist rendering, but the summary is that
-dNumRenderingThreads=# (default 0) determines the number of background
threads REQUESTED for rendering bands. If the platform doesn't support
threads, or if there is an error starting the threads from the clist_
get_bits_rectangle_mt hook, single threaded rendering will be used.

The number of threads may be less than the requested number if the
number of bands is less than the request, or if there is an error
setting up threads (as many as can be created, up to the request will
be used). The -Z: debug switch emits status messages indicating how
many threads are requested (-dNumRenderingThreads) and the number that
is actually used.

Many files show little if any improvement with multi-threaded clist
rendering since they are dominated by the clist writing time, or by
the time required to write the output. No files seen to date show a
performance hit greater than aobut 3%. Setting NumRenderingThreads
to a count higher than the number of CPU cores available does not
seem to help or hurt much, but there is overhead (per page) with
starting threads and allocating band buffers, so a very large count
is not productive.

The best performance seen on an Intel Core 2 Duo system, on a
particular file is about a 75% performance improvement (completing
the page in 57% of the single threaded time). This time did not
include writing a file (output to /dev/null).

In order to prevent memory mutex (locking) contention from slowing
down multi-threaded clist rendering, each thread uses a 'chunk'
wrapper on NON-GC the non-gc memory allocator. Each chunk allocator
is thread-safe/instantiated, so the locking only occurs on chunk
allocations to the wrapped (target) memory allocator.

The 'BAND_LIST_STORAGE=mmeory' option has been supplemented to allow
multiple concurrent threads to read the clist 'memfile'.

The "autoconf" files (configure.ac and Makefile.in) have been improved
to hook the 'posix' pthreads if available, so linux and Mac OS/X will
be able to support the multi-threaded clist rendering.

[src/gxclist.c src/gsmemlok.c src/gsmchunk.c src/gxclthrd.c src/gxclist.h src/configure.ac src/gsmchunk.h src/gxclthrd.h src/gxclread.c src/lib.mak src/gxclmem.c src/gxclmem.h src/gsmalloc.c src/Makefile.in src/gdevprn.c src/gsmalloc.h src/gdevprn.h]

2008-05-08T21:47:07.355557Z Ray Johnston

Use 'realtime' instead of 'usertime' for -Z: timing information. On some
systems (Windows) these are equivalent, but on linux, 'usertime' is the
time for the current thread which interferes with timing collection on
different threads (multi-threaded rendering did not include any time for
the threads). INCOMPATIBLE CHANGE, but this is only debug info.

[src/imain.c]

2008-05-08T21:28:30.163536Z Ray Johnston

Allow some compile time constants that affect performance to be set as
/D compiler flags (via XCFLAGS makefile macro).

MAX_BITMAP_PATTERN_SIZE controls when the clist pattern accumulator is used,
and on machines with a decent amount of RAM, the default of 1 Mb is too
small and causes the slower clist method to be used too often. Setting this
to 32 Mb is probably better on hosts.

The GS_CLIENT_COLOR_MAX_COMPONENTS default of 252 is needed for Adobe CPSI
compatibility and for RIPS that want to use a large number of DeviceN
colorants, but this increases the size of some allocations and slows down
performance and is much too large for printers. Setting this to 6 or 8 is
probably plenty.

[src/gxpcmap.c src/gsccolor.h]

2008-05-08T20:09:32.433652Z Ray Johnston

Fix MSVC warning -- mismatched type.

[src/zchar42.c]

2008-05-08T19:56:33.932490Z Ray Johnston

Fix gcc warnings, unused variables and type mismatch, implicit declaration.

[src/gximask.c src/gp_unix.c]

2008-05-08T19:35:26.683268Z Ray Johnston

Clean up gcc compiler warnings for unused 'st' and no prototype for
gx_pattern_cache_free (from gxpcolor.h).

[src/gxclrast.c]

2008-05-08T19:10:40.329127Z Ray Johnston

Add support for recursive mutex on posix. Multiple threads that perform
'locking' before calling an object's finalize need this to prevent
deadlock if the finalize calls 'free'. This protection is standard on
Windows, but PTHREAD_MUTEX_RECURSIVE attribute is not available on
many systems.

The method, using pthread_self and pthread_equal, was extracted from
a web information page and tested on linux.

NB: The multi-threaded clist rendering no longer needs this since
the 'chunk' memory wrapper calls the 'finalize' function without
locking, so the deadlock no longer occurs.

[src/gp_psync.c]

2008-05-08T18:56:10.922303Z Ray Johnston

Fix memory leak observed with DEBUG=1 build on mtrender branch. The
'levels' and 'bit_data' of halftones were being leaked when halftones
were set by the clist reader.

DETAILS:

Since the 'dht.rc' was filled with 0's, the rc.memory would cause the
gx_imager_dev_ht_install to copy the order (mem_diff would be true).
The gx_ht_copy_ht_order would make a copy, but the one passed in
was never freed. Since the 'src' component information was cleared
during the install, gx_ht_read_and_install needs to save a copy of
the components so that the orders can be released.

[src/gxdhtserial.c]

2008-05-08T18:40:31.637800Z Ray Johnston

Fix compiler warning due to missing prototype for strncmp.

[src/zchar42.c src/int.mak]

2008-05-07T21:07:53.236295Z Igor Melichev

Enhancement (graphics) : Delay applying type 1 raster patterns until clist interpretation.

DETAILS :

Bug 689579 "Ghostscript generates a very, very large temporary file".

The old code converts pattern fills into lots of constant color rectangles while writing to clist.
The new code writes pattern data to clist and apply pattern during the clist playback.
So here we complete the change started in revision 8655.

New functions gx_dc_pattern_write_raster, gx_dc_pattern_read_raster
implement color serialization for raster patterns.
The old function gx_dc_pattern_write got minor changes about buffer localization.

Minor chabge (gxclimag.c, gxclpath.c, gxclrect.c) : Propagated error codes.

Also fixed a bug occasionally found in gxclrast.c . 
It caused a crash in some unusual conditions.

[src/gsptype1.c src/gxclrast.c src/gxclpath.c src/gxclimag.c src/gxclrect.c]

2008-05-07T21:02:16.625138Z Igor Melichev

Fix (graphics) : Wrong pattern phase when pattern applies to a band with non-zero origin.

DETAILS :

The old code computes pattern phase modulo rep_width, rep_height.
It appears wrong when pattern step is much bigger than the pattern bbox.
Really the bbox determines the painting area as rep_width, rep_height,
but the phase to be computed modulo pattern step.
Besides that, the old code aplies a wrong sign, which is oposite to a band offset.

This bug has no effect with Postscript interpreter, because 
currently patterns never apply after banding,
but it will change with the next patch.
With no banding the phase is always zero.

Other interpreters may need additional improvements
(we suspect they are bug-to-bug compatible).

[src/gsptype1.c]

2008-05-07T09:15:27.593615Z Igor Melichev

Fix (graphics) : Imprecise pattern phase with negative cell origins (continued).

DETAILS :

The old code inaccurately converts floats to integers.
The problem here is that (int)-0.13 == 0 but the math wants -1.
It causes a 1 pixel bias with negative coordinates when argument is not integer.
This isn't a first time when we fix a bug of this kind,
and likely this one is not the last.

This change is important for bug 689579.

Debugged with the following commands :

gswin32c.exe -dMaxBitmap=22000000  -r300 -dNOPAUSE -dBATCH-sDEVICE=ppmraw -sOutputFile=cur-b.ppm 245-07.ps
gswin32c.exe -dMaxBitmap=100000000 -r300 -dNOPAUSE -dBATCH-sDEVICE=ppmraw -sOutputFile=cur-n.ppm 245-07.ps

They must render same raster, but they didn't.

[src/gxp1fill.c]

2008-05-07T06:25:34.508384Z Alex Cherepanov

Repait yet another broken PDF file that abbreviates /Indexed to /I
in the color space array. Bug 689815.

[lib/pdf_draw.ps]

2008-05-06T20:59:54.208603Z Alex Cherepanov

Fix and simplify implementation of operator Q. Collecting the path with
the current ctm and re-playing it with the restored ctm transforms the
path exactly as PDF needs. Bug 689812.

[lib/pdf_ops.ps]

2008-05-05T19:51:17.293996Z Ray Johnston

Eliminate leaks caused by lost 'maskbuf' elements. Only the uppermost
maskbuf is (currently) used by the pop_transparency_group that applies
the mask, but the chain of maskbuf->maskbuf elements was never freed.
This also improves performance (at least for the test case of bug
689534). Customer #870.

[src/gdevp14.c]

2008-05-02T20:13:50.255816Z Igor Melichev

Fix (graphics) : Imprecise pattern phase with negative cell origins.

DETAILS :

The old code inaccurately converts floats to integers.
The problem here is that (int)-0.13 == 0 but the math wants -1.
It causes a 1 pixel bias with negative coordinates when argument is not integer.
This isn't a first time when we fix a bug of this kind,
and likely this one is not the last.

This change is important for bug 689579.
Here is a test for debugging it :

<<
  /PaintType 1
  /PatternType 1
  /TilingType 1
  /BBox [0 0 60 60]
  /XStep 40
  /YStep 60
  /star
  { gsave
    0 12 moveto
    4
    { 144 rotate
      0 12 lineto
    } repeat
    closepath
    fill
    grestore
  }
  /PaintProc
  { begin
    1 0 0 setrgbcolor
    15 15 translate
    star
    0 0 1 setrgbcolor
    30 30 translate
    star
    0 1 0 setrgbcolor
    -30 0 translate
    star
    30 -30 translate
    star
    end
    %.break
  } 
>>
[1 0 0 1 0 0]
makepattern
/Star4 exch def

/Pattern setcolorspace
Star4 setcolor

clippath pathbbox 
exch pop 30 exch
4 copy = = = =
rectfill

showpage

The old code gives different rasters for this test while banded and unbanded rendering.

[src/gxp1fill.c]

2008-05-02T08:07:50.475340Z Ken Sharp

The revision 8621 which reinstated the comments, and updated encs2c.ps to generate them,
placed the Id line in the wrong position relative to the licence and summary comments.

[toolbin/encs2c.ps src/gscedata.h src/gdevpdtv.c src/gdevpdtv.h src/gscedata.c]

2008-05-02T02:19:57.012115Z Ralph Giles

Remove the testing instructions and file index.

This was mostly obsolete, and the automated tests are fairly complete now.

[doc/Testing.htm doc/Readme.htm toolbin/tests/check_docrefs.py]

2008-05-02T01:42:14.506521Z Ralph Giles

Fix various code policy warnings.

[toolbin/msvcxml.bat src/gdevdjet.c src/aes.h toolbin/memory.py src/aes.c]

2008-04-30T19:06:59.803995Z Ralph Giles

Fix some warnings.

[src/gsncdummy.c]

2008-04-30T04:51:02.115275Z Michael Vrhel

Fixed issue with NULL pointer in gsncdummy.c when ICC color space was used in custom color callback.  Also, made the object based coloring an option define and fixed minor header issues.

[src/lib.mak src/gxcmap.c src/gsncdummy.c src/gscspace.c src/gscdevn.c src/gsnamecl.c]

2008-04-30T01:35:18.247997Z Ralph Giles

Fix some warnings.

[src/gdevp14.c]

2008-04-29T06:34:17.581619Z Michael Vrhel

Fix for bug 689806 which was introduced when fixing bug 689803.  The current bug was related to a CIELAB image with a colorspace ICC profile (LAB to LAB).  The image data was incorrectly being normalized between 0 and 1 (float). It is now properly normalized to the range of the CIELAB ICC space.  There still exists an issue with this file as absolute colorimetry should be used.  This is the source of the current difference between AR and GS.  However, the image is no longer black now but should match the GS result prior to rev 8664.

[src/lib.mak src/gxicolor.c]

2008-04-29T00:31:25.778368Z Alex Cherepanov

Make pf2afm utility friendlier to Windows users: check for .pfa or .pfb
extensions case-insensitively and accept backslash as a path separator.
Bug 689804.

[lib/pf2afm.ps]

2008-04-28T17:48:26.844493Z Alex Cherepanov

Refine calculation of di member of a trap_line structure to avoid integer
overflow when the source operands are big. Bug 689448.

[src/gdevddrw.c]

2008-04-28T16:26:35.071571Z Ralph Giles

Fix a minor header dependency skew.

[src/int.mak src/gsicc.c]

2008-04-28T06:47:28.650051Z Michael Vrhel

Undo accidental commitment of ENABLE_CUSTOM_COLOR_CALLBACK (has callback) code.

[src/gsicc.c]

2008-04-28T05:20:54.026239Z Alex Cherepanov

Implement spacial handling of transfer functions during Gray to CMYK
conversion: ignore transfer functions for non-black components. Bug 688360.

DETAILS:
On this topic, section 7.3 of PRLM-3rd (page 494) says:
"Note: When the current color space is DeviceGray and the output device's
native color space is DeviceCMYK, the interpreter uses only the gray transfer 
function. ... This special case exists for compatibility with existing
applications." There is a similar comment in section 6.3 of the PDF 1.6
spec. (page 456).

[src/lib.mak src/gxcmap.c src/gxcspace.h src/gscspace.c src/gxdevcli.h]

2008-04-27T15:21:10.051210Z Alex Cherepanov

Check the error code early. Fix a SEGV in PDF file with invalid ICC profile
that was introduced by the rev. 8664.

[src/zicc.c]

2008-04-26T04:35:56.962801Z Michael Vrhel

Fix for bug#689803.  Set bounds correctly when input data is LAB and color also includes a colorspace source profile (e.g. LAB to LAB).  

[src/int.mak src/gsicc.c src/zicc.c]

2008-04-23T14:06:11.166309Z Igor Melichev

Fix (graphics) : Convert imagemask into a clipping path when painting a big pattern.

DETAILS :

Bug 689440 "PostScript file generates infinitely large temp file".

In the past we implemented a conversion of imagemask intoi a clipping path 
for a faster painting a shading color. Now we do same for big type 1 patterns.

1. Enhanced the condition in gximask.c for passing big patterns.

2. In gximask.c filter out degenerate rectangles, 
   which can't be painted with gx_device_color_fill_rectangle.

3. Set a pure black color in gsimage.c, 
   because patterns can't convert with gx_device_black.

4. In gxacpath.c added the default copy_mono method 
   to the clip list accumulator device in order to handle 
   imagemask with the pure color set by (3).

5. In gximask.c added a proper setup of device width and height
   to clip list accummulator, because gx_default_copy_mono needs them.

6. In gximask.c gx_device_retain is now called on errors.
   The old code does not call it, and we think it caused memory leaks
   in some rare cases.

This patch changes the behavior with shadings, because the old code paints
imagemask with the shading color to clip list accummulator.
The new code does with pure black, so that now the clipping is not
restricted with the shading area or the shading BBox.
But we believe that the final result should be same 
and the performance should be some faster.

Note we keep the call to gx_dc_pattern2_clip_with_bbox_simple
in gx_image_fill_masked_end rather now it is always idle.
Doing so for the case if this change will need undoing for shadings.

The new code doesn't use the writing of big patterns into clist,
which was done with recent revision 8655. 
That change appears unneccessary for this particular bug. 
However we want to keep it in HEAD branch because it may be useful 
for further impeovements when imagemask produces a too big clipping list.

This patch causes a minor raster difference with Bug688396.pdf .
Delaying it for better times.

[src/gsimage.c src/gxacpath.c src/gsptype1.h src/gximask.c]

2008-04-23T00:30:10.271302Z Alex Cherepanov

Since we always write a complete "classic" xref, the Trailer may need to be
adjusted: (1) remove keys that pertain to xref-streams and hybrid-xref PDFs;
(2) if it's a PDF stream, turn it into a PDF dict by removing keys used for
PDF streams (both standard and GS-specific), and the executable attribute.
Thanks to SaGS for the patch. Bug 688152.

[lib/pdfwrite.ps lib/pdfopt.ps]

2008-04-22T17:18:03.467843Z Ralph Giles

Set native line endings on gsnamecl. This should remedy patch-portability problems.

[src/gsnamecl.h src/gsnamecl.c]

2008-04-21T14:53:38.640663Z Igor Melichev

Enhancement (graphics) : Delay applying big patterns until page clist interpretation.

DETAILS :

This is a preparation for fixing 
the bug 689440 "PostScript file generates infinitely large temp file".

The old code decomposes the imagemask into rectangles,
each of which decomposed the pattern color into a huge list of rectangles.
See more about the old code in Comment #11 of the bug 689440.
Now we delay the decomposition until the page clist playback.

This patch reduces the clist file size for the bug 689440
from 355GB to an acceptable size of 316Mb. A further shortening
is possible as explained in (5) below. But the rasterization time is still
unacceptably long - more than 48 hours. It will be improved
in a next step with converting imagemask with pattern color
into a painting of a pattern color with a mask clip device.

1. The old functions gx_dc_pattern_write, gx_dc_pattern_read actually 
are generic functions for multiple color types,
which simply return an error. Renamed them into 
gx_dc_cannot_write, gx_dc_cannot_read.

2. Implemented new gx_dc_pattern_write, gx_dc_pattern_read for clist-based patterns.
They copy pattern clist data to/from page clist. Currently this code
doesn't try to compress the data, but probably we'll need to do that.

3. Changed a condition in gxclimag.c to pass imagemask
with a clist-based pattern color to clist writer.
Also moved some checks to provide image matrix to be computed
when the new condition is true.

4. Added more functions into gxclist.c, gxclist.h for accessing 
data of a clist-based pattern.

5. gx_dc_pattern_read now constructs pattern cache and stores the
clist-based pattern "tile" to it. The clist reader releases the cache before exiting a band.
We will need an optimization agains redundant writing of patterns into page clist.
This necessary optimization to be done in a next step.

6. Propagated error codes in gxclread.c, gdevfax.c for easier debugging.

7. Improved debug printing in gxp1fill.c to designate
recursive calls to clist interpreter when a clist-based pattern
in interpreted while a page clist playback.

8. Added new accessors into gxpcmap.c, which are needed 
to access pattern cache while a page clist interpretation.

9. Updated dependencies in makefiles. 

10. Fixed the dependenco of gxdcolor.c on gxdevcli_h, which was missed before this change.

11. Added the pattern color type into the list in gxdcolor.c,
because now we need to write it into clist. An old comment
reads that it was not included against unuseful reference to 
pattern stuff in a Postscript Language Level 1 build.
The reference now appears, and this is unfortunate.
We think that level 1 builds are not important in nowadays.
On necessity it may be improved in a separate change.

[src/gsptype1.c src/lib.mak src/gsptype2.c src/gxclist.c src/gxpcmap.c src/gsptype1.h src/gxdcolor.c src/gxclist.h src/gxpcolor.h src/gdevfax.c src/gxdcolor.h src/gxp1fill.c src/gxclrast.c src/gxclread.c src/gxclimag.c]

2008-04-21T11:58:27.801424Z Russell Lang

Change the name of a utility used to build Windows distribution so it doesn't 
get treated as a setup program by Windows Vista.
Change reference to obsolete doc/Public.htm to doc/COPYING.
Allow makefile to recognise a later patch of the Microsoft Visual Studio 2005 
make utility.

[src/winint.mak src/msvc32.mak]

2008-04-20T23:40:49.333141Z Alex Cherepanov

Ignore DSC comments in nested EPS files and data blocks. Thanks to
William Bader for the patch. Bug 689791.

RIFFERENCES:
None

[src/zdscpars.c]

2008-04-20T04:51:21.386273Z Alex Cherepanov

Skip bogus endobj operators inside the object stream.
Bug 689795, customer 870.

RIFFERENCES:
None

[lib/pdf_base.ps]

2008-04-19T18:26:31.622080Z Ray Johnston

Fix a problem when the default transfer function of the target printer
is not in global space. Seen with Konica Minolta (QMS PostScript).
Fixes 'invalidaccess' error caused by attempting to store a 'local'
currentcolortransfer into a 'global' array. NB: The 'cp2g' will then
convert the array to global which is needed to store into InitialExtGState.

[lib/opdfread.ps]

2008-04-19T18:18:34.484562Z Ray Johnston

Add diagnostic information for start of rendering (Outputpage start) so that
parsing as well as rendering time can be observed with -Z: (gs_debug[':'])

[src/zdevice.c]

2008-04-19T12:48:15.825215Z Alex Cherepanov

Fix PDF transmuting utilities. Remove '#' from the list of characters that
may occur in PDF names unescaped. Bug 689770.

[lib/pdfwrite.ps]

2008-04-19T04:49:20.031557Z Alex Cherepanov

Add recognition of abbreviated filter names to the PDF inflation utility.

[toolbin/pdfinflt.ps]

2008-04-19T03:43:21.791168Z Alex Cherepanov

Implement loading of OpenType CFF font as a CIDFont resource in PDF reader.
Bug 689763, customers 531, 850.

DETAILS:
PDF can use OpenType font with ordinary CFF data as a CIDFont. Such a font is
referenced by /CIDFontType2 and may have /CIDToGIDMap table. The following
changes have been done to support this usage.

- A flag that forces CIDFont generation was added to CFF font loader.
- When the flag is on, CFF font is converted to a Type 9 CIDFont.
- The FontSet resource is returned by the value from the font loader
  because it can be of either Font or CIDFont type,
- Since CIDMap has no effect on CIDFont Type 9, CIDToGIDMap is interpreted
  by PDF reader to modify GlyphDirectory to the same effect.
- Unused CIDMap is no longer generated for CIDFontType2 objects that are not
  TrueType CIDFont resources.

[lib/pdf_font.ps lib/gs_cff.ps lib/pdf_ops.ps]

2008-04-17T17:40:05.253185Z Ralph Giles

Use -O0 with the autoconf debug build instead of -O which seems to
hide some symbols.

[src/Makefile.in]

2008-04-17T17:31:57.458743Z Ralph Giles

Allow the ENABLE_CUSTOM_COLOR_CALLBACK preprocessor macro to be set
from the compiler command line.

[src/gsnamecl.h]

2008-04-15T04:47:24.255743Z Alex Cherepanov

Repair broken CFF CIDFont stream generated by "Exstream Dialogue Version
6.2.004m (DBCS)". Bug 689753, customer 353.

DETAILS:
1. The CFF stream has a single Private DICT block but refers to it twice.
New version caches the DICT block that correspond to the Private stream.

2. The operands of ROS operator are too small and correspond to some random
values from the standard string table. The patch doesn't attempt to find
the right values nut converts the fetched names to strings to avoid a
typecheck error during resource handling.

[lib/gs_cff.ps]

2008-04-14T22:57:22.422088Z Michael Vrhel

Fixed Colorspace enumeration order for debug printing.

[src/gscspace.h]

2008-04-10T23:43:36.714953Z Ralph Giles

Increase the static command and path buffers in echogs to deal with
longer build paths. Bug 689788.

[src/echogs.c]

2008-04-10T22:08:20.215716Z Ralph Giles

Use the correct GEN directory references. Bug 689788.

[src/jbig2.mak src/jasper.mak]

2008-04-10T07:38:46.911876Z Ken Sharp

Fix (PDF interpreter): Improve omission of .notdef glyphs.

Details:
Bug #689757 "Extra square characters rendering PDF file".

Improvement to change 8217, makes the test for .notdef more
specific at Igor's suggestion.

Now matches exactly the string ".notdef" or strings beginning
".notdef~GS~" in order to include any .notdef modified by the
PDF interpreter when it appears multiple times in an Encoding.

[src/zchar42.c]

2008-04-10T05:43:43.466565Z Igor Melichev

Enhancement (graphics) : Generalize prototypes of color serialization methods for big color data.

DETAILS :

This is a preparation for fixing 
the bug 689440 "PostScript file generates infinitely large temp file".

The old serialization methods assume that color data can fit into a small buffer.
Now we want to drop this constraint to allow to write big patterns into clist.
See comment in code for details.

This change is algorithmically equivalent.
This patch adds a new argument to color serialization methods.
For a while the new actual parameter is always 0,
and the (untrivial) methods check for it.

[src/gsptype1.c src/gxwts.c src/gxcht.c src/gxdcolor.c src/gxdcolor.h src/gxclrast.c src/gxclpath.c src/gxht.c]

2008-04-09T15:28:45.087056Z Ken Sharp

Fix (PDF interpreter): Optionally omit rendering of /.notdef glyphs
from TrueType fonts.

Details:
Bug #689757 "Extra square characters rendering PDF file".

When rendering glyphs in a TrueType font, and the glyph is not present
in the font, GS (correctly) draws the /.notdef glyph (or glyph ID 0)
instead. Under some conditions, however, Acrobat does not do so, but
does leave a 'gap' apparently corresponding to the width of the
original glyph (if a /Widths array is present), or the width of the
/.notdef glyph.

Exactly what causes Acrobat to do this is unclear. In the thread for
bug 687929 it was suggested that Acrobat was substituting a standard
font with a /.notdef defined as an empty glyph. However changing the
font name had no effect.

Using a pdfwrite-produced PDF file, if I remove the symbolic flag
from the font, and any direct reference to /.notdef in the Encoding
/Differences array, then Acrobat does not display the /.notdef 
glyph. However, starting with a Distiller-produced PDF file, and
either altering the font to symbolic, or adding a direct /.notdef
to the Encoding, or both, makes no difference, Acrobat still does
not render the /.notdef glyph.

The behaviour of Acrobat is probably technically incorrect, but
we need to attempt to render files similarly, if at all possible.
However, since the appearance of a /.notdef is usually indicative
of an error, this has been made optional.

We can't substitute a space glyph for the /.notdef as has been
suggested, because we can't guarantee the existence of a space glyph
(eg Arabic, which has no space) and can't guarantee that the space
makes no marks even if present.

However, we still want to apply the Width of the glyph, so that
spacing works out correctly, if we simply skip the /.notdef glyph
then words may collide, as in the case of the file for this bug.
This means we must run the glyph through the text routines, as the
width is applied there.

A new user parameter '/RenderTTNotdef' controls whether glyphs
named /.notdef in a TrueType font should be rendered or not. This
is also controlled by a systemdict parameter /RENDERTTNOTDEF. The
PDF interpreter will set the user parameter to the same value as
the systemdict parameter, allowing this to be controlled from the
GS command line.

The user parameter defaults to 'true' which renders TrueType /.notdef
glyphs (so that these are properly rendered in PostScript), the 
RENDERTTNOTDEF systemdict parameter defaults to 'false', which is
used by the PDF interpreter to set the user parameter, and therefore
disables rendering of TT /.notdef glyphs in PDF files.

[lib/pdf_main.ps src/icontext.c src/zchar42.c doc/Use.htm src/icstate.h src/zusparam.c lib/gs_init.ps]

2008-04-09T06:16:50.593621Z Alex Cherepanov

Avoid a spurious warning "CS/cs (setcolorspace) operand not a name".
Acept array values for /CS attribute. Bug 689738.

[lib/pdf_draw.ps]

2008-04-08T21:55:08.170308Z Ralph Giles

We no longer have any outstanding port requests. Bug 689745.

[doc/Projects.htm]

2008-04-06T21:42:34.379385Z Alex Cherepanov

Use operator .execn to keep the operand stack size and .pdfcount value
consistent during /BuildChar execution. Operator scn depends on the correct
value of .pdfcount. Bug 688796.

[lib/pdf_font.ps]

2008-04-06T07:53:33.800999Z Alex Cherepanov

Fix PDF empty stack count (pdfemptycount) in the tiling pattern. Operator
scn depends on the correct value of pdfemptycount. This bug was introduced
in the rev. 8308. Bug 689776.

[lib/pdf_draw.ps]

2008-04-04T11:30:17.034942Z Till Kamppeter

Added the new files of OpenPrinting Vector 1.0.

[contrib/opvp/opvp_0_2_0.h contrib/opvp/opvp.h]

2008-04-04T11:28:22.909246Z Till Kamppeter

Updated the OpenPrinting Vector driver interface ("opvp", "oprp") to version 1.0.

[contrib/opvp/opvp_media.def contrib/opvp/opvp_common.h contrib/opvp/gdevopvp.c]

2008-04-04T08:53:57.893326Z Ken Sharp

Fix (pdfwrite): Incorrect cmap aubtables written for 'non-symbolic' TrueType
 fonts, when PDF/A output is enabled.

Details:
Bug #689754 "Substituting .notdef for "german umlauts" when generating PDFA".

Normally when writing TrueType fonts GS emits 'symbolic' TrueType fonts, and
correctly outputs both a 1,0 and 3,0 cmap subtable (with appropriate character
offsets, see section 5.5.5 of recent PDF specs).

However, when PDF/A output is enabled, and the TT font to be output only
contains glyphs from the Adobe Latin set, and these are ordered in
accordance with that set, then we emit a 'non-symbolic' TT font. (For PDF/A
we do not emit 'symbolic' fonts, if the font is not 'non-symbolic' then we
write a CIDFont instead.)

However, when writing the non-symbolic font, we continued to write the same
cmap subtables. Acrobat does not use the 3,0 subtable with non-symbolic fonts,
and falls back to the Mac Roman (1,0) subtable instead. For many glyphs this
works correctly, but if the font is WinAnsi compliant, and the glyph is one
of those for which the character position differs between Mac and Windows,
then the glyph cannot be found by Acrobat.

By writing a 3,1 (Windows Unicode) cmap subtable we can ensure this does not
happen, as Acrobat will use this in preference to the 1,0 subtable.

(gdevpsf.h) Add a new TrueType writing control flag WRITE_TRUETYPE_UNICODE_CMAP
 This is used to control whether we write a 3,0 or 3,1 cmap subtable.

(gdevpdtb.c) When setting options for TrueType font writing, if we are
 writing PDF/A, then set the new flag so we get a 3,1 Unicode subtable.

(gdevpsft.c) Create new boilerplate for a type 6 Mac Roman subtable,
 followed by a type 4 Windows Unicode subtable. Create a new routine
 'write_unicode_cmap_6' which uses the new boilerplate to write this
 kind of subtable. In write_cmap, check if we have been asked to write a
 Unicode cmap subtable, and use the new routine if so. Do not bias the
 character codes if writing a Unicode table.

[src/gdevpdtb.c src/gdevpsft.c src/gdevpsf.h]

2008-04-04T08:39:33.625568Z Ken Sharp

Fix (pdfwrite): code tidy up.

Details:
Bug #689712 "macro expanded unnecessarily and undocumented .h file".

No functional changes, merely code reordering and tidying up.

(encs2c.ps) Modified to write the current license boilerplate and a
 small additional comment referring developers to this file should they
 wish to modify the generated files. Modify the output to gdevpdtv.c
 to #include gdevpdtv.h.

(gscedata.h)
(gscedata.c)
(gdevpdtv.c)
(gdevpdtv.h) Update with output from modified encs2c.ps

(gdevpdtf.h) Remove the 'gs_private_st_basic..' macro, thus preventing
  its unnecessary expansion and inclusion in several .c files.

(gdevpdtb.c) Move the macro 'gs_private_st_basic(st_pdf_base_font...'
  into this module, where it is actually used.

[toolbin/encs2c.ps src/gdevpdtb.c src/gscedata.h src/gdevpdtv.c src/gdevpdtf.h src/gdevpdtv.h src/gscedata.c]

2008-04-04T01:02:17.399302Z Ralph Giles

Add the rinkj driver to the default autoconf build under "ETS" devices.

It's not intended for production use, but this will help prevent
bit rot. Related to bug 689780.

[src/configure.ac]

2008-04-04T01:02:16.708266Z Ralph Giles

Minimal changes to gdevrinkj.c so that it compiles. As far as I can tell,
the version in source control has never worked.

[src/gdevrinkj.c]

2008-04-04T01:02:16.013247Z Ralph Giles

Include stdlib.h for malloc and free in the rinkj device. Bug 689780.

[src/rinkj/rinkj-byte-stream.c]

2008-04-01T00:28:17.665464Z Alex Cherepanov

Fix incorrect scanline length calculation in 1 bit/component images on pswrite
and epswrite devices. The bug was introduced in rev. 8233.
Bug 689771, customer 73.

[src/gdevps.c]

2008-03-31T23:53:28.505732Z Ralph Giles

Don't override the memory pointer set by the client when initializing 
the luratech jpx decoder.

[src/sjpx_luratech.c]

2008-03-31T23:08:41.231868Z Ralph Giles

Do not invoke the s_jpxd_template set_defaults method if it is null.
Fixes bug 689743, whose attachment segfaults with the luratech decoder
for which this method is not implemented.

[src/zfjpx.c]

2008-03-31T23:00:55.454967Z Igor Melichev

Fix (graphics) : Stroke width was wrong for short segments.

DETAILS :

Bug 689742 "Nearly missing dotted lines with anisotropic resolution".

Rather the bug title mentions anisotropic rendering, 
the problem appears with isotropic one as well.
The bottom of the problem is that the function width_is_thin
used the dash longitude to know its direction,
which gives an incorrect (zero) result 
for vertical segments of zero length.

That method became obsolete since revision 7706,
which intorduced the precise dash direction is a special data field.
Using it now for the right computation of the width.

[src/gxstroke.c]

2008-03-28T16:30:25.778081Z Igor Melichev

Fix (graphics) : rectfill applied a wrong path adjustment.

DETAILS :

Bug 689361 "Text has white stripes and missing parts at 100 dpi".

Ghostsctript applies path adjustment as an implementation of
"any part of pixel inside" filling rule. 
However it was wrong for rectfill :
the lower adjustment was too wide, causing extra pixels to paint
when the lower coordinate of the rectangle falls to pixel center.
Besides that, the X adjustment was applied to Y axis.

[src/gsdps1.c]

2008-03-28T06:36:49.751300Z Alex Cherepanov

Improve detection of transparency usage. Search for transparency featires in
the resource chain of annotattion appearance streams.
Bug 689764, customer 531.

[lib/pdf_main.ps]

2008-03-27T08:37:58.577822Z Ken Sharp

Fix (pdfwrite): endstream/endobj not always emitted PDF/A compliant.

Details:
Bug #689755 "Keywords endstream and endobj not always preceded by EOL when generating".

The PDF/A specification mandates that the endstream and endobj operators
are always preceded by an EOL character (in the spec, EOL = carriage return,
linefeed, or carriage return/linefeed pair). 

(gdevpdfb.c)
(gdevpdfu.c)
(gdevpdti.c) Ensure all endstream operators are preceded by a '\n' if we
 are producing PDF/A.
(gdevpdfo.c) Add '\n' to the end of array and dictionary objects in
 cos_array_write and cos_dict_write, if we are producing PDF/A. This
 ensures that endobj is always preceded by a EOL as other object types
 already conform.

[src/gdevpdfo.c src/gdevpdfb.c src/gdevpdfu.c src/gdevpdti.c]

2008-03-26T14:02:02.746186Z Ken Sharp

Fix (vector device): Operation order could result in failure to
apply clipping.

Details:
Bug #689469 "Incorrect clipping operation in vector output".

From the patch supplied by Osamu Mihara. In gdev_vector_stroke_path and
gdev_vector_fill_path, clipping was performed after a number of other
operations. If these failed, the clipping was not applied, apparently
causing problems for some devices (eg OpenPrinting Vector Printer).

(gdevvec.c) Execute the clip operation before other operations to ensure
 that the clip is applied, even if the later operations fail.

[src/gdevvec.c]

2008-03-25T05:26:24.097873Z Alex Cherepanov

PDF font descriptor may be shared between CID and simple fonts. We cache the
font object in the font descriptor dictionary. To prevent collision, use
different keys to store font and CIDFont objects. Improve the fix for the
bug 689301.

[lib/pdf_font.ps]

2008-03-24T20:02:07.895385Z Igor Melichev

Fix (clist writer) : Smaller tiles for strip_copy_rop (continued).

DETAILS :

The old code sometimes tried to write a degenerate rectangles to clist.
It happened since revision 8581 due to inaccurate coding.
Should fix ghostpcl regression happened on March 23, 2008 . 

[src/gxclimag.c src/gxclrect.c]

2008-03-24T04:17:47.859439Z Alex Cherepanov

Equivalent transformation of the PDF font handler to improve readability
in preparation for the PDF font overhaul.

[lib/pdf_font.ps]

2008-03-23T07:50:43.652322Z Igor Melichev

Fix (vector device): %pipe% IO device being opened as seekable (continued).

DETAILS :

Revision 8602 caused an MSVC warning, which is now fixed.

[src/gdevvec.c]

2008-03-22T21:55:00.988313Z Igor Melichev

Fix (clist writer) : Smaller tiles for strip_copy_rop.

DETAILS :

Bug 689588 "Unexpected InternalOverflow in ReadImage".

When strip_copy_rop recieves a big tile, it is being subdivided into line tiles
to fit into the clist buffer. However the line tile can be too big as well.
The new code narrows the line tile with the size of the rectangle to be painted.
For details see comments added into gxclrect.c .

Minor change (gdevddrw.c, gdevmr8n.c) Added visual trace commands for easier debugging.

[src/lib.mak src/gdevddrw.c src/gdevmr8n.c src/gxclrect.c]

2008-03-21T05:07:53.304009Z Igor Melichev

Fix (Windows application) : Provide a better visual trace support interface for use with other interpreters.

DETAILS :

This minor change doesn't change any behavior.

[src/dwtrace.h src/dwtrace.c]

2008-03-20T10:20:17.499008Z Ken Sharp

Fix (pdfwrite): pdfwrite embedded TrueType/Type 42 fonts which
specifically forbid embedding.

Details:
Bug #689693 "GS embeds licensed fonts when generating PDF".

For Type 42 fonts, in order to prevent embedding fonts with license
restrictions we need to retrieve and honour the /FSType key if present
in the FontInfo dictionary of the font.

We also need to check the embedding status of TrueType fonts read from disk
in a similar fashion to Type 42 fonts downloaded in the course of the job.

Finally, when writing a TrueType font to a PDF file, we need to preserve any
existing embedding rights by setting fstype appropriately in the OS/2 table.
It is possible to permit font embedding even when the embedding rights
are non zero and we should preserve these.

(gxfont.h) Add a new parameter, EmbeddingRights, and a new flag
	     FONT_INFO_EMBEDDING_RIGHTS, to the gs_font_info structure.

(zfont.c) In zfont_info, if we request the EmbeddingRights, and the font has
          a FontInfo dictionary, retrieve the FSType if present.

(gdevdtf.c) When determining whether a font may be embedded, retrieve the
          font info, check the 'members' structure member after retrieving font info
          to see if the EmbeddingRights member has been updated. Assume embedding
          allowed if the member has not been updated.

(gxfont42.h) Add a new member os2_offset to the gs_type42_data structure, to allow
           us to read from the OS/2 table later.

(gstype42.c) In gs_type42_font_init, when reading the TrueType Table directory, store
           the offset to the OS/2 table.

           In gs_truetype_font_info, if the caller has requested the embedding rights
           and they haven't already been retrieved from an FSType entry in the
           FontInfo dictionary, get the OS/2 table and pull the fstype value from there.

(gdevpsft.c) When writing a TrueType font, and we don't have an OS/2 table to
             copy (appears to always be the case), check to see if we have any
             embedding rights information in the original font, and preserve it if so
             by setting the fstype entry in the OS/2 table.

[src/gxfont42.h src/zfont.c src/gdevpdtt.c src/gstype42.c src/gdevpsft.c src/gdevpdtf.c src/gxfont.h]

2008-03-19T10:09:21.671968Z Ken Sharp

Fix (vector device): %pipe% IO device being opened as seekable.

Details:
Bug #689428 "‘gs -sOutputFile=%pipe%cat’ doesn't work".

Based on the patch supplied by Dan Villiom Podlaski Christiansen. 

(gsdevice.c) in gx_device_open_output_file, if the parsed out iodevice
 is '%pipe%', then open the output 'file' non-seekable.

(gdevvec.c) Not strictly related, but gdev_vector_open_file_options could
 use 'fclose' on a stream opened with gx_device_open_output_file. Altered
 to use gx_device_close_output_file instead.

[src/gdevvec.c src/gsdevice.c]

2008-03-16T22:25:13.694561Z Alex Cherepanov

Handle TT fonts that have short post table with less than 256 glyphs.
Pad the generated Encoding vector with /.notdef glyphs.
Bug 689515, customer 700.

[lib/gs_ttf.ps]

2008-03-15T23:59:48.788786Z Alex Cherepanov

Work around a bug in the PS interpeter by not using nulldevice in the PDF
interpreter where it isn't really needed. Bug 689751.

DETAILS:
PS interpreter seems to fall into an infinite loop running charpath when
the font is composite and the curent device is nulldevice.

[lib/pdf_ops.ps]

2008-03-14T05:40:11.023910Z Marcos H. Woehrmann

Fixed duplexing for ljet3d and ljet4d devices; thanks to karsten@sengebusch.de for the changes.

Fixes bug 687531.

No regressions expected, since neither device is tested by the regression suite.

[src/gdevdjet.c src/gdevdljm.c]

2008-03-13T07:18:46.618081Z Igor Melichev

Fix (graphics) : A bug in the pattern color serialization.

DETAILS :

Patch from Alex mentioned in the bug 689731 and unrelated to that bug.

[src/gsptype1.c]

2008-03-12T22:32:03.336468Z Igor Melichev

Fix (graphics) : Optimize filling a path with a shading color (continuewd 3).

DETAILS :

Bug 689748 "gs segfaults".

An unitialized variable since rev 8510.
We had no test files for that branch, now got one.

[src/gxfill.c]

2008-03-11T18:32:33.104151Z Ray Johnston

Fix MSVC makefile for the 'Big console mode EXE' case when COMPILE_INITS=1. Also
minor cleanup to gs.mak 'clean' target and redundant dependency in ugcclib.mak.
MSVC build problem noted by customer #531.

[src/ugcclib.mak src/gs.mak src/msvc32.mak]

2008-03-10T02:18:38.654568Z Alex Cherepanov

When the font has no /FontBBox but provides character width through /Metrics
dictionary, use them instead of the calculated width. The old code did so only
when both the width and side bearings were defined. Bug 689740, customer 353.

[src/zchar1.c]

2008-03-09T13:34:51.534239Z Igor Melichev

Fix (transparency) : Transparency compositor device recreation was incorrect.

DETAILS :

This problem was apparently detected when working on another problem.
The pdf14_recreate_clist_device code was wrong.
Regularly we never call that function, because
PDF interpreter creates the transparency compositor device once per page.
Nevertheless we store the right code since it is debugged.

[src/gdevp14.c]

2008-03-07T13:39:35.783627Z Igor Melichev

Fix (bbox device) : box_fill_path needs as path for shfill.

DETAILS :

Since revision 8017 the function gs_shfill includes a branch for 
a faster handling of the Postscript operator shfill,
which does not provide a path to fill. It uses the clipping path instead.
The bbox device appears to be incompatible with that optimization.
This patch adds a special branch to bbox device to handle a shading fill
with no path.

Please note that since revision 8017 the call 
dev_proc(dev, pattern_manage)(dev, gs_no_id, NULL, pattern_manage__shfill_doesnt_need_path) 
must return a proper information about the device's fill_path method. 
In most case it is doe with the default implementation gx_default_pattern_manage, 
but the bbox device ises gx_forward_pattern_manage instead, 
which appears wrong for bbox_fill_path. We decided to add an optomized branch 
rather than apply the slow general method.

[src/gdevbbox.c]

2008-03-07T09:42:38.021120Z Ralph Giles

Correct a default return value. Follow on to Bug 689569.

Also rename a variable to match the jbig2dec version of the same call.

[src/sjbig2_luratech.c]

2008-03-05T23:35:50.165171Z Igor Melichev

Fix (clist) : Some transparency compositor commands don't need CTM.

DETAILS :

The old code writes CTM with each transparency compositor command.
Actually it is only needed with begin_transparency_grup and 
begin_transparency_mask. So we can skip CTM with
when writing other commands to shorten the clist file.

Note clist reader now sets zero CTM when reading transparency
compositor command with no CTM. We believe it is useful because
subsequent graphics objects need to restore CTM of a containing group.

See also comments added in code.

[src/gdevdbit.c src/gdevp14.c]

2008-03-04T20:56:48.308882Z Igor Melichev

Fix (clist) : Crop transparency commands while clist writing, step 4.

DETAILS :

This provides a right group bounding box for transparency masks.
Instead that the old code used the container's group bbox,
which may be much bigger causing a performance leak.

[src/gdevp14.c]

2008-03-03T20:16:06.744980Z Igor Melichev

Fix (images) : Revert an unintentional change to siscale.c .

DETAILS :

When doing the revisoon 8530, a macro was expanded in siscale.c 
for a debug purpose. This change was committed by error,
reverting it now.

[src/siscale.c]

2008-03-03T16:01:12.306842Z Igor Melichev

Fix (clist) : Crop transparencsy commands while clist writing, step 3.

DETAILS :

This really crops transparency compositor commands with bands 
that are covered by the transparency bbox.

Actually the statement above has one exception. When a transparency bbox
covers more that 2/3 of all bands, we still write the commands to 
the "all bands" list for a shorter clist file. We noticed that 
the clist playback time strongly depends on the file size.

1. The new method gs_composite_type_procs_t::get_cropping
replies what bands are covered by the compositor. 
When it gives a non-trivial result, clist_create_compositor
writes the compositor command to those bands,
which are covered with the cropping (Exception :
if too many bands are covered, it writes the command to
the "for all bands" list).

2. Since some bands skip some compositor commands,
while clist reading the association of masks to groups 
becomes more complex. Before this patch each group
was associates with the mask, which was created immediately
before it at same transparency stack level. 
After this patch some groups may be skipped, so that
clist reader may recieve extra masks, because masks are
still use the container's group bbox. For skipping such extra masks
we provide a numeric identifier of a mask, which is named mask_id.
Here is how it works :

2.1. All masks recieve serial numbers (mask_id) while clist writing.
2.2. Each mask command is written with its mask_id.
2.3. Each group command is writen with mask_id, 
     which belongs to the mask that is assocuated with the group.
2.4. While clist playback pdf14_pop_transparency_group checks whether
     the mask amd the group have same mask_id. If not, the mask is extra
     and it must be droped.
2.5. Note the old assiciation logic is still working,
     and it may skip some masks as well.
2.6. If the rasterization happens with no clist, mask_id is always zero.
     In this case the old logics is only working.
     Maybe we'll provide non-zero values someday.
2.7. See comments in code for more details.

3. The method gs_composite_type_procs_t::clist_compositor_write_update
is now some generalized. Before this patch it only updates the clist writer state
with the compositor features. With this patch it also adds 
some information from the clist writer state to the compositor parameters.
Particularly it provides mask_id to the compositor command.
Thus now it updates *both* clist writer and the compositor parameters
to comply each another. For a while, in order to simplify the patch,
the compositor argument is still 'const'. Will need to fix someday.

4. Now we need to save mask_id in a stack that reflects the
transparency nesting. The cropping stack, which was introduced
in the last patch, now works for that. To provide that
we add mask_id to clist_writer_cropping_buffer_s,
and use clist_writer_push_no_cropping to save amsk_id
over inner groups. 

5. state_update(ctm) in c_pdf14trans_clist_write_update is replaced
with code, which updates CTM from the transparency compositor command.
The old code is not fully correct, because it takes CTM from the imager state,
rather we havn't got prcatical cases when it gives a wrong result.

6. drop_compositor_queue now calls adjust_ctm for compositors being dropped.
The old code is incorrect because it can miss a CTM update when 
a compositor sets some CTM and later a non-compositor object
sets same CTM. In this case the clist writer skips the second CTM on writing,
and skipping the first in the clist reader will miss the CTM completely.
We haven't got practical cases for that.

7. Improved some debug printing.

[src/gxclist.c src/gdevdflt.c src/gdevp14.h src/gstrans.c src/gsalphac.c src/gxclist.h src/gxcomp.h src/gsovrc.c src/gstparam.h src/gstrans.h src/gxclrast.c src/gdevp14.c src/gxclpath.c src/gxclimag.c]

2008-03-03T11:57:42.307384Z Igor Melichev

Fix (clist) : Crop transparencsy commands while clist writing, step 2.

DETAILS :

This is a preparation to the next step.

The patch introduces a transparency stack for clist writer,
which saves cropping when entering a transparency group,
and restores when exiting it. The cropping is being narrowed
with transparency group's bounding box.

[src/gxclist.c src/gxcldev.h src/gxclist.h src/gdevp14.c src/gxclpath.c]

2008-03-03T11:42:33.253339Z Igor Melichev

Fix (clist) : Crop transparencsy commands while clist writing, step 1b.

DETAILS :

Removing non-ascii chars that was not detected by MSVC.

[src/gdevp14.c]

2008-03-03T10:13:01.196997Z Igor Melichev

Fix (clist) : Crop transparencsy commands while clist writing, step 1a.

DETAILS :

The last commitment is incomplete, now fixing.

[src/gxclist.h]

2008-03-03T10:11:27.428498Z Igor Melichev

Fix (clist) : Crop transparencsy commands while clist writing, step 1.

DETAILS :

This is a preparation to the next step.
In general, the behavior doesn't change, 
but implementation details differ.

The old code maitains a flag cropping_by_y in the clist writer,
which triggers a cropping of objects by the Y axis.
The old code isn't perfect, because 
it first crops by [cdev->cropping_min, cdev->cropping_max],
and then by [0, cdev->height].

In the new code we unite both croppings into a single one.
For doing that we remove the flag, and provide 
the right interval [cdev->cropping_min, cdev->cropping_max]
in any case. Initially it is [0, cdev->height},
and it is narrowed when a shading bbox is set.
To restore the initial cropping after the shading
is complete, we maintain 2 new fields 
save_croping_min and save_cropping_max.

So now the cropping mechanizm does not depend
on shading, and clients may set a croping when they need. 
We'll use this feature in the next patch.

[src/gxclist.c src/gdevp14.c src/gxclpath.c src/gxclimag.c src/gxclrect.c]

2008-03-03T04:03:51.374416Z Marcos H. Woehrmann


Fix for compression always falling back to no compression in
pclxl_write_image_data(), bug 689732.

Details:

After much tracing of srle.c and gdevpx.c I believe this bug is in
the portion of s_RLE_process() that looks ahead in order to be able
to optimally compress the data.  Rather than attempting to modify the
function and probably breaking something else I'm taking the 99% solution
and just calling s_RLE_process with last set to true instead of false.
This disables the look ahead feature, presumably making the compression
very slightly suboptimal but at least now it works.

This change results in pxl files that are significantly smaller than
before (i.e. the test file associated with bug 689595 is reduced in size
from 1.1 megs to 387k).

[src/gdevpx.c]

2008-03-03T02:57:05.472235Z Ray Johnston

Fix properties

[src/psromfs.mak src/gsromfs0.c]

2008-03-03T01:17:09.063617Z Marcos H. Woehrmann

Fall back to using gx_default_copy_mono() in pclxl_copy_mono() if data_x!=0.

Details:

Fixes bug 688992.  Will increase the size of the generated PXL file in some cases; a better solution would be to modify the pclxl_write_image_data()function to handle data_x!=0.

Expected regressions:

None, pxlmono isn't covered in the regression suite.

[src/gdevpx.c]

2008-03-01T10:18:20.389016Z Ken Sharp

Fix (pdfwrite): problems with type 3 fonts executing 'show'.

Details:
Bug #689685 "OpenType font incorrectly converted to PDF".

The File is from Quark XPress and contains a type 3 font which
executes a 'show' and a 'charpath stroke' with a glyph from a type
1 font. Further, it executes a 'charpath' on this type 3 glyph.

Pdfwrite was unaware, when processing the 'show' that this was
inside a charpath operation, and emitted the shown glyph.

Modified pdfwrtite to be aware that a charpath is in operation, and
to have the graphics library handle any show operations.

(gdevpdfx.h) Add a new flag 'type3charpath' to the gx_device_pdf
  structure.

(gdevpdfb.h) Add an initialiser for the type3charpath flag (also for
  the last_charpath_op which was missed in that change)

(gdevpdtt.c) In gdev_pdf_text_begin, if type3charpath is true, go
straight to the default text processing. Otherwise, check to see
if this is a type 3 font, and the operation is 'charpath'. If so
then create a pdfwrite text enumerator to process the text.

In pdf_text_process, if we have a type 3 font, the operation is charpath
and type3charpath is false, set it to true and go straight to the 
default text handler. When the enumerator is completed, if type3charpath
is true, set it to false.

In pdf_text_process, while handling text, do not start accumulating a
charparoc if type3charpath is set.

Finally, in pdf_text_set_cache, if type3charpath is set, simply execute
the standard cache routine.

[src/gdevpdfx.h src/gdevpdtt.c src/gdevpdfb.h src/gdevpdti.c]

2008-03-01T10:15:02.847745Z Ken Sharp

Fix (pdfwrite): problems with type 3 fonts executing 'show'.

Details:
Bug #689687 "Regression: pdfwrite DEVICE produces bad text".

The File is from Quark XPress and contains a type 3 font which
executes a 'show' and a 'charpath stroke' with a glyph from a type
1 font.

The code for revision 8265 converts these into a '2 Tr' in the
PDF file. However, I missed the case of this occuring inside a font,
resulting in much too large a strokewidth being set. This code takes
account of the font matrix.

NB there is still a potential problem. There is no way currently to tell
the difference between a charproc which explicitly sets a stroke width
and one which inherits it from the prevailing graphics state. Currently
we will write a font which always emits the stroke width at the time
the font was first used. There is no simple way to address this, we
could set the stroke width to an invalid value during the course of a type
3 glyph, and check it before emitting the stroke, but this is dangerous.

However, this seems unlikely to be a real problem in practice, since altering
the stroke width outside the font might result in unpredictable widths
dependent on the point size. I have chosen not to open a bug for the
possible condition at this time.

(gdevpdfd.c) gdev_pdf_stroke_path, if we are converting to a PDF text
rendering mode, and are inside a type 3 font glyph description, take the
font matrix into account when calculating the strokewidth.

[src/gdevpdfd.c]

2008-03-01T01:42:04.749356Z Ralph Giles

Bump the revision after the 8.62 release.

[doc/News.htm lib/gs_init.ps src/gscdef.c src/version.mak]

Version 8.62 (2008-02-29)

This version is the next in our line of scheduled semi-annual releases.

There were approximately 55 bugs fixed since version 8.61. Some fixes and improvements of note were:

COMPILE_INITS=1 was broken in 8.61 and now works as expected.

Fonts are now distributed in the Resource/Font directory and will be included in the executable if COMPILE_INITS=1

The tiffsep device was fixed for using more than 8 colorants.

Shadings, overprinting and transparency were optimized and are substantially faster than in 8.61, particularly for large format or high resolution rendering when using the 'clist' banding mode.

Changes were made to prevent near unbounded growth in memory usage and corresponding performance problems on a few test cases.

The 'pdfwrite' device was improved to fix some compatibility issues with PDF/A and to improve some font embedding and other issues.

The 'ht_ccsto.ps' Stochastic Threshold array was completely changed to be more useful. The values in the threshold array were inverted, so the number of 'light' colors was limited and using it generally caused prints that were too dark.

The 'runpdfbegin', 'dopdfpages' and 'runpdfend' PostScript pseudo-operators that were inadvertently removed in 8.61 were restored. This also restored the functionality of toolbin/pdf_info.ps to display PDF creator stats, fonts used and page sizes.

The halftone tile cache sizes and cache effectiveness were improved to help the performance when tiling with large cells or threshold arrays.

The following bugs were open at the time of release:

465936, 578865, 626295, 686747, 686853, 687011, 687146, 687257, 687271, 687280, 687295, 687327, 687514, 687520, 687531, 687608, 687650, 687674, 687677, 687695, 687697, 687702, 687721, 687728, 687729, 687796, 687805, 687814, 687850, 687903, 687904, 687957, 687974, 688007, 688022, 688026, 688032, 688036, 688042, 688058, 688061, 688064, 688066, 688075, 688081, 688095, 688129, 688130, 688151, 688152, 688159, 688166, 688184, 688187, 688207, 688215, 688227, 688239, 688269, 688280, 688288, 688317, 688318, 688320, 688333, 688342, 688358, 688359, 688360, 688361, 688363, 688372, 688378, 688386, 688387, 688389, 688395, 688413, 688427, 688428, 688436, 688437, 688440, 688446, 688475, 688483, 688500, 688515, 688517, 688528, 688533, 688539, 688540, 688542, 688543, 688557, 688580, 688581, 688588, 688601, 688604, 688605, 688610, 688615, 688616, 688619, 688627, 688636, 688638, 688646, 688651, 688653, 688655, 688673, 688674, 688696, 688699, 688709, 688710, 688714, 688717, 688728, 688736, 688739, 688757, 688770, 688774, 688778, 688796, 688797, 688807, 688811, 688813, 688815, 688829, 688843, 688846, 688876, 688908, 688918, 688919, 688926, 688928, 688933, 688942, 688943, 688952, 688958, 688969, 688976, 688986, 688990, 688992, 688999, 689003, 689011, 689013, 689014, 689022, 689025, 689028, 689031, 689040, 689044, 689046, 689048, 689057, 689058, 689080, 689081, 689090, 689093, 689094, 689098, 689111, 689116, 689128, 689129, 689130, 689133, 689136, 689137, 689138, 689145, 689146, 689148, 689150, 689153, 689154, 689159, 689161, 689164, 689172, 689174, 689181, 689184, 689195, 689198, 689206, 689209, 689210, 689222, 689224, 689230, 689236, 689246, 689247, 689248, 689252, 689253, 689264, 689279, 689280, 689281, 689283, 689289, 689290, 689291, 689304, 689305, 689308, 689313, 689331, 689335, 689340, 689341, 689343, 689358, 689361, 689363, 689364, 689367, 689370, 689373, 689376, 689378, 689396, 689402, 689412, 689418, 689419, 689422, 689428, 689431, 689438, 689439, 689440, 689444, 689445, 689448, 689450, 689451, 689456, 689460, 689462, 689463, 689469, 689471, 689476, 689484, 689487, 689488, 689489, 689490, 689498, 689499, 689500, 689502, 689507, 689509, 689510, 689512, 689514, 689515, 689516, 689518, 689521, 689522, 689532, 689534, 689535, 689538, 689542, 689543, 689546, 689547, 689549, 689552, 689554, 689557, 689559, 689560, 689561, 689563, 689566, 689567, 689573, 689574, 689579, 689581, 689583, 689585, 689588, 689591, 689592, 689595, 689598, 689601, 689606, 689607, 689609, 689610, 689618, 689621, 689623, 689627, 689628, 689632, 689636, 689637, 689641, 689649, 689652, 689653, 689654, 689657, 689658, 689659, 689663, 689666, 689668, 689669, 689673, 689674, 689675, 689676, 689677, 689681, 689682, 689684, 689685, 689687, 689689, 689690, 689691, 689692, 689693, 689697, 689698, 689699, 689702, 689704, 689705, 689709, 689710, 689711, 689712, 689713, 689715, 689716, 689721, 689722, 689723, 689725, 689727.

Incompatible changes

Not strictly a compatibility issue, but the default URW (GPL) fonts are now distributed in the Resource/Font/ path which can increase the number of file handles open for PostScript that opens all of the resources. Also the size of the %rom% rom file system within the executable when using COMPILE_INITS=1 is larger by the amount needed for the fonts.

Also not strictly incompatible, but some alternate fixed-point code was stripped out, so FPU_TYPE and other FPU related makefile macros are gone or don't cause any difference in the code generated. Also the 'USE_ASM' macro was removed, since we expect modern compilers to do sufficient optimization.

Some old (deprecated) "helper" scripts were removed: gsindent, gssubst, many2pdf.tcl, and pre.

The unused 'cmap' (special color mapping) and 'ropc' devices were removed from the distribution.

The 'ht_ccsto.ps' Stochastic Threshold array was completely changed to be more useful. The values in the threshold array were inverted, so the number of 'light' colors was limited and using it generally caused prints that were too dark. This is an improvement, but incompatible in that anyone using it previously would see much different grays/ colors.

The SYSTEM_CONSTANTS_ARE_WRITABLE compile time define was removed as was the "EXTEND_NAMES" makefile macro (still accessible using a compiler flag define).

Changelog

2008-02-29T23:59:31.476236Z Ray Johnston

Fix typo that caused unbalanced 'q' 'Q' operators in PDF's (caused by
rev 8501). Bug 689728.

[src/gdevpdfi.c]

2008-02-29T22:27:59.143965Z Ralph Giles

Release notes for the 8.62 release. Thanks to Ray Johnston for compiling these.

[doc/News.htm]

2008-02-29T20:49:04.253927Z Ralph Giles

Remove some C++ style comments.

[src/siscale.c src/gdevijs.c]

2008-02-29T20:49:02.503198Z Ralph Giles

Add some new files to the documentation tree.

[doc/Develop.htm]

2008-02-29T20:47:52.884152Z Ralph Giles

Update product name, copyright and release dates.

[doc/History7.htm doc/Projects.htm doc/History8.htm man/dvipdf.1 man/ps2ascii.1 doc/Use.htm doc/Readme.htm doc/Deprecated.htm doc/Source.htm man/ps2epsi.1 doc/Install.htm src/gscdef.c doc/API.htm doc/Issues.htm doc/DLL.htm doc/Drivers.htm man/pfbtopfa.1 doc/Release.htm doc/Commprod.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm src/version.mak man/gs.1 src/dwsetup.rc man/pf2afm.1 doc/Fonts.htm doc/Ps2ps2.htm man/printafm.1 doc/Develop.htm doc/Ps2pdf.htm doc/Helpers.htm man/pdf2dsc.1 doc/Psfiles.htm doc/Lib.htm doc/gs-vms.hlp doc/Htmstyle.htm man/font2c.1 man/gsnd.1 man/pdfopt.1 src/winint.mak doc/News.htm man/pdf2ps.1 man/ps2pdf.1 doc/Make.htm doc/Details8.htm doc/Testing.htm doc/Unix-lpr.htm doc/Ps-style.htm doc/C-style.htm doc/History1.htm doc/History2.htm man/gslp.1 doc/History3.htm man/wftopfa.1 doc/Ps2epsi.htm doc/History4.htm man/ps2pdfwr.1 man/ps2ps.1 doc/History5.htm doc/History6.htm]

2008-02-29T18:53:14.162723Z Ray Johnston

Add default FontResourceDir needed when COMPILE_INITS=1 is used so
that the fonts from Resource/Font in the distribution directory that
are built into %rom%Resource/Font/ will be found.

[src/iccinit1.c]

2008-02-29T08:13:08.227205Z Ray Johnston

Fix COMPILE_INITS=1. Note the next commit to the PCL tree will combine
with this one, but we can't commit to both trees atomically.

DETAILS:

Tested with Windows and linux. Needs OS/2 testing. Other build systems
may have bit rotted, and I don't hav them to test. Some of the changes
here are to allow working with a PCL or XPS only build where the PS
interpreter is not used/needed.

I noticed that the default systemparam value for FontResourceDir isn't
getting et to %rom$Resource/Font/ as it should, but GenericResourceDir
_is_ being initialized correctly to %rom%Resource/ which is _NOT_
fixed by this commit.

[src/openvms.mak src/psromfs.mak src/macosx.mak src/int.mak src/watcw32.mak src/dvx-gcc.mak src/unixansi.mak src/msvclib.mak src/unixlink.mak src/os2.mak src/lib.mak src/bcwin32.mak src/ugcclib.mak src/gsromfs0.c src/Makefile.in src/msvc32.mak src/unix-gcc.mak src/unix-aux.mak src/macos-mcp.mak src/watclib.mak]

2008-02-28T14:56:32.629339Z Alex Cherepanov

Attempt to repair invalid embedded TT fonts without cmap table.
Bug 689707, customer 531.

DETAILS:
1. Use identity cmap if it is missing from the TT file. Set an unknown
   language ID to activate post table processing.

2. To avoid false rejection during the validation of post table run the
   validator only on the TT files generated by an utility that is known
   to write broken post tables.

[lib/gs_ttf.ps]

2008-02-27T19:36:18.181168Z Igor Melichev

Fix (clist interpreter) : Improve transparency performance, step 4a.

DETAILS :

Bug 689708 "Long processing time of PDF file"
Bug 689714 "Severe performance penalty for PDF transparency through to clist"

The last patch is incomplete due to a commitment failure.
The patch completely removes .inittransparencymask because it is noop.

With the test case of the bug 689708 at 144 dpi 
with default band size it reduces
the temp file size from 64.8Meg to 36.5 Meg,
and speeds up the rendering in 11 times.

With the test case of the bug 689714 at 144 dpi
with default band size it reduces
the temp file size from 12.0Meg to 3.3 Meg,
and speeds up the rendering in 11 times.

The speed factor depends on resolution.

[lib/pdf_draw.ps lib/pdf_ops.ps]

2008-02-27T19:22:57.279403Z Igor Melichev

Fix (clist interpreter) : Improve transparency performance, step 4.

DETAILS :

Bug 689708 "Long processing time of PDF file"
Bug 689714 "Severe performance penalty for PDF transparency through to clist"

The patch completely removes .inittransparencymask because it is noop.

With the test case of the bug 689708 at 144 dpi 
with default band size it reduces
the temp file size from 64.8Meg to 36.5 Meg,
and speeds up the rendering in 11 times.

With the test case of the bug 689714 at 144 dpi
with default band size it reduces
the temp file size from 12.0Meg to 3.3 Meg,
and speeds up the rendering in 11 times.

The speed factor depends on resolution.

[src/gstrans.c src/ztrans.c src/gdevpdft.c src/gstrans.h src/gdevp14.c]

2008-02-27T18:39:31.036262Z Igor Melichev

Fix (clist interpreter) : Improve transparency performance, step 3.

DETAILS :

This is a preparation for fixing bug 689708 "Long processing time of PDF file"
The last patch appears incomplete, now fixing.

[src/gxistate.h]

2008-02-27T00:47:37.036819Z Marcos H. Woehrmann

Added setting of fill_rule in pclxl_endpath().

DETAILS:

The pclxl_endpath() function checked if a clip_rule needed to be set but not a fill_rule.

This is a fix for bug 689665.


[src/gdevpx.c]

2008-02-27T00:08:22.308407Z Igor Melichev

Fix (clist interpreter) : Improve transparency performance, step 2.

DETAILS :

This is a preparation for fixing bug 689708 "Long processing time of PDF file"
The last patch appears incomplete due to a missed dependence in makefile.
Now we see the mask pointer was used but it was always NULL.

[src/lib.mak src/gxistate.h src/gsistate.c src/gdevpdfg.c]

2008-02-26T23:14:40.608304Z Igor Melichev

Fix (clist interpreter) : Improve transparency performance, step 1.

DETAILS :

This is a preparation for fixing bug 689708 "Long processing time of PDF file"
It completely removes the mask pointer field from gs_transparency_source_s.
No idea what it was defined for. Nobody uses it.

[src/gstrans.c src/gstrans.h]

2008-02-26T07:12:49.848447Z Alex Cherepanov

Change the decimal separator in generated strings to '.' effectively selecting
a C numeric locale without calling any locale functions. Bug 689624.

DETAILS:
For most clients Ghostscript is a library. We cannot set C locale before
sprintf() and reset it afterwards because this may affect other threads.

[src/spprint.c src/zdouble.c]

2008-02-25T16:10:43.614503Z Alex Cherepanov

Remove a space betveen -f and a file name to prevent parsing of the file name
that starts with '-' as an options. Bug 689682.

[lib/ps2pdfxx.bat]

2008-02-25T05:48:45.219666Z Alex Cherepanov

Add a check for null value. Since rev. 6956 following Adobe implementation
Ghostscript doesn't accept null as a key in dictionary look-up. Bug 689696.

[lib/pdf2dsc.ps]

2008-02-25T04:20:47.177440Z Alex Cherepanov

When the values of the color key mask exceed the valid range clip them to the
nearest valid values and continue. Don't discard the mask as we did before.
Bug 689717, customer 580.

[lib/pdf_draw.ps]

2008-02-24T09:21:54.361457Z Igor Melichev

Fix (images) : Improve coordinate precision when scaling an image (continued 8).

DETAILS :

Ghostscript Bug 687345 "Image interpolation problem at a band boundary"
Ghostscript Bug 689686 "siscale.c contrast degradation"

Accurately compute pixel center coordinates when applying the interpolation filter.
See comment in code. When scale=1, the offsets mutually eliminate.
Also the old code missed a bit when computing center_denom/2 in integers.

[src/siscale.c]

2008-02-24T03:37:03.979896Z Igor Melichev

Fix (images) : Improve coordinate precision when scaling an image (continued 7).

DETAILS :

Ghostscript Bug 687345 "Image interpolation problem at a band boundary"
Ghostscript Bug 689720 "Hang with -dDOINTERPOLATE caused by rev 8530 changes"

An expression for HeightOut missed 'abs' with recent patch.
Thanks to Ray for pointing it out.

[src/gxiscale.c]

2008-02-24T02:58:34.824461Z Alex Cherepanov

Fix link errors in the file descriptor-based implementation of file streams.
Move function used by both fd and stdio implementations to a separate file
and compile it in both versions. Bug 688918.

DETAILS:
Although the patch fixes link errors, pdfwrite and other devices,
use stdio functions directly and generate incorrect documents in fd version.

[src/lib.mak src/sfxstdio.c src/sfxcommon.c]

2008-02-24T01:12:18.214936Z Alex Cherepanov

Add definitions of some C99 types missing from old versions of Cygwin.

[src/stdint_.h]

2008-02-23T22:26:01.799844Z Ray Johnston

Fix typo that caused Cygwin build to fail if 'fontconfig' package was present.

[src/configure.ac]

2008-02-22T20:18:08.422807Z Igor Melichev

Fix (images) : Improve coordinate precision when scaling an image (continued 6).

DETAILS :

Ghostscript Bug 687345 "Image interpolation problem at a band boundary"
Ghostscript Bug 689718 "Regression: differences in FIG3.eps".

1. siscale.c : The revision 8529 patch part 4 tried to represent 'ceil' with rational 
arithmetics. But when downsampling the argument still uses a floating
number WidthIn, so we still need 'ceil'. 
This patch converts the formula back to floats, 
assuming that double precision is enough for precise result 
because source image size usually is smaller than 2^24.

The wrong rational representation of 'ceil' caused an array element index 
to fall outside the array. Debugged with FIG3.eps.

2. Improved debug printing and visual trace.

[src/gsimage.c src/lib.mak src/gxiscale.c src/siscale.c src/gdevm24.c]

2008-02-22T10:29:49.290734Z Igor Melichev

Fix (FAPI) : Embedded fonts didn't work (continued).

DETAILS :

A condition for querying a glyph in GlyphDirectory was wrong.
Debugged with buttons.pdf from Karen.

[src/zfapi.c]

2008-02-22T10:09:30.542153Z Igor Melichev

Fix (FAPI) : Embedded fonts didn't work.

DETAILS :

Embedded Type 42 FAPI support was broken since
Revision 7107 Sun Oct 15 17:19:45 2006 UTC (16 months, 1 week ago)
due to premature binding.

[lib/gs_typ42.ps]

2008-02-20T21:02:48.212097Z Igor Melichev

Fix (images) : Improve coordinate precision when scaling an image (continued 5).

DETAILS :

Ghostscript Bug 687345 "Image interpolation problem at a band boundary"

This is a further improvement to image placement precision.
Debugged with a.pdf .

The old code provides insufficientg precision when computing 
transformation matrix for an image. This computation
include matrix inversion and matrix miltiplication.
The old code uses floats and causes a visible shift of subimages with banding.
The new code uses double precision.

We didn't test how it relates to the revision 7026 change, 
which dectreased the matrix precision for CPSI compatibility.
It should be a separate job.

In the new gsmatrix.c code we simply duplicate old code fragments
and replace types for double. We don't want to define a template
for now. Will see after the code passes enough practical work.

Besides that, in gxidata.c replaced fixed2int_pixround
with fixed2int_pixround_perfect. It is not related to a.pdf,
but we believe it is an useful change.

In gxipixel.c the patch replaces dda_advance with a repeated dda_next.
The old code appears implrecise due to loosing fraction pixels.
It eliminates a 1 pixel difference with Bug688789.pdf .

Minor changes : inserted debug printing and visual trace.

[src/lib.mak src/gsmatrix.c src/gximono.c src/gxidata.c src/gsmatrix.h src/gdevm24.c src/gxipixel.c]

2008-02-18T20:28:59.836803Z Ralph Giles

Propagate the new method argument change introduced in r8528 to the wts
device so that it compiles again.

[src/gdevwts.c]

2008-02-17T23:36:50.588580Z Igor Melichev

Fix (images) : Improve coordinate precision when scaling an image (continued 4).

DETAILS :

Ghostscript Bug 687345 "Image interpolation problem at a band boundary"

This patch doesn't change the algorithm.
It only removes tracks of dead development branches.

[src/gxiscale.c src/siscale.c src/gxipixel.c]

2008-02-17T23:25:47.528293Z Igor Melichev

Fix (images) : Improve coordinate precision when scaling an image (continued 3).

DETAILS :

Ghostscript Bug 687345 "Image interpolation problem at a band boundary"

1. The macro fixed2int_pixround returns a mathematically incorrect
result with negative half-integer arguments.
For example fixed2int_pixround(-2.5) = -3 when the math gives -2.
We guess it was designed for positive page coordinates only,
but later it was applied to objects with negative coordinates.
Particularly, an image can start outside the page with a negative coordinate,
and fixed2int_pixround causes distorsions with banding.

We do not update fixed2int_pixround for backward compatibility 
of other parts of the algorithm. Instead that the patch defines 
a mew macro fixed2int_pixround_perfect, and applies it to
images with Interpolate=true. (gxfixed.h, gxipixel.c, gxiscale.c).

2. Added gx_image_enum_s::yi0 to provide entire image origion in the page.
This value does not depend on band size, so it gives more stability -
see below. (gximage.h).

3. Added entire image sizes to stream_image_scale_params_s
for source image and scaled image. These values do not depend on band size
and provide more stability - see how they are used in siscale.c. 
(sisparam.h, gxiscale.c).

4. (siscale.c) calculate_contrib now computes the filter kernel center
with global (page) coordinates of the image, using the right macro 
fixed2int_pixround_perfect and with the rational arithmetics
instead floats. It gives the kernel center position relatively to source image
with no dependence on the band size.  Also improved the debug printing
about that.

5. In siscale.c we keep track of some experiments done while
developing the patch. We need to save them to history because they're not trivial.
See comments in code. We'll remove them from trunk with a separate patch.

[src/lib.mak src/gxiscale.c src/gxfixed.h src/siscale.c src/sisparam.h src/gximage.h src/gxipixel.c]

2008-02-17T22:32:15.427994Z Igor Melichev

Fix (images) : Improve coordinate precision when scaling an image (continued 2).

DETAILS :

Ghostscript Bug 687345 "Image interpolation problem at a band boundary"

This patch does not change the algorithm,
except adding a debug printing with y coordinate of an image rectangle
in the page coordinate systems. It allows to compare
image fragments, which fall to verious bands depending on band size.

We could wrap the definition of gx_device_memory_s::band_y 
and all access to it with #ifdef DEBUG,
but we don't want to reduce the readability and because
memory and the CPU time expense is too small.

[src/gxclist.c src/gxdevbuf.h src/gxdevmem.h src/gdevppla.c src/gdevmem.c src/gdevbmpa.c src/gdevprn.c src/gdevppla.h src/gdevm24.c src/gxclread.c src/gdevpng.c src/gdevprn.h src/gdevijs.c]

2008-02-17T03:59:45.216145Z Ray Johnston

Fix for regressions introduced with rev 8526. Some resolutions of CMYK, 1-bit
per component devices that had CMYK colors and Gray colors had strange dithers.
Bug 689706.

DETAILS:

The previous changes missed changing the cache index logic in gx_render_ht_1_level,
If the cache had been set with one of the other routines, gx_render_ht_default or
gx_dc_ht_binary_load_cache, then gx_render_ht_1_level would be inconsistent.

EXPECTED DIFFERNCES:

This is expected to resolve the regressions from rev 8527 with pkmraw on:

035-01.ps
119-28.ps
1_2001.pdf
Altona-Testsuite_p2_S_x3.pdf
Altona_Measure_1v1.pdf
Altona_Visual_bb_1v1_x3.pdf
Altona_Visual_sb_1v1_x3.pdf
BEST8-99-Path.fh7.pdf
BW0696FOLD1FRONT.pdf
Bug687489.ps
Bug687724.pdf
Bug687832.pdf
Bug687840.pdf
Bug688308.ps
Bug688822.eps
Bug689269.ps
Clarke-Tate-Manns-Chinese.ai
H00216q.pdf
Original.pdf
S2_Digitalproof-Forum_x3k.pdf
a.pdf
besttest.pdf
cmyk.pdf
foo.pdf
knight.pdf
test.pdf
time1.pdf

[src/gxht.c]

2008-02-14T08:34:56.225081Z Ray Johnston

Improve Halftone tile cache efficiency. Make default cache large enough
on default 32-bit (LARGE) configuration to allow for > 256 cache tiles
when using the 'ht_ccsto.ps' 167x167 Threshold array. Change cache
lookup logic to eliminate collisions when the number of cache slots
exceeds the number of levels (the normal case). Remove duplicated
ht cache default size #defines and normalize the names to end in
_size (to imply size in bytes) and be consistent with other similar
function/macro names.

DETAILS:

When we have more cache slots than the number of levels, we can use
the 'b_level' directly and don't lookup based on the 'number of bits'
(level). This ELIMINATES collisions and on customer 661's benchmarks
resulted in up to 40% performance improvement for some files with
no performance degradation on any when running a large threshold
array based halftone (as the customer does).

The previous -Z. behavior is retained, although small cache sizes
are of questionable value, and this is sort of confusing since a
small memory build will use the same cache size with and without
-Z.

[src/gshtscr.c src/gzht.h src/gsht.c src/gdevprna.c src/gxht.c]

2008-02-12T20:30:17.540929Z Igor Melichev

Fix (images) : Improve coordinate precision when scaling an image (continued).

DETAILS :

Ghostscript Bug 687345 "Image interpolation problem at a band boundary"

This is another partial fix for the bug 687345 for portrait images with Interpolate=true.
Debugged with CET 148-13.

1. The old code inprecisely computes the scaling factor
when interpolating images with Mitchel filter.
The computation was done with the subimage rectangle,
which is different for different bands.
The new code always computes the scale from the entire image rectangle,
which's size is same for all bands.

2. New fields are inserted into gx_image_enum_s and stream_image_scale_params_s
to provide data delivery for (1).

3. In calculate_contrib in siscale.c the variable input_index
is renamed into starting_output_index for a better reflection of its semantics.

4. In calculate_contrib in siscale.c the new variable dst_offset_fraction
is added for a preciser positioning of the filter center,
when it fails between device pixel rows. The old code missed fractional
pixels when stepping to a next band. The expression for its value 
was created empirically, so it may need further improvements.

5. Inserted visual trace instructions for easier debugging.

6. Improved the debug trace printing.

[src/gxdda.h src/lib.mak src/gxiscale.c src/siscale.c src/sisparam.h src/gximage.h src/gxipixel.c]

2008-02-12T19:03:19.125442Z Ralph Giles

Document the need to update the current documentation snapshot.

[doc/Release.htm]

2008-02-09T02:30:31.322331Z Ralph Giles

Clamp the number components read from the ICC DataSource array to the 
number actually allocated to avoid buffer overflow. CESA-2008-001.

[src/zicc.c]

2008-02-09T00:55:38.575949Z Ralph Giles

Include 12 and 16 bit image support as part of the core graphics 
library. Bug 689688.

Details:

Previously, the core graphics library defaulted to including the 
'no12bit' and 'no16bit' modules, which contained stubs. These modules
were replaced by full implementations when the psl2lib (12 bit) and 
pdfread (16 bit) modules were included.

We now consider this build-time flexibility redundant. The extra code is 
not large and the default build generally includes it as these images 
are part of all the newer page description languages. We therefore 
include the unpack routines directly in libcore and remove the 
noi1xbit modules entirely.

[src/lib.mak src/int.mak]

2008-02-07T09:33:22.506379Z Ken Sharp

Fix (pdfwrite): problems with unusual PDF text rendering modes.

Details:
Bug #689596 "Generated PDF loses an image from original".

Although the PDF interpreter stores both stroke and fill colours,
there is no way to pass both these colours to the graphics library.
The PostScript graphics state may only contain a single colour, and the
device interface only allows for a single colour to be passed.

The old code set the text rendering mode, and assumed that if the
current device was pdfwrite this would be sufficient. However the
need to set both colours causes this to fail.

Modified the pdf_ops to set a show/colour/charpath/stroke combination
instead. The existing code will spot text followed by a charpath of
the same text and collapse it back.

A number of other problems with text rendering modes were also addressed
at the same time, but in a less than optimal fashion. This patch
is a temporary fix while an enhancement is coded to better address
the problem.

(gdevpdts.c) pdf_render_mode_uses_stroke, was checking for render mode
not 0 (fill). Altered to check against the actual stroking modes.

(gdevpdtt.c) pdf_update_text_state was setting the text rendering mode
to 0 (fill) under most conditions. Altered this to set the mode from
the graphics state, unless the current font PaintType is 2 (stroke),
and the render mode is 0, in which case set render mode to 1 (stroke).

(pdf_ops.ps) Modify setshowstate to provide better methods of implementing
various text rendering modes to pdfwrite. Rendering is unaffected by
this change.

[src/gdevpdts.c src/gdevpdtt.c lib/pdf_ops.ps]

2008-02-04T22:18:08.283584Z Igor Melichev

Fix (images) : Improve coordinate precision when scaling an image.

DETAILS :

Ghostscript Bug 687345 "Image interpolation problem at a band boundary"

This is a partial fix for the bug 687345 for images with Interpolate=false.
Actually it is related to scaling raher than interpolation.

1. gx_image_enum_begin performed inaccurate coordinate computations,
which caused a different image bias for different bands
due to a wrong coordinate rounding.
The patch replaces it with a better code,
which provides same bias for all bands and for unbanded rendering.
But we're not sure that image placement is now perfect,
because the initial rounding looks strange.
We keep the initial rounding to be compatible with the old code
to minimize raster differences and easier visual analyzis.
For a while we keep the old code in #if 0 because
it may be useful for next patch.

2. image_render_frac contains optimized branches for the case when
image's axes are parallel to page's axes.
Those optimized branches convert parallelograms into rectangles,
except for the last parallelogramm in the chunk.
It caused the last parallelogram to shift in 1 pixel relatively 
to the rectangles. This patch adds the optimized branch
for the last parallelogram, so that all image parts
are now placed with same rounding. It avoids rendering artifacts
with 148-05.ps and many other tests. Note that the patch does not fix
the rectangle shift from parallelograms,
so probably it still contain another bug,
which may need a separate fix.

3. While working on this patch we noted that update_strip
doesn't correctly preserve the fractional part for
dda.strip and dda.pixel . We include a track of that experiment
in the new code in #if 0 section for further development.
See comment in code.

4. Inserted visual trace commands for easier debugging.

[src/lib.mak src/gxidata.c src/gdevddrw.c src/gdevm24.c src/gxclread.c src/gxi12bit.c src/gxipixel.c]

2008-02-03T17:54:23.256452Z Alex Cherepanov

Modify pdf_info utility to match the changes in PDF interpreter interface.
Bug 689680.

[toolbin/pdf_info.ps]

2008-02-01T22:05:51.322620Z Igor Melichev

Fix (graphics) : Interpolated images were shifed in a half of source pixel.

DETAILS :

Bug 687039 "Interpolated images looks strange on Win32 display device".

1. The old code maps the center of the [0,0]th source pixel
   to the output image origin. However Adobe maps 
   the source pixel's corner to the output origin.
   This patch compensates the shift when computing the
   filter kernel position - see '0.5' when computing 'center'.

2. When the filter kernel scans partially outside the source image,
   the math requires to extrapolate source data somenow
   to fill the kernel. However the old code performs some strange
   computation, which we're not sure what for.
   It looks as a rudiment of wrapping the source image
   like a thorus. Well, it's an useful math for periodic patterns,
   but not for single images. Since we never apply siscale.c to 
   patterns, we replace this code portion with a simpler one,
   which duplicates pixels at image boundaries.
   See attachment to the bug to prove that Adobe does so.

[src/siscale.c]

2008-01-31T22:20:32.934182Z Ray Johnston

Fix ColorValues parameter problem when device has total number of bits (depth)
of more than 31 bits, resulting in a "rangecheck" (-15) error.

DETAILS:

The default get_params would not return -1 for values too large for 32 bits,
but the default put_params tested for this. The rangecheck would show up
on 32-bit devices, such as tiff32nc when running:
   "currentpagedevice setpagedevice"
Note that the value returned for ColorValues was platform dependent since
it previously set ColorValues to 1<

[src/gsdparam.c]

2008-01-29T17:02:50.720617Z Igor Melichev

Fix (graphics) : Optimize filling a path with a shading color (continued 2).

DETAILS :

Bug 688970 "(shadings) Optimize filling a path with a shading color".

A minor code cleanup : Removing code portions that became unused.

[src/gsptype2.c src/gsptype2.h src/gximask.c src/gxfill.c]

2008-01-29T12:41:42.337727Z mpsuzuki

Fix (TT): Ignore broken post 2.0 table generated by "Windows Type 1 Installer".

DETAILS:

This is the second fix for bug 689495, that is quite specific
to a TrueType font generated by "Windows Type 1 Installer".

"Windows Type 1 Installer" makes a TrueType font including broken
post table in format 2.0. Previous fix (SVN revision 8351) just
ignores such broken post table, and ISOLatin1Encoding is used
for fallback. When such TrueType font is combined with WinAnsiEncoding,
some glyph names (exists only in WinAnsiEncoding) cannot be resolved.

The post table format 2.0 uses 2 maps to assign a glyph name to
TrueType glyph index: the first map is from TrueType glyph index
to glyph name index (glyphNameIndex[] array), the second map is
from glyph name index to glyph name string (names[] Pascal string
array). The broken post table generated by "Windows Type 1 Installer"
seems to use name[] array by TrueType glyph index directly, and
the glyphNameIndex[] array has unreliable values.

This patch sets /.broken_post when the post table is broken (the
detection of broken post table is same with SVN revision 8351),
then use names[] array by TrueType glyph index when /.broken_post
is set.

[lib/gs_ttf.ps]

2008-01-29T11:54:50.007576Z Igor Melichev

Fix (graphics) : Optimize filling a path with a shading color (continued).

DETAILS :

Bug 688970 "(shadings) Optimize filling a path with a shading color".

A minor code cleanup : prepare to eliminate gx_dc_pattern2_clip_with_bbox.

[src/gximask.c]

2008-01-28T23:02:59.180158Z Igor Melichev

Fix (graphics) : Optimize filling a path with a shading color.

DETAILS :

Bug 688970 "(shadings) Optimize filling a path with a shading color".

When filling a path with a shading color, the old code
first intersects the the clipping path with the path,
then intersects the result with the shading BBox.
However the intermediate result frequently appears to be 
a big list of rectangles, so the second intersection is slow.

This patch accounts that the clipping path and shading BBox
frequently are rectangles, which are easier to intersect with
no converting to paths. Also the shading box is always a quadrangle,
so intersecting it early gives a smaller intermediate result.
Therefore we first intersect the clipping path with the shading BBox,
then with the path.

This patch keeps the old code within #if #endif
until the full regression testing is passed on the server.
Also would like to eliminate the old complicated function 
gx_dc_pattern2_clip_with_bbox, which is still called from elswhere.

[src/gsptype2.c src/gsptype2.h src/gxfill.c]

2008-01-28T10:31:45.187261Z mpsuzuki

Fix: ignore the embedded font resource when PDF interpreter resolves
     the unembedded font resource.

DETAILS:

Some PDF generators (e.g. Microsoft Office 2007 add-on to export the
documents to PDF format) emits incompatible font objects with same
resource name. The sample PDF in bug 689637 includes 2 "Times New
Roman" font objects: one is embedded CID-keyed TrueType for Cyrillic
glyphs, another is unembedded WinAnsiEncoding TrueType (possibly for
empty page header or footer). When PDF interpreter resolves latter
unembedded "Times New Roman", external font resource should be used
(Adobe Reader does so). But current Ghostscript uses former embedded
"Times New Roman", because the sample PDF includes "Times New Roman"
without randomization prefix.

To avoid the confusion between embedded and unembedded fonts with
same name, pfont->is_resource flag (=0 embedded, =1 unembedded)
is checked during font object resolution. Even if a cached font
object with same name is found, it is ignored if it is embedded
font. To execute this check in PostScript space (pdf_font.ps),
new operator ".isregisteredfont" is introduced. This patch assumes
that embedded font object in PDF is resolvable by tracking the
indirect object references. If a PDF assumes name-based resolution
of embedded font object (without indirect object), it may be
rendered by external font resource. At present, we don't have
such sample.

By this patch, bug 689637 is fixed.

[lib/pdf_font.ps src/zfont.c]

2008-01-28T09:58:54.861949Z mpsuzuki

Fix (TT): Fix a bug in /getinterval_from_stringarray

DETAILS:

getinterval_from_stringarray is a procedure defined to
extract a substring from long table of TrueType font.
When a table is too long to fit into 16bit-length string
object in PostScript, gs_ttf.ps split the table into
the array of strings. When getinterval_from_stringarray
is requested to extract a string which starts in one
member and ends in following member, it returns a string
that only the content of the first member is copied.
There was a wrong conditional that made the substring
extraction aborted. It was fixed to return the correct
substring.

By this fix, bug 689593 (IPA font 2007 edition cannot
be parsed correctly) is closed.

[lib/gs_ttf.ps]

2008-01-28T08:50:10.139318Z Igor Melichev

Fix (clist & transparency) : Improve the compositor queue logic (continued).

DETAILS :

The last commit is incomplete due to human error.
Please don't use the last revision.

Bug 689492 "Ghostscript uses a large amount of memory", part 2.

This patch fixes the missed shadow of a text, which is mentioned 
in the Comment #8 of the bug report.

1. Added macros for configuring visual trace for easier debugging.
2. The idle transparency bufer allocation condition was wrong. 
   The patched code allocated ;esser buffers.
3. Found more cases when a mask needs to be released.
4. The old code immediately executes idle masks.
   It caused a wrong order for compositor execution
   with images that have a soft mask.
   With the test case the image's mask was executed before 
   the group that containing the image.
   It caused a premature releasing of a mask,
   which preceeeds the group and must noy be released.

   The new code delays the execution of idle masks
   after all containing groups are executed,
   so that the queue is now longer and stores all masks.
   We beleive that's not harmful, because
   transparency queue elements are pretty small and
   work for hos based applications only.

   The new function mark_as_idle works for the new logic.
   Few aother functions are enhanced with a smarter
   processing of the idle flag.
5. Improved comments for the compositor queue logic.

[src/gdevp14.c]

2008-01-28T08:45:21.850870Z Igor Melichev

Fix (clist & transparency) : Improve the compositor queue logic.

DETAILS :

Bug 689492 "Ghostscript uses a large amount of memory", part 2.

This patch fixes the missed shadow of a text, which is mentioned 
in the Comment #8 of the bug report.

1. Added macros for configuring visual trace for easier debugging.
2. The idle transparency bufer allocation condition was wrong. 
   The patched code allocated ;esser buffers.
3. Found more cases when a mask needs to be released.
4. The old code immediately executes idle masks.
   It caused a wrong order for compositor execution
   with images that have a soft mask.
   With the test case the image's mask was executed before 
   the group that containing the image.
   It caused a premature releasing of a mask,
   which preceeeds the group and must noy be released.

   The new code delays the execution of idle masks
   after all containing groups are executed,
   so that the queue is now longer and stores all masks.
   We beleive that's not harmful, because
   transparency queue elements are pretty small and
   work for hos based applications only.

   The new function mark_as_idle works for the new logic.
   Few aother functions are enhanced with a smarter
   processing of the idle flag.
5. Improved comments for the compositor queue logic.

[src/gxclrast.c]

2008-01-26T13:21:27.618379Z Igor Melichev

Fix (transparency) : Memory leak after an image with soft mask.

DETAILS :

Bug 689492 "Ghostscript uses a large amount of memory".

When a PDF command stream executes "/d1 gs /d2 gs" where d1 and d2 both define an 
untrivial SMask (not important whether they are same mask or different masks),
the second mask replaces the first one, and the first one to be released.

When a transparent group includes an image with a soft mask 
(this case happens in the test document for the bug), the image's soft mask must 
*temporary* replace the groups soft mask, and the first mask must not 
be released.

The old code does not distinguish these cases, assuming that 
a mask buffer is being released after rendering a group with it.
Due to that some mask buffers were never released,
causing a memory leak with banded rendering,
because the clist interpreter doesn't run the garbager.

A simpler case for demonstrating the leak could be created with 
"/d1 gs /d2 gs" as explained above.

The patch defines a new bool gs_transparency_mask_params_s::replacing, 
gx_transparency_mask_params_s::replacing and gs_pdf14trans_params_s::replacing
for passing the necessary information through old interfaces.
Note that as usual we cannot change the device interface for 
an easier passing of this info, because we need to maintain
the compatibility with 3d party devices.

Using the 'replacing' flag, pdf14_push_transparency_mask either replaces
the old mask buffer, or creates a new one as a temporary substitution for
an image with a soft mask. In the second case the group mask is
saved in the last transparency stack element in the field 
buf->maskbuf. After rendering the image's group 
the function pdf14_pop_transparency_group restores 
the saved mask buffer, as it was set in the transparency context
before starting the image's mask. For more details see
comments added into gdevp14.c .

[src/gstrans.c src/ztrans.c src/gstparam.h src/gstrans.h src/gdevp14.c]

2008-01-25T08:17:16.431601Z Igor Melichev

Fix (Font renderer) : Horizontal metrics sometimes applied with WMode 1 fonts.

DETAILS :

Bug 689464 "Japanese font writing direction (vertical ?)".
Bug 689646 "vertical text rendered by external CIDFontType0 flows horizontal".

1. When a descendent font of a type 0 CID font has zero FontBBox,
   use the FontBBox of the CID font. This is another case when
   a 3d party software generates a font with zero FontBBox.
   We believe that such font data is incorrect, 
   but this patch provides a simple workaround.

2. When FontBBox to be used to compute Metrics2,
   don't obtain sbw from type 1 glyph descriptions.
   The old code does so causing the horizontal metrics
   to be used when rendering a WMode 1 font. 

3. The case (2) appears to have an exception,
   when the font has CDevProc. In this case 
   we do need sbw from the glyph description
   to provide arguments for CDevProc.
   See alse the comment added to code.

Note that Type 1 font renderer now depends on some knowledge about type 0 CID font.
But this dependence does not break the configurability
because only an .h file is included into the Type 1 font renderer.

[src/int.mak src/zchar1.c]

2008-01-23T21:13:16.354024Z Igor Melichev

Fix (clist & transparency) : Inconsisting compressed color index info.

DETAILS :

Bug 689626 "Segmentation Fault using 'bit' device to clist.".

The bug was put while the custom color callback merge in revision 7795.
The color index information to be passed to the clist writer
after restoring the color information to the clist writer.
Before restoring it is set to a blending space,
which may be incompatible with the target device's color index type.

I'm unable to test this patch fully
due to no test cases for antrivial spot colors with transparency.

[src/gdevp14.c]

2008-01-23T18:33:35.648405Z Igor Melichev

Fix (DSC parser) : Avoid a structure type name duplicate.

DETAILS :

The old name cmd_list_s is also defined in gxclist.h .
It confused MSVC debugger while tracing gxclutil.c for bug 689626.

[src/zdscpars.c]

2008-01-23T18:12:27.956590Z Igor Melichev

Fix (patterns) : The clipping was wrong with antrivial pattern matrix (continued).

DETAILS :

Bug 687196 "Incorrect pattern processing from Adobe test file pattyp1.ps".
This is a partial fix for the bug, which fixes vector devices only.
It closes the bug with the last patch applied.

The old code set identity matrix for a pattern dstream accummulation.
It appears incompatible with Type 2 pattern handler, which assumes
the default page matrix. This patch changes the matrix and improves
the pattern stream accumulator with accounting the default page scale. 

[src/gdevpdfi.c src/zpcolor.c]

2008-01-23T18:09:49.970130Z Igor Melichev

Fix (patterns) : The clipping was wrong with antrivial pattern matrix.

DETAILS :

Bug 687196 "Incorrect pattern processing from Adobe test file pattyp1.ps".
This is a partial fix for the bug, which fixes raster devices only.

1. The old code always sets a canonic rectangular clipping,
   which is wrong with rotated or skewed matrices.

   Note the patch resets path in the pattern's graphic state.
   It is not done in the old code, so it may cause raster diferences.
   But it is required in PLRM chapter 8 by the definition of 'makepattern'.

2. Adjust the pattern matrix to pixel grid.
   After doing the change (1) the clipping area appears too small for some cases.
   It happens because the tile origin falls at fractional pixels,
   The new code causes a massive raster difference, which actually is minor
   (a shift of some pattern instances in 1 pixel).

   Note that PLRM requires to adjust pattern matrix in the definition of 'makepattern',
   but doesn't explain how to.

3. In compute_inst_matrix perform computations in 'float'
   because the matrix is represented with 'float'.

4. (miror change) Expanded the 'mat' macro for easier debugging with MSVC.

[src/gsptype1.c]

2008-01-23T16:49:51.344351Z Ken Sharp

Fix (pdfwrite): Wrong format string for pprintg.

Details:
Bug #689661 "pdfwrite : Incorrect sprintf format".

(gdevpdfu.c) The new function, 'pdf_write_font_bbox_float,
added in revision 8360, used the wrong format string (%f
instead of %g) to write the font BBox.

[src/gdevpdfu.c]

2008-01-23T13:30:39.283039Z Igor Melichev

Fix (shadings) : A memory deallocation problem.

DETAILS :

Bug 689660 "memory deallication problems with shadings".

The old code used pdev->memory for temporary storing 
an intersection of clipping path with shading bbox.
This is the global memory space.
However if the intersection is trivial,
the path of the clipping path is copied from the 
original clipping path, which is allocated in the local memory space.
Later it causes a freeing of path segments to a wrong memory space.

This patch chooses the original clipping path's memory space
when the clipping path is available, and the global space otherwise.

[src/lib.mak src/gsptype2.c]

2008-01-23T13:23:09.676697Z Till Kamppeter

Added HP's KRGB patch for improved control of true black text printing on color printers with HPIJS. Bug #689065 (Ubuntu LP: #69905) is fixed in this updated version of the patch.

[src/gdevijs.c]

2008-01-21T20:59:55.657274Z Igor Melichev

Fix (save/restore) : Remove gs_ref_memory_s::inherited.

DETAILS :

It is not used since revision 5250.

[src/gxalloc.h src/igc.c src/gsalloc.c src/isave.c]

2008-01-20T22:23:07.686290Z Igor Melichev

Fix (save/restore) : Do not create invisible save levels.

DETAILS :

Invisible save levels is a rudiment of old code.
gs_ref_memory_s::scan_limit effectively work instead them 
since revision 6706 committed on April 14 2006.

We're not sure what gs_ref_memory_s::inherited works for.
Keeping it updated for a while, and don't remove the 
old code for reference. Note the maintanence of gs_ref_memory_s::inherited
in the new code is not fully equivalent to old code.

[src/isave.c]

2008-01-20T09:56:15.017727Z Ralph Giles

Only report the ICC Profile colorspace when the jasper library's debug 
level is above zero. Bug 689662.

[jasper/src/libjasper/jp2/jp2_dec.c]

2008-01-20T09:21:15.660626Z Igor Melichev

Fix (save/restore) : Compact the changes list against big memory leak.

DETAILS :

Bug 689536 "Memory leak reading PostScript file (PMR 53877).".

The old implementation includes an optimization agains a big CPU time expense
in 'save' and 'restore' for sedtting and resetting l_mark flags.

Normally, when executing 'save', the memory manager needs
to reset l_new marks for objects modified or allocated at the last save level,
so that their further modification on the next save level to be saved
in the changes list. When executing 'restore' these flags to be set 
to prevent redundant save.

When the last save level includes many allocations, 
the number of scanned objects is big and it causes a significant
time expense. A long ago Ghostscript implements an optimization,
which shorten the scanned list against the big time expense.
However the shortening causes redundant saving.

The redundant saving itself isn't harmful because
it happens seldon and spends a small memory.
However if a redundant save element points to a reference to
a newly allocated array or dictionary, the array or dictionary
can't be garbage collected. When a client executes such allocation and 
same reference modification multiple times, all allocated arrays
and dictionaries persist in memory, causing a significant memory leak.

This patch compacts the saved change list whem a significant memory 
allocation is accummulated since last save or since last compacting.
The new field gs_ref_memory_s::total_scanned_after_compacting
works for counting allocated elements. The new function 
drop_redundant_changes performs the compacting. See comments in its code.

The threshold for starting drop_redundant_changes is choosen arbitrary. 
It must not be too small, because the CPU time expense
optimization wouldn't be effective. Also it can't be too big,
because the memory leak recovery would not be effective.
This patch sets it to about 1600000 objects,
which is an experimental trade-of.

Note that this patch reduces the memory leak but doesn't
eliminate it to zero, because more data may be allocated
after the last filtering.

We could implement a filtering within the garbager rather 
than withis save/restore. Actually it wouldn't change 
the behavior to much, because the threshold would be still needed 
against the CPU time expense, It happens because the scanning
deals with array or dictioanr elements rather than with
whole aggregates. Also we don't want to complicate the garbager.

Note that the arbitrary threshold is bigger than neccessary
for the simplified test case included into the bug report.
Due ti that the leak elimination does not happen with this test.
For the compacting to take place the sequence "NEWJOB Z"
to be repeated 90 times rather than 40 in the supplied test. 
The customer's test does demonstrate the leak reducing.

[src/gxalloc.h src/gsalloc.c src/isave.c]

2008-01-18T21:50:38.830947Z Alex Cherepanov

Explicitly close CMap files opened during CMap-CIDFont font enumeration.
On certain systems file handles were used up before GC freed inaccessible
handles causing PostScript errors. Bug 689594.

[lib/gs_cidcm.ps]

2008-01-18T06:17:02.734368Z Alex Cherepanov

Add redefinition of setpagedevice to ps2epsi utility to support PS files
that call setpagedevice. Bug 689650.

[lib/ps2epsi lib/ps2epsi.ps lib/ps2epsi.cmd lib/ps2epsi.bat]

2008-01-17T13:50:43.754302Z Igor Melichev

Fix (clist interpreter) : Skip idle compositors, step 6.

DETAILS :

Enabling visual trace for buffer backdropping.

[src/gdevp14.c]

2008-01-17T13:47:11.707889Z Igor Melichev

Fix (visual trace) : Add a single pixels painting operation.

DETAILS :

This patch doesn't change the algorithm.
It only enhances debuging instrument.
The new instrument will be used for debugging the clist logics about transparency masks.

[src/vdtrace.h src/vdtrace.c src/dwtrace.c]

2008-01-17T13:37:19.476394Z Igor Melichev

Fix : Cygwin/gcc warnings.

[src/gdevcgm.c src/int.mak src/gstrans.c src/gdevpdfe.c src/gdevbit.c src/devs.mak src/gxclread.c src/gscdevn.c src/gscie.c src/gxclutil.c src/lib.mak src/gdevp2up.c src/gxclmem.c src/gdevdflt.c src/gdevpdtd.c src/gxcomp.h src/gsovrc.c src/gdevprn.c src/gscsepr.c src/genarch.c src/ztoken.c src/gdevp14.c]

2008-01-17T03:16:02.921192Z Alex Cherepanov

Comment-only change: remove obsolete reference to MS-DOS limitations and 
mention that PDF interpreter passes un-escaped font names to PS level.
Bug 689651.

[lib/Fontmap.GS]

2008-01-17T03:12:45.266699Z Alex Cherepanov

Remove the warning about non-embedded TrueType fonts in PDF files because it
confuses users but seems to have little effect on the main producer of
non-conforming files.

[lib/pdf_main.ps lib/pdf_font.ps]

2008-01-16T23:35:48.055065Z Ralph Giles

Unbreak the build.

[src/gdevp14.c]

2008-01-16T22:55:42.290132Z Igor Melichev

Fix (clist interpreter) : Skip idle compositors, step 5.

DETAILS :

This really skips compositors which don't paint anything.

Compositor parameter list structures are extended with a new boolean field 'idle'.
These fields pass information whether something was painted to a compositor.
We choosen this way for passing this info because 
(1) we can't change the device inteface with new function arguments, and 
(2) we need to pass it through the device chain
(for example, when a clipper is installed onth the overprint device).

This patch only affects the transparency and the overprint.
Other compositors (gsalphac.c, gxropc.c) behave as before. 
They may need further improvements.

This patch does not fix the bug 689492.
That fix may be done either before or after this one,
but in any case the patches need to adopt each to another.

The new compositor virtual method is_closing
checks whether a current compositor command
closes an older command, and finds the opening command.
Now we provide untrivial implementations for transparency and overprint compositors.
Would like to define an enum for return values of is_closing.

The old device method create_compositor now passes the 'idle' parameter via 
gs_composite_s structure. By default it is false and the behaviour
is same as before. But the clist interpreter is modified
to provide true value when a compositor doesn't paint anything.
To compute this flag the compositor queue now works with its full power.
Note we changed the queue representation with a bilikned list.

This patch entroduces the concept of 'friendly operations'
for compositor operations. These are those operations, which
may interchange with compositor installation/deinstallation.
One example is halftone operations, which always affect
the device below the compositor device, i.e. the target device
of the compositor device. The new compositor virtual method
is_friendly is implemented in an intrivial way for the
transparency compositor especially to exchange with halftone
operations while queueing clist operations.
This especially helps to delay the pdf14 device installation
so that it may completely annihilate with its deinstallation
if nothing is painted through the compositor in a band.

Overprint and transparency compositor implementations
are changed with checking the idle flag.
If it is set, they don't perform neither color blending, nor
raster buffer allocation. Note the pdf14 device maintains the buffer stack
as before, but the allocation of buffers may be skipped.
It saves significant time from cleaning up raster buffers when they are idle.

This patch may need further improvements for the case when
different compositor types are mixed in one queue. 
We could not fully test it due to absence of practical tests.

Another useful improvement would be to convert 
"0 .inittransparencymask 1 .inittransparencymask dict .setblendparams"
into a single command. It would simplify the compositor queue logic.
Also we think that the name .inittransparencymask doesn't reflect the function purpose.
Will improve someday.

We're not sure whether this patch correctly works with idle masks.
We could not debug it due to no practical cases.
Possibly idle mask will need an additional effort to skip 
the group painting to the band.

Also disabled cmd_put_halftone in c_pdf14trans_clist_write_update -
see comment in code.

Monor change : Inserted a visual trace support for transparency buffers.

[src/lib.mak src/zdict.c src/gdevdflt.c src/gdevp14.h src/gstrans.c src/gsalphac.c src/gxcomp.h src/gsovrc.c src/gstparam.h src/gstrans.h src/gxclrast.c src/gsovrc.h src/gdevp14.c]

2008-01-09T00:36:30.938192Z Marcos H. Woehrmann

Fixed umlauts (maybe, am having trouble testing the results).

[man/de/pdf2dsc.1]

2008-01-09T00:24:50.313955Z Marcos H. Woehrmann

Corrected man page (thanks to Peter Dyballa).

[man/de/pdf2dsc.1]

2008-01-09T00:00:59.719986Z Alex Cherepanov

Add unmodified byte-oriented AES encryption code by Brian Gladman. These
files serve as a reference point. They are not yet included into any
project nor can be compiled by some of the compilers we support.

[src/aes.h src/aes.c]

2008-01-07T20:58:40.018332Z Ralph Giles

Remove the obsolete gconfigv.h.

[src/lib.mak toolbin/msvcxml.bat src/openvms.mak src/unix-end.mak src/gs.mak src/std.h src/gscdefs.h src/macos-mcp.mak src/openvms.mmk src/os2.mak src/wctail.mak src/winlib.mak]

2008-01-07T20:58:36.882379Z Ralph Giles

Remove EXTEND_NAMES from the top level makefiles.

There is a fallback to the default value of 0 in inameidx.h so there
is no change in the default behaviour. The extended name table can
still be activated by defining EXTEND_NAMES on the compiler command
line or changing the source directly.

[toolbin/msvcxml.bat src/openvms.mak src/unix-end.mak src/gs.mak doc/Use.htm src/int.mak src/macosx.mak src/Makefile.in src/inameidx.h src/unix-gcc.mak src/macos-mcp.mak src/openvms.mmk src/os2.mak src/wctail.mak src/winlib.mak]

2008-01-07T18:43:02.811990Z Henry Stiles

Deprecate USE_FPU, no changes expected.

[src/gxchar.c src/openvms.mak src/unix-end.mak src/gsjmorec.h src/macosx.mak src/dvx-gcc.mak src/gxfarith.h src/msvccmd.mak src/siscale.c src/unixansi.mak src/gsmisc.c src/msvclib.mak src/gsfemu.c src/os2.mak src/openvms.mmk src/lib.mak src/bcwin32.mak src/ugcclib.mak src/gscie.h src/Makefile.in src/unix-gcc.mak src/gxfixed.h src/msvc32.mak src/macos-mcp.mak src/wccommon.mak src/wctail.mak src/winlib.mak src/watclib.mak]

2008-01-02T23:58:44.056429Z Alex Cherepanov

Re-export runpdfbegin, dopdfpages, and runpdfend procedures, which turned out
to be used by 3rd party programs. Partly revert the rev. 8325.

[lib/pdf_main.ps]

2008-01-02T13:10:59.547816Z Ken Sharp

Fix (pdfwrite): Tidy up after the prior patch, 
algorithmically this is the same as before.

Details:
Bug #689597 "PDF created with NoEmbed has wrong BaseFont name".

gdevpdtb.c, gdevpdtf.c, gdevpdtf.h, remove the redundant
routine pdf_choose_font_name.

gdevpdtb.c, gdevpdtd.c, gdevpdtf.c, gdevpdtb.h, modify the
function pdf_base_font_alloc to remove the redundant
argument 'orig_name', we always use the original font name
now.

[src/gdevpdtb.c src/gdevpdtd.c src/gdevpdtf.c src/gdevpdtb.h src/gdevpdtf.h]

2008-01-01T20:44:52.186969Z Alex Cherepanov

Don't ignore xref stream in a hybrid  "classic xref" + "stream xref" file
as PDF 1.5-compatible should do. Thanks to SaGS for the patch. Bug 688282.

[lib/pdf_main.ps]

2008-01-01T14:28:30.927323Z Alex Cherepanov

Replace clearly invalid generation numbers out of 0..65535 range with 0 during
rebuilding of xref table. Bug 689634.

[lib/pdf_rbld.ps]

2008-01-01T01:30:52.687921Z Ralph Giles

Remove the SYSTEM_CONSTANTS_ARE_WRITABLE compile-time define.

Details:

This was added so a particular application could rewrite the product name,
version, etc. after loading the library. We're not aware of anyone still
using the feature, and if so they can just change the source, which is
more appropriate in any case.

Also, remove USE_ASM from the msvc project file.

[toolbin/msvcxml.bat src/openvms.mak src/unix-end.mak src/gs.mak src/gscdefs.h src/openvms.mmk src/os2.mak src/wctail.mak src/winlib.mak src/gscdef.c]

2007-12-31T22:46:50.849681Z Alex Cherepanov

Add a flag that marks PDF text rendering mode 3 to avoid confusion with other
non-rendering text operations such as stringwidth. This avoids unnecessary 
calculation of the current point, which fails when the CTM is singular. This
patch continues conservative approach to the text rendering modes started in
rev. 4006. Bug 689614, customer 384.

[src/gxchar.c src/gstext.c src/gstext.h]

2007-12-31T19:06:52.216061Z Ray Johnston

Correct polarity of the stochastic threshold array so that the images are
not too dark.

DETAILS:

The original conversion from the threshold array provided by CalComp had
the threshold values inverted so that the implicit linearization was
inverted, making images much too dark. This correction provides reasonable
results on printers. Fine tuning of transfer functions can be used for
specific printers.

[lib/ht_ccsto.ps]

2007-12-31T18:07:59.109475Z Ralph Giles

Remove the USE_ASM build flag.
    
Details:
   
It was originally added to support vga mode setting, and has been 
used for a few minor optimizations since. We don't believe these 
are worth the trouble with modern compilers, so it is removed to 
simplify configuration management.

[src/unix-end.mak src/openvms.mak src/watcw32.mak src/gdevpcfb.c doc/Develop.htm src/msvccmd.mak src/iutilasm.asm src/gsmisc.c src/msvclib.mak src/dvx-head.mak src/devs.mak src/os2.mak src/openvms.mmk src/unixhead.mak src/lib.mak src/bcwin32.mak src/winint.mak src/gdevegaa.asm src/msvc32.mak src/gdevsvga.c src/gsutil.c src/wccommon.mak src/wctail.mak src/winlib.mak]

2007-12-31T06:10:33.027699Z Alex Cherepanov

Don't try to obtain the bounding box of a glyph when FontBBox is invalid and
CTM is singular. Set an empty box and consider it valid. The bounding box is
not used when the CTM is singular. Bug 689614, customer 384.

[src/zchar1.c]

2007-12-29T02:53:21.940078Z Ralph Giles

Remove the ARCH_CAN_SHIFT_FULL_LONG define and its derivatives. Bug 689611.

Details:

This was only used in one place, in an attempt to support
non-portable code. However this caused problems with recent
gcc's which optimized the test one way and the code in gxshade.c
another. We're therefore removing it entirely and just using
portable code.

[src/std.h src/gxshade.c src/gxbitops.h src/genarch.c]

2007-12-27T22:28:36.610626Z Ralph Giles

Add -Wundef to the autoconf build.

There have been a number of problems related to missing defines lately.

[src/configure.ac]

2007-12-22T19:13:20.335131Z Ralph Giles

Correction to the refcount documentation.

Our allocator can't double free, but attempting to trace a freed pointer
can confuse things, possibly resulting in a segfault or other
misbehaviour.

[src/gsrefct.h]

2007-12-22T02:05:40.922995Z Ralph Giles

Also remove gdevcmap from the documentation.

[doc/Develop.htm]

2007-12-22T02:05:36.008019Z Ralph Giles

Include gconfigv.h in std.h so defines like USE_FPU are more
consistently defined.

[src/lib.mak src/gscie.h src/std.h src/gdevpcfb.c src/gxfarith.h src/siscale.c src/gsmisc.c src/gdevsvga.c src/devs.mak src/sidscale.c src/gxpcopy.c]

2007-12-22T00:19:36.075695Z Ralph Giles

Document the behaviour of the reference count macros.

[src/gsrefct.h]

2007-12-22T00:10:05.865239Z Ralph Giles

Remove the unused cmap device.

[src/lib.mak src/ugcclib.mak src/gslib.c src/gdevcmap.c src/gdevcmap.h]

2007-12-21T19:58:19.459173Z Ralph Giles

Further update the graphics library unit test and build. The gslib test 
executable builds and works now.

[src/ugcclib.mak src/gslib.c]

2007-12-21T19:56:07.995361Z Ralph Giles

Construct romfs.dev in the graphics library's gen directory instead of 
the ps interpreter's so building just the library is possible.

[src/gs.mak]

2007-12-21T10:31:00.226023Z Ken Sharp

Fix (jbig2dec): The global data stream for a JBIG2 image in a PDF
file was being released, and the data freed by the garbage collector,
before the data was used.

Details: Bug #689568 and #689569. Uses the patch supplied by Alex
in thread for #689569, implements Ralph's comments about the structure 
naming. Does not attempt to change the memory allocator. This slightly
modified patch also works with the Luratech decoder.

sjbig2.h, sjbig2_luratech.h; make the global data structure 
s_jbig2_global_data_t public. Store the structure in the 
stream decoder state.

sjbig2.c, sjbig2_luratech.c; store a pointer to the global
data structure. 

sjbig2_luratech.c; don't reset the pointer during initialisation!

zfjbig2.c; Pass the global pointer to the stream decoder for
release in the finalize routine.

[src/sjbig2_luratech.h src/zfjbig2.c src/sjbig2.c src/sjbig2.h src/sjbig2_luratech.c]

2007-12-21T00:15:53.911110Z Ralph Giles

Remove some old helper scripts.

They aren't used much and we no longer wish to maintain them.

[toolbin/many2pdf.tcl toolbin/pre toolbin/gssubst toolbin/gsindent]

2007-12-21T00:11:54.376327Z Ralph Giles

Make pre.tcl more robust in creating temporary files.

Also update the copyright header and fix a bug in an error handler.

[toolbin/pre.tcl]

2007-12-19T06:25:41.308572Z Alex Cherepanov

Ignore operator readonly when it is applied to a wrong type inside an
embedded Type 1 font. Bug 689617, customer 580.

[lib/pdf_font.ps]

2007-12-19T06:22:22.816836Z Alex Cherepanov

Treat the text after empty ASCII block in PFB stream as ASCII sub-stream
terminated by 0x80 character, a presumed header of the next block.
Bug 689617, customer 580.

[src/sfilter1.c]

2007-12-19T00:25:08.107768Z Ralph Giles

Update the graphics library unit tests for recent code changes.

[src/gslib.c]

2007-12-18T10:03:07.564012Z Ken Sharp

Fix (pdfwrite): Font Descriptors for fonts not embedded, due to
EmbedAllFonts=false, did not preserve the original font name.

Details:
Bug #689597 "PDF created with NoEmbed has wrong BaseFont name".

(gdevpdtd.c) pdf_font_descriptor_alloc, do not use the 'embed'
status to determine whether to use the font or key name. Always
use the font name.

pdf_compute_font_descriptor. Remove the simplistic test for
symbolic. In the loop retrieving glyph information, check to see 
if the glyph name is present in ISO Latin 1. If not, the font is
symbolic.

[src/gdevpdtd.c]

2007-12-18T10:02:09.815887Z Ken Sharp

Fix (pdfwrite): PDFXTrimBoxToMediaBoxOffset used the supplied data
incorrectly.

Details:
Bug #689578 "PDFXTrimBoxToMediaBoxOffset".

Patch supplied by Adam Augusta.

(gdevpdf.c) pdf_write_page. When using the PDFXTrimBoxToMediaBoxOffset
data, we need to subtract the bottom right offset from the MediaBox
not add it, the trim box must lie inside the media (see Acrobat 7.0
distiller parameters manual, pp. 102-103).

[src/gdevpdf.c]

2007-12-18T03:40:36.305448Z Ralph Giles

Remove the unused composite_rop device.

DETAILS:

This was an attempt to implement PCL raster operations as an interposed 
device which first rendered to an intermediate buffer and them 
composited with the underlying device buffer, similar to how the
"PDF 1.4 Transparency" device works.

While this would be a nice approach, allowing raster operations to 
function in more color spaces, it was never completed, and presents
a maintenance burden for ongoing clist improvements. We are therefore
removing it. It can be reinstated later as a starting point for further 
development if needed.

[src/lib.mak src/gsropc.c src/gsropc.h doc/Develop.htm src/gxropc.h]

2007-12-17T21:33:35.320044Z Igor Melichev

Fix (transparency) : Providing a right nested masks logic (continued).

DETAILS :

The revision 8439 missed an initializer.

[src/gdevp14.c]

2007-12-17T07:28:22.397599Z Alex Cherepanov

Improve outline pdfmarks produced by the pdf interpreter. Add page number and view
values. Thanks to Leon Bottou for the patch. Bug 689599.

[lib/pdf_main.ps]

2007-12-16T15:38:09.417159Z Igor Melichev

Fix (clist interpreter) : Improving debug trace about compositors.

DETAILS :

This only improves a debug printing.
The algorithm isn't changed.

This change simplifies the debug trace analysis with
using C function names as event marks in the trace.
Also return_error is now not used when c_pdf14trans_write
is called for estimating the buffer size.

[src/gdevp14.c]

2007-12-16T01:37:56.744199Z Alex Cherepanov

Don't skip space characters after eexec in embedded PDF fonts but
continue to do so in other cases. Bug 689615.

[src/seexec.c src/sfilter.h lib/pdf_font.ps src/zmisc1.c doc/Language.htm]

2007-12-14T19:51:01.706015Z Alex Cherepanov

Work around a GCC 4.2.1 bug on PowerPC that generates incorrect code in the
release build affecting scanning of binary tokens containing floating point
numbers. Bug 689586.

[src/ibnum.c]

2007-12-14T18:40:31.738291Z Marcos H. Woehrmann

Added casts to sprintf debugging statements (thanks for Michael Rutter for finding these).

[contrib/eplaser/gdevescv.c]

2007-12-14T18:31:39.938693Z Alex Cherepanov

Align the pointer to gx_clist_state array in gx_device_clist_writer device to
the natural boundary to avoid misaligned memory access and bus errors on ARM
processors. Bug 689600.

[src/gxclist.c]

2007-12-12T20:29:44.002303Z Igor Melichev

Fix (transparency) : Providing a right nested masks logic.

DETAILS :

This redoes the change 8340 without extra assumptions.
See comments in code.

[src/gdevp14.h src/gdevp14.c]

2007-12-12T19:58:31.269810Z Igor Melichev

Fix (transparency) : Unwinding the nested masks logic.

DETAILS :

The patch 8340 appears to be optimized for a particular case,
in which a call to pdf14_push_transparency_group
"will have been preceded by pdf14_push_transparency_mask ... pdf14_pop_transparency_mask".
This assumption is not true in general, when the clist interpreter
skips idle groups (either with incoming improvement or 
with using the band complexity array).

This patch unwinds the change 8340 and the dependent change 8342.
It also simplifies the garbager descriptor for pdf14_buf_s.

The nested mask problem is now reopen,
but we intend to close it shortly with a different patch.

[src/gdevp14.h src/gdevp14.c]

2007-12-12T19:00:44.753250Z Igor Melichev

Fix (clist interpreter) : Skip idle compositors, step 4.

DETAILS :

gs_pdf14trans_s doesn't need a reference counting.
Actually it was never used, so removing it should be
algorithmically equivalent.

[src/gsropc.c src/gsalphac.c src/gxcomp.h src/gsovrc.c src/gdevp14.c]

2007-12-11T23:47:18.340705Z Ray Johnston

Fix for SEGV when more than 4 colorants used with psdcmyk device.
Bug 689457 for customer #460.

DETAILS: 

Apparently the psdcmyk device never got updated with the ret_devn_params proc
as did the tiffsep device.

[src/gdevpsd.c]

2007-12-11T21:27:02.763129Z Ralph Giles

Store the posix persistent cache's last modified line as an unsigned 
long to avoid portability problems when reading and writing. Bug 689604.

DETAILS:

Previously we used time_t directly, but read and wrote it to the 
filesystem using the %ld printf format specifier, which is wrong
on systems where long int and time_t are different widths. Instead
we stort it as an unsigned long int, coercing the return value of
time(). This will be a year 2038 problem on systems with 32 bit longs, 
but seems the better option for portability now. There is no cast,
so the compiler should warn if this loses precision.

[src/gp_unix_cache.c]

2007-12-11T16:54:05.187153Z Marcos H. Woehrmann

Replaced C++ comments with C comments (// -> /* */).

[imdi/imdi.c imdi/imdi_tab.c imdi/imdi_gen.c imdi/cctiff.c]

2007-12-11T08:29:58.454613Z Ken Sharp

Fix (jbig2dec): Missing support for decoding multiple symbols
from a symbol dictionary, when using refinement/aggregation.

Details:
Bug #688945 "jbig2dec FATAL ERROR decoding image: aggregate
coding with REFAGGNINST=2 (segment 0x03)".

Improved the previous patch. We need to have a symbol dictionary
which contains all the original symbols, plus all the symbols decoded
so far, for the refinement/aggregation. Previously we created this
anew for each symbol, this patch creates the dictionary once at
the start of the dictionary decoding, and releases it when decoding
is complete.

Also releases the Huffman tables (if used), which was missed
in the previous patch.

[jbig2dec/jbig2_symbol_dict.c]

2007-12-10T22:11:05.461373Z Tor Andersson

Update to previous commit. Add pdf14_buffer maskbuf pointer to GC structures.

[src/gdevp14.c]

2007-12-10T20:27:11.787298Z Alex Cherepanov

Fix a compilation error on Tru64's native cc, which doesn't tolerate spaces
between -I and the directory. Thanks to M. Rutter for the patch. Bug 689602

[contrib/contrib.mak]

2007-12-10T16:13:26.551663Z Tor Andersson

Pick up the transparency mask buffer when a new transparency group is pushed rather than when it is popped. Solves memory leaks and incorrect rendering when transparency groups are nested.

[src/gdevp14.h src/gdevp14.c]

2007-12-10T09:45:03.624134Z Ken Sharp

Fix (jbig2dec): Missing support for decoding multiple symbols
from a symbol dictionary, when using refinement/aggregation.

Details:
Bug #688945 "jbig2dec FATAL ERROR decoding image: aggregate
coding with REFAGGNINST=2 (segment 0x03)".

Added missing support. When decoding a symbol dictionary, using
refinement/aggregation, and decoding multiple symbols, we need
to use text region decoding (single symbols use refinement
region decoding, already implemented).

This required making the text region decoding procedure available
to the symbol dictionary decoding routine, and correctly
initialising the parameters.

(jbig2_text.h) New include file. The 'Jbig2TextRegionParams'
structure and Jbig2RefCorner enum have been moved here from
jbig2_text.c, and a prototype for 'jbig2_decode_text_region'
created.

Added pointers for the adaptive arithmetic decoder tables to the
Jbig2TextRegionParams structure, as these tables must now be passed
to the decoder routine (see below) rather than initialised in it.

(jbig2_text.c) Modified the 'jbig2_decode_text_region' routine to
take the arithmetic decoder state or data stream (for Huffman
decoding) as a parameter. When being called from the symbol
dictionary decoder we must use the current decoder state; removed
the initialisation of the decoder state, this is passed as a
parameter Removed the initialisation of the adaptive arithmetic
decoder tables, these are now passed as part of the
Jbig2TextRegionParams structure.

Modified 'jbig2_parse_text_region' to create and initialise the
arithmetic decoder state (or data stream for Huffman). If
using adaptive arithmetic encoding, create and initialise the
tables.Required now that these are parameters to the text
region decoder.

(jbig2_symbol_dict.c) 'jbig2_decode_symbol_dict', when we
encounter refinement/aggregation with REFAGGNINST > 1, instead of
flagging an error create a Jbig2TextRegionParams structure (if
not already present), initialise the arithmetic decoder tables, and
call the text region decoder to create the bitmap. If we already
have a Jbig2TextRegionParams structure (because we have already
decoded a symbol this way) just use it as the argument to the
text region decoder.

[jbig2dec/jbig2_text.c src/jbig2.mak jbig2dec/jbig2_symbol_dict.c jbig2dec/jbig2_text.h]

2007-12-09T06:33:00.168945Z Alex Cherepanov

Use a smaller buffer for eexecDecode filter to avoid consumption of the data
that follow a short (and incorrect) run of 0's in PS files generated by
Adobe Acrobat from PDF files with usage restrictions. Bug 689577

DETAILS:
The buffer size of 132 has been selected from a middle of small window that
fixes the bug but doesn't cause regession in comparefiles/fonttest.pdf.
Detection of EOF after seing a run of 0's is worth to note as an alternative.

[src/seexec.c]

2007-12-08T13:57:53.015953Z Ken Sharp

Update the MSVC makefile to work with Visual Studio 2005 (nmake version 8). 
Should still be OK with MSVC 6.

[jbig2dec/msvc.mak]

2007-12-07T23:39:06.271814Z Igor Melichev

Fix (clist interpreter) : Skip idle compositors, step 3.

DETAILS :

The clist writer writes the 'create compositor' operation to all bands,
including ones that are not covered by a transparency.
It does so because this operation changes the number of color components.

When rendering a specific band, it frequently happens that a compositor
is created and then immediately destroyed. Such thing happens outside 
the transparency bbox, and within the transparency bbox if
the band has no transparent objects. When compositor is created,
it allocates a big raster buffer and cleans it. 
Due to that we observe a significant CPU time expence
when running the test case of the bug 689155.

This patch is a preparation for further improvements.
This patch includes CTM into pdf14 compositor params
(see changes to c_pdf14trans_read, c_pdf14trans_write, clist_create_compositor).
The result should be same as the old code, but the algorithm is different.
The old code wrote CTM as a separate command before cmd_opv_ext_create_compositor.
The new code does not, and in many cases compositor commads 
immediately follow each another.

The last fact changes the behavior of the compositor queue :
before this patch it consisted of 1 element maximum,
but after it the queue becomes longer (up to 10 elements
with SoftMaskGroup.pdf). A bug is fixed in the queue logic 
in gxclrast.c ln 1355.

The queue is still immediately executed
when a non-compositor command appears in the input stream.
An annihilation of neighbour idle compositors will be a next step.

Minor changes:

- added a new method adjust_ctm to gs_composite_type_procs_t.
- added type checks with composite_*_proc macros to all compositor types.
- dependencies were broken for gdevp14.c in lib.mak .

[src/lib.mak src/gsropc.c src/gdevdflt.c src/gxclpath.h src/gxcldev.h src/gsalphac.c src/gxcomp.h src/gsovrc.c src/gstrans.h src/gxclrast.c src/gdevp14.c src/gxclpath.c src/gxclimag.c src/gxclutil.c]

2007-12-05T23:39:42.529355Z Igor Melichev

Fix (clist interpreter) : Skip idle compositors, step 2.

DETAILS :

The clist writer writes the 'create compositor' operation to all bands,
including ones that are not covered by a transparency.
It does so because this operation changes the number of color components.

When rendering a specific band, it frequently happens that a compositor
is created and then immediately destroyed. Such thing happens outside 
the transparency bbox, and within the transparency bbox if
the band has no transparent objects. When compositor is created,
it allocates a big raster buffer and cleans it. 
Due to that we observe a significant CPU time expence
when running the test case of the bug 689155.

This patch is a preparation for further improvements.
The change is algorithmically equivalent.
It implements a compositor queue for a delayed applying of compositors.
Nevertheless currently the compositors are still applied immediately 
due to stubs in is_null_compositor_op, is_closing_compositor.

[src/gxcomp.h src/gxclrast.c]

2007-12-05T16:40:41.424504Z Igor Melichev

Fix (clist interpreter) : Skip idle compositors, step 1.

DETAILS :

The clist writer writes the 'create compositor' operation to all bands,
including ones that are not covered by a transparency.
It does so because this operation changes the number of color components.

When rendering a specific band, it frequently happens that a compositor
is created and then immediately destroyed. Such thing happens outside 
the transparency bbox, and within the transparency bbox if
the band has no transparent objects. When compositor is created,
it allocates a big raster buffer and cleans it. 
Due to that we observe a significant CPU time expence
when running the test case of the bug 689155.

This patch is a preparation for further improvements.
The change is algorithmically equivalent.
I simply divides read_create_compositor into 2 ones :
the first one just reads the instruction,
and the second one applies it. 
Also did a mionor code cleanup.

[src/gxclrast.c]

2007-12-05T00:08:50.583846Z Till Kamppeter

Let CUPS filters use buffered input to Ghostscript via '-_', to work around bug #689577. 

[cups/pstoraster.in cups/pstopxl.in]

2007-12-03T21:31:16.528843Z Henry Stiles

Replace the "tricky" unit_frac macro with a normal function call.  The
macro produced a false positive in valgrind and seems to cause
incorrect code generation on gcc 4.1.2 with optimization but we did
not study it in detail.  The change should be equivalent to the
previous code, reviewed by Ralph Giles.

[src/gxcmap.c src/gxcmap.h src/gscsepr.c src/gscdevn.c]

2007-12-03T20:07:05.165284Z Igor Melichev

Fix (shadings) : Optimize fill_linear_color_scanline with analitic computation of the color change position.

DETAILS :

Debugged with the test case of the bug 689155.

This optimizes slightly changing gradients.
It speeds up the test case from 6 hours to 5 hours.

The old code in gx_default_fill_linear_color_scanline 
recomputes color for each pixel.
The new code checks whether neighbour pixels have same color,
and if so it finds the color change position 
with solving a linear equation, 
and fills entire constant color interval 
without computing color for each pixel.

The linear equation is solved with 64 bits arithmetics.
We would like to create a 32bits algorithm someday.
We think it is possible with rounding colors to 16 bits
and restricting a run length with 15 bits. 
Note it must not accummulate rounding errors,
so it needs to compute from the run start at each iteration.
So if the scanline is wide, first split it into smaller ones
by coordinates, then break each subscanline into runs by color changes.

[src/gdevdsha.c]

2007-11-30T22:13:49.581001Z L. Peter Deutsch

Add a tool that analyzes logs produced by gs -Z67, producing a report of
memory leaks.

[toolbin/memory.py]

2007-11-30T06:43:47.688763Z L. Peter Deutsch

Adds the base font address to the -Zm tracing output.

[src/gsfont.c]

2007-11-30T06:43:12.449891Z L. Peter Deutsch

Fixes bug: -Z89 produced slightly mangled output (-Z9 output inserted in the
middle of a line of -Z8 output).

[src/igcref.c]

2007-11-30T00:45:53.632689Z Ray Johnston

Add URW fonts to the Resource/Font directory. These will be included when
COMPILE_INITS=1. Fontmap.GS still references the disk file name so that
the disk file based fonts can still be used if they are available.

[Resource/Font/URWPalladioL-BoldItal Resource/Font/NimbusRomNo9L-Medi Resource/Font/NimbusSanL-Bold Resource/Font/Dingbats Resource/Font/URWChanceryL-MediItal Resource/Font/CenturySchL-Roma Resource/Font Resource/Font/NimbusMonL-Bold Resource/Font/URWGothicL-Demi Resource/Font/NimbusSanL-BoldItal Resource/Font/NimbusRomNo9L-MediItal Resource/Font/StandardSymL Resource/Font/URWBookmanL-DemiBold Resource/Font/NimbusRomNo9L-Regu Resource/Font/URWGothicL-Book Resource/Font/NimbusSanL-ReguCond Resource/Font/CenturySchL-Bold Resource/Font/URWBookmanL-Ligh Resource/Font/NimbusRomNo9L-ReguItal Resource/Font/URWBookmanL-DemiBoldItal Resource/Font/NimbusMonL-ReguObli Resource/Font/NimbusSanL-ReguCondItal Resource/Font/CenturySchL-Ital Resource/Font/URWPalladioL-Roma Resource/Font/CenturySchL-BoldItal Resource/Font/URWBookmanL-LighItal Resource/Font/NimbusSanL-BoldCond Resource/Font/NimbusMonL-BoldObli Resource/Font/NimbusSanL-BoldCondItal Resource/Font/URWGothicL-DemiObli Resource/Font/NimbusSanL-Regu Resource/Font/URWPalladioL-Bold Resource/Font/NimbusMonL-Regu Resource/Font/URWGothicL-BookObli Resource/Font/NimbusSanL-ReguItal Resource/Font/URWPalladioL-Ital]

2007-11-29T21:39:53.584646Z Igor Melichev

Fix (shadings) : Optimize path manipulations for shading fill (continued).

DETAILS :

Debugged with the test case of the bug 689155.

A long ago the graphics library converted the sfill clipping into a path.
It was improved with revision 8017 with introducing 
a device response for pattern_manage__shfill_doesnt_need_path.
However the revision 8017 appears incomplete : 
it missed the related change to the clist writer device
and to pdf14 device. This patch fixes it.

This patch causes a progression for the problem
known as bug 689338 "Raster depends on bands".
With banded rendering some shadings are now painted some wider,
and the raster appears equal to one from unbanded rendering.
It happens because the old code doesn't convert shfill clipping
into a path when no banding, and does convert when banding.
The new code does not convert in both cases.

[src/gdevp14.c src/gxclpath.c src/gxclrect.c]

2007-11-29T01:42:16.432740Z L. Peter Deutsch

Remove obsolete variables dstderr and estderr; repair tracing code in
igcstr.c that would cause a crash if -Z5 was used.

[src/interp.c src/gdebug.h src/igcstr.c]

2007-11-28T20:04:34.791598Z Ray Johnston

Add the 'pamcmyk32' (previously the 'pam' device) to all default builds.
This will be used for regression testing of 32-bit CMYK.

DETAILS:

The 'pam' device is retained, but not included in the default builds,
in case anyone was using this. The 'pamcmyk32' name was created as
more descriptive.

[src/bcwin32.mak src/openvms.mak src/ugcclib.mak src/macosx.mak src/watcw32.mak src/dvx-gcc.mak src/msvc32.mak src/unix-gcc.mak src/gdevpbm.c src/unixansi.mak src/macos-mcp.mak src/devs.mak src/os2.mak]

2007-11-28T19:47:48.435055Z Ralph Giles

Document the jasper build file version skew menioned in Bug 689570.

[doc/Release.htm]

2007-11-28T18:46:55.924792Z Ray Johnston

Fix #defines when USE_COMPRESSED_ENCODING == 0 so that the number of
components, separable/linear and encode/decode values are correct.
Also add checking for TIFF file larger than max_long.

[src/gdevtsep.c]

2007-11-28T18:39:59.435918Z Ray Johnston

Fix CIEBasedA problem, add DeviceGray and DeviceRGB support to this utility.

DETAILS:

This isn't used by Ghostscript, but is a useful utility for 'running' a
CIE colorspace conversion to see the intermediate and final results.

[lib/docie.ps]

2007-11-27T22:58:40.032075Z Ralph Giles

Also install gdevdsp.h in the unix so build. This header contains the
callback definitions for the "display" device. Bug 689576.

[src/unix-dll.mak]

2007-11-27T20:43:09.836338Z Ralph Giles

Update the regression code license headers with the current contact
address.

[toolbin/tests/dump_checksum.py toolbin/tests/cmpi.py toolbin/tests/gscheck_testfiles.py toolbin/tests/dump_checksum_plus.py toolbin/tests/check_source.py toolbin/tests/gssum.py toolbin/tests/gscheck_all.py toolbin/tests/dump_checksum_raw.py toolbin/tests/make_two_pdfversions toolbin/tests/check_all.py toolbin/tests/rasterdb.py toolbin/tests/gsutil.py toolbin/tests/gscheck_fuzzypdf.py toolbin/tests/revert_pdfbaseline toolbin/tests/build_revision.py toolbin/tests/compare_checksumdb.py toolbin/tests/gsconf.py toolbin/tests/revert_baseline toolbin/tests/update_baseline.py toolbin/tests/make_baselinedb.py toolbin/tests/gscheck_raster.py toolbin/tests/gsparamsets.py toolbin/tests/gstestutils.py toolbin/tests/compare_checksums.py toolbin/tests/check_dirs.py toolbin/tests/update_specific toolbin/tests/run_nightly.py toolbin/tests/gstestgs.py toolbin/tests/myoptparse.py toolbin/tests/run_regression.py toolbin/tests/get_baselines.py toolbin/tests/make_two_versions toolbin/tests/testdiff.py toolbin/tests/gscheck_pdfwrite.py toolbin/tests/make_testdb.py toolbin/tests/check_comments.py toolbin/tests/check_docrefs.py toolbin/tests/get_baseline_log.py]

2007-11-27T20:43:07.921159Z Ralph Giles

Change the regression scripts to rewrite the product as
"GPL Ghostscript".

[toolbin/tests/build_revision.py toolbin/tests/update_specific]

2007-11-27T18:11:10.542532Z Igor Melichev

Fix (graphics) : Improving the setoverprint logic.

DETAILS :

Debugged with the test case of the bug 689155.

This eliminates unnecessary calls of dx_device::procs.create_compositor.
In the test case the oprator 'show' calls gs_save and gs_restore
and the latter performs unnecessary call to gs_do_set_overprint
due to overprint is set at page start. It causes a significant CPU time expense 
while clist interpretation.

We're not sure why the old code is such,
we change it as we think correct.
Will see the regression test results.
A local test gave no differences.

[src/gsstate.c]

2007-11-23T09:23:06.243419Z Ken Sharp

Fix (pdfwrite): Fonts containing glyphs with no sbw or hsbw
instruction caused pdfwrite to crash.

Details:
Bug #689544 "Segmentation fault writing PDF file".

The job contains a number of fonts apparently converted from 
TrueType to type 1. The /.notdef glyph in every case consists
only of an endchar instruction. Techincally invalid since the 
specification says the first instruction must be either an sbw
or hsbw instruction.

This causes a crash because gs_type1_glyph_info didn't create
a path before interpreting the glyph. If we encountered a path
operation before a sbw instruction we attempted to write to the 
non-existent path.

(gxtype1.c), gs_type1_glyph_info, create a path for the type 1
interpreter to work with. Make it a bbox_accumulator so we don't
allocate memory for path segments.

(gdevpsfu.c), psf_check_outline_glyphs, if we get an invalidfont
error return from the font's 'glyph_info' procedure, don't exit
immediately. Check each glyph, and only return an error if 
there are no good glyphs. 

[src/gxtype1.c src/gdevpsfu.c]

2007-11-22T02:46:59.719550Z Ralph Giles

Correct Id line and double-include protection warnings.

[src/ConvertUTF.h toolbin/tests/check_source.py src/expat.mak]

2007-11-22T01:03:46.485805Z Ralph Giles

Update the run_nightly regression script to rewrite the product
name to GPL Ghostscript instead of AFPL Ghostscript. Also, include
quotation marks in the optional part of the regex so we work when
GS_PRODUCT is set to another macro and does not include a literal
string, as it does at release time.

[toolbin/tests/run_nightly.py]

2007-11-22T00:54:03.544607Z Ralph Giles

Correct a format string error in the PDF 1.4 spot color name generation.

[src/gdevp14.c]

2007-11-22T00:54:01.468513Z Ralph Giles

Update release procedure documentation.

[doc/Release.htm]

2007-11-21T22:42:03.178745Z Ralph Giles

Bump the version number and date after the 8.61 release.

[doc/News.htm lib/gs_init.ps src/gscdef.c src/version.mak]

2007-11-21T20:07:08.596302Z Ralph Giles

Update changelogs and release date for the second 8.61 candidate.

[doc/History7.htm doc/Projects.htm doc/History8.htm man/dvipdf.1 man/ps2ascii.1 doc/Use.htm doc/Readme.htm doc/Source.htm doc/Deprecated.htm man/ps2epsi.1 doc/Install.htm doc/Changes.htm doc/API.htm doc/Issues.htm doc/DLL.htm doc/Drivers.htm man/pfbtopfa.1 doc/Release.htm doc/Commprod.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm man/gs.1 src/version.mak man/pf2afm.1 doc/Ps2ps2.htm doc/Fonts.htm man/printafm.1 doc/Ps2pdf.htm doc/Develop.htm doc/Helpers.htm man/pdf2dsc.1 doc/Psfiles.htm doc/Lib.htm doc/gs-vms.hlp doc/Htmstyle.htm man/font2c.1 man/gsnd.1 man/pdfopt.1 doc/News.htm man/pdf2ps.1 man/ps2pdf.1 doc/Testing.htm doc/Make.htm doc/Details8.htm doc/Unix-lpr.htm doc/C-style.htm doc/Ps-style.htm doc/History1.htm doc/History2.htm man/gslp.1 man/wftopfa.1 doc/History3.htm doc/Details.htm doc/Ps2epsi.htm doc/History4.htm man/ps2pdfwr.1 man/ps2ps.1 doc/History5.htm doc/History6.htm]

Version 8.61 (2007-11-21)

This is the second release in the Ghostscript 8.6x stable series. It contains a number of bug fixes and improvements.

The following bugs were open at the time of the last release:

226943, 430175, 465936, 493348, 535932, 578865, 614298, 626295, 686747, 686853, 686865, 687011, 687039, 687084, 687095, 687146, 687193, 687196, 687257, 687271, 687280, 687295, 687297, 687303, 687327, 687342, 687345, 687375, 687414, 687475, 687492, 687514, 687520, 687531, 687536, 687561, 687593, 687608, 687630, 687650, 687666, 687674, 687677, 687695, 687697, 687702, 687715, 687721, 687728, 687729, 687731, 687775, 687780, 687782, 687793, 687796, 687805, 687814, 687850, 687887, 687903, 687904, 687907, 687915, 687931, 687950, 687957, 687974, 687981, 687983, 688007, 688022, 688024, 688026, 688032, 688036, 688042, 688058, 688061, 688064, 688066, 688075, 688081, 688095, 688129, 688130, 688151, 688152, 688159, 688166, 688184, 688187, 688204, 688207, 688210, 688215, 688227, 688239, 688267, 688269, 688280, 688282, 688288, 688312, 688317, 688318, 688320, 688333, 688342, 688358, 688359, 688360, 688361, 688363, 688372, 688378, 688386, 688387, 688389, 688395, 688413, 688427, 688428, 688436, 688437, 688440, 688446, 688448, 688468, 688473, 688475, 688483, 688490, 688495, 688500, 688515, 688517, 688528, 688533, 688539, 688540, 688542, 688543, 688557, 688565, 688573, 688580, 688581, 688588, 688601, 688604, 688605, 688610, 688615, 688616, 688617, 688619, 688627, 688636, 688638, 688643, 688646, 688647, 688651, 688653, 688655, 688673, 688674, 688696, 688697, 688699, 688708, 688709, 688710, 688711, 688714, 688717, 688728, 688731, 688736, 688739, 688757, 688770, 688774, 688777, 688778, 688796, 688797, 688806, 688807, 688811, 688813, 688815, 688818, 688829, 688843, 688845, 688846, 688871, 688872, 688876, 688908, 688918, 688919, 688923, 688926, 688928, 688933, 688942, 688943, 688945, 688949, 688952, 688958, 688969, 688970, 688976, 688978, 688986, 688990, 688992, 688994, 688999, 689003, 689011, 689013, 689014, 689022, 689025, 689028, 689031, 689032, 689040, 689044, 689046, 689048, 689057, 689058, 689060, 689065, 689070, 689076, 689077, 689078, 689080, 689081, 689090, 689093, 689094, 689098, 689103, 689107, 689111, 689116, 689128, 689129, 689130, 689133, 689136, 689137, 689138, 689145, 689146, 689148, 689150, 689153, 689154, 689155, 689159, 689161, 689164, 689167, 689172, 689174, 689181, 689184, 689188, 689195, 689198, 689199, 689206, 689209, 689210, 689222, 689224, 689230, 689236, 689241, 689246, 689247, 689248, 689252, 689253, 689264, 689266, 689278, 689279, 689280, 689281, 689283, 689289, 689290, 689291, 689295, 689304, 689305, 689306, 689308, 689313, 689331, 689335, 689338, 689340, 689341, 689343, 689356, 689358, 689361, 689363, 689364, 689367, 689369, 689370, 689373, 689376, 689378, 689389, 689392, 689396, 689402, 689412, 689418, 689419, 689421, 689422, 689423, 689428, 689431, 689438, 689439, 689440, 689444, 689445, 689448, 689450, 689451, 689456, 689457, 689460, 689461, 689462, 689463, 689464, 689469, 689471, 689472, 689473, 689476, 689482, 689484, 689487, 689488, 689489, 689490, 689492, 689498, 689499, 689500, 689502, 689506, 689507, 689509, 689510, 689512, 689514, 689515, 689516, 689518, 689521, 689522, 689525, 689528, 689532, 689533, 689534, 689535, 689536, 689538, 689542, 689543, 689544, 689546, 689547, 689549, 689550, 689552, 689554, 689557, 689558, 689559, 689560, 689561, 689563, 689566, 689567, 689568, 689569.

Incompatible changes

The default device on unix-oriented builds was temporarily switched to the bbox device in the 8.60 release. In the 8.61 release, the default was changed again to the x11alpha device, if X11 support is available, and otherwise falls back to the bbox device.

Changelog

2007-11-21T19:44:40.574652Z Ralph Giles

Revert the change to using an environment variable for the MSVC LIBPATH. 

Details:

This wasn't effective in addressing the problem and could cause 
additional trouble if the environment isn't configured. The changes
in r8394 should properly address the issue of quote interpretation
with MSVC6.

[src/msvc32.mak]

2007-11-21T06:10:53.144641Z Henry Stiles

Check that a device halftone exists before writing it.  Fixes
segmentation fault in xps.  No differences expected.

[src/gdevp14.c]

2007-11-21T05:57:23.672501Z Ray Johnston

Fix compiler flag conflict for non-debug build (seen when switching
PCL6 build to default to non-debug default). Changes /ZI to /Zi.

[src/msvccmd.mak]

2007-11-20T18:36:58.009554Z Ray Johnston

Fix broken MSVC 6 build issue caused by change in src/msvccmd.mak that puts
a LIBPATH into the link command line. MSVC linker can't handle spaces in the
LIBPATH even if within " ". We use an environment variable set by Microsoft
MSVC 6 'vcvars32.bat' instead. This can be manually set if needed.

[src/msvc32.mak]

2007-11-20T11:42:22.623309Z Ken Sharp

Batch file to create MSVC solution and projects.

Usage:
msvcxml gs obj\ld.tr > ghostscript.sln

This is the first attempt, and very poor.

[toolbin/msvcxml.bat]

2007-11-19T23:57:46.396323Z Ralph Giles

Change the product name for the release.

[src/gscdef.c]

2007-11-19T23:56:28.975783Z Ralph Giles

Update changelogs for release.

[doc/Changes.htm doc/History8.htm doc/News.htm doc/Details8.htm doc/Details.htm]

2007-11-19T20:36:07.538187Z Igor Melichev

Fix (transparency) : Wrong background color of a soft mask group.

DETAILS :

Bug 689531 "Regression: PDF file has undesired extra gray object.".

The old code used the 0th component of the background color
instead its gray equivalent.  The bug was introduced when 
working on bug 687176.

[src/gdevp14.c]

2007-11-19T20:24:07.302766Z Ralph Giles

Update documentation timestamps for 8.61.

[doc/History7.htm doc/Projects.htm doc/History8.htm man/dvipdf.1 man/ps2ascii.1 doc/Use.htm doc/Readme.htm doc/Source.htm doc/Deprecated.htm man/ps2epsi.1 doc/Install.htm doc/API.htm doc/Issues.htm doc/DLL.htm doc/Drivers.htm man/pfbtopfa.1 doc/Release.htm doc/Commprod.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm man/gs.1 man/pf2afm.1 doc/Ps2ps2.htm doc/Fonts.htm man/printafm.1 doc/Ps2pdf.htm doc/Develop.htm doc/Helpers.htm man/pdf2dsc.1 doc/Psfiles.htm doc/Lib.htm doc/gs-vms.hlp doc/Htmstyle.htm man/font2c.1 man/gsnd.1 man/pdfopt.1 doc/News.htm man/pdf2ps.1 man/ps2pdf.1 doc/Testing.htm doc/Make.htm doc/Details8.htm doc/Unix-lpr.htm doc/C-style.htm doc/Ps-style.htm doc/History1.htm doc/History2.htm man/gslp.1 man/wftopfa.1 doc/History3.htm man/ps2ps.1 doc/Ps2epsi.htm doc/History4.htm man/ps2pdfwr.1 doc/History5.htm doc/History6.htm]

2007-11-19T20:23:39.904096Z Ralph Giles

Remove the verification checks for PVERSION and JVERSION, which we no 
longer use.

[toolbin/pre.tcl]

2007-11-19T20:15:45.795513Z Ralph Giles

Add new files to the documentation.

[doc/Develop.htm doc/Psfiles.htm]

2007-11-19T20:15:43.672566Z Ralph Giles

Update release notes and date for 8.61.

[doc/News.htm src/version.mak]

2007-11-18T22:50:36.855233Z Alex Cherepanov

Normalize weigts in the Mitchell filter and use proper rounding to ensure
that the constant value is not changed by the filter.
Bug 689556, customer 581.

[src/siscale.c]

2007-11-18T16:48:41.008511Z Igor Melichev

Fix (clist interpreter) : Transparency caused a wrong color depth.

DETAILS :

Bug 689520 Regression: 1bpp and grayscale output broken.

The clist interpreter clist_playback_band maintains 2 devices :
the clist reader and target. The clist reader device stores
private interpreter's data. However using a device structure
for this purpose is pretty confusing, because the target 
device may have same device fields with different values.
Particularly while processing a transparency, the target device
chage to a transparency buffer device, 
which may have a different number of color components.

The problem happens due to the clist interpreter used
a wrong device to obtain the number of color components.
This patch changes the code with taking color components 
from the target device. 

Now we don't try to analyze all other access to the clist device -
it should be a subject of a separate job. 
Therefore the code may need further improvements.
The right way would be to define a special structure for the clist interpreter, 
and to drop the clist reader device at all.

[src/gxclrast.c]

2007-11-18T09:30:55.737640Z Russell Lang

Remove incorrect and unnecessary gtk+ separation code. Fixes bug 689541.

[src/dxmain.c]

2007-11-18T06:07:20.783700Z Igor Melichev

Fix (clist) : Improving the debug printing.

DETAILS :

This patch only inserts some debug trace printing about the pdf14 compositor.
The old code is confusing due to mapping an obsolete instruction to "set_color[*]".

[src/gxclpath.h]

2007-11-18T05:30:55.503323Z Igor Melichev

Fix (clist) : Improving the debug printing.

DETAILS :

This patch only inserts some debug trace printing about the pdf14 compositor.
The old code generates a confusing trace due to missing an important information.

[src/gstrans.c src/gdevp14.c]

2007-11-16T21:39:22.306411Z Ray Johnston

Fix dependency problems that caused obj/gs_init.ps to be missed. Also fix a
typo that caused CMap files to be missing.

DETAILS:

This method of putting the gs_init.ps dependency down in lib.mak require
us to get gs_init.ps. This hack was discussed with Ralph and is an
alternative to adding a dependency to all of the top level makefiles.
The dummy gs_init.ps is only made when we are NOT including the PS
interpreter (PSI_INCLUDED) since we need the real one for the language
switch build. Note that the dummy file doesn't get added to the %rom%
file system since PS_ROMFS_ARGS is empty if int.mak is not included.

[src/lib.mak src/int.mak]

2007-11-16T21:14:31.380613Z Ralph Giles

Correct typos and spelling errors in the change log. Bug 688940.

[doc/History8.htm]

2007-11-16T08:11:05.046465Z Igor Melichev

Fix (clist) : Providing clist instruction ids and offsets to debug trace (continued 2).

DETAILS :

The last patch (rev 8365) appears incorrect and causes crashes with halftoning devices.

The problem happens due to gx_device_clist_reader::offset_map 
has been initialized too early in clist_reader_init. 
At that moment the device is still a clist writer, 
but the field offset_map belongs to clist reader. 
Due to gx_device_clist_s is a union, the field overlaps band_range_list.head,
and the letter was prematurely reset. It caused some commands were not written
to clist file while the page closes. With the test case (pbmraw -r300 012-01.ps)
it missed cmd_opv_ext_put_halftone and did not miss cmd_opv_ext_put_drawing_color
with color index type == ht_binary. It caused the crash in gx_dc_ht_binary_readdue to 
pis->dev_ht was not set. (cmd_opv_ext_put_halftone does set, but it was missed).

The log message of the revision 8365 reads :
"This change is algorithmically equivalent for release build."
This statement is false due to the premature initialization of 
gx_device_clist_reader::offset_map.
This patch fixes that with removing its initialization from 
clist_reader_init. A subsequent call to clist_render_init initializes it.

The last patch was made buggy due to the function name 
clist_reader_init does not properly reflects its finction.
This patch fixes the naming.

Also provided more stability in gxht.c with a check for NULL pointer.

[src/gxclread.c src/gxht.c]

2007-11-16T02:10:56.107493Z Ralph Giles

Update the makefile for current pkgconfig macros.

[ijs/Makefile.am]

2007-11-16T01:52:09.559298Z Ralph Giles

Don't generate build files for the ijs package when building. Since this 
is distinct from 'make dist' the results are not optimal Bug 689425.

[doc/Release.htm]

2007-11-15T07:22:43.143761Z Igor Melichev

Fix (clist) : Providing clist instruction ids and offsets to debug trace (continued).

DETAILS :

The last patch appears incorrect for the debug build 
and causes crashes sometimes. Not sure why local testing didn't detect that.

This change is algorithmically equivalent for release build.
In the debug build it fixes problems of the last patch.

1. Offset map could be prematurely released by the garbager
(It could cause a crash. Not sure why the local test didn't detect it).
A new pointer gx_device_clist_reader::offset_map prevents that.
Added it to the garbager descriptor and provided its initialization.

2. buffer_segment_index can fail with returning a negative index.
Checked that and propagated error codes.

4. Besides top_up_cbuf, the buffer topping up also happens 
with calling memmove when reading bitmap data. 
Added calls to top_up_offset_map for accounting that.

5. See comment in top_up_offset_map about the improved invariant.

6. The prototupe of top_up_cbuf is changed with passing the error code.
Due to that the variable 'cbp' is droped the 'register' modifier.
We believe it won't cause a visible slowdown because
modern compilers are smart enough.

7. Do not maintain offset_map when -ZL is not specified.
It saves some CPU time with debug build.

[src/gxclist.c src/gxcldev.h src/gxclist.h src/gxp1fill.c src/gxclrast.c src/gxclread.c src/gxclpage.c src/gxclutil.c]

2007-11-14T23:03:22.440437Z Ralph Giles

Remove an obsolete include.

[src/gendev.c]

2007-11-14T22:06:13.972530Z Ray Johnston

Refactor the gs int.mak and lib,mak to simplify building COMPILE_INITS=1 without PS (PCL
only build). Make sure gs/src/ugcclib.mak does conditional assignment of COMPILE_INITS

[src/lib.mak src/ugcclib.mak src/int.mak]

2007-11-14T22:04:53.375824Z Ray Johnston

Fix number of macro arguments that showed an error when FPU_TYPE=-1 (no FPU)

[src/gsciemap.c]

2007-11-14T18:37:45.596510Z Igor Melichev

Fix (clist) : Providing clist instruction ids and offsets to debug trace.

DETAILS :

This change is algorithmically equivalent for release build.
In the debug build it only adds a new debug printing.

Let clist segment is consecutive instuctions buffered for same band.

1. gx_device_clist_writer::ins_count counts clist segments.

2. cmd_prefix_s::id is the number of clist segment that it belongs to.

3. stream_band_read_state_s::offset_map stores a table for mapping
clist segments' buffer offsets to clist file offsets.

4. s_band_read_init_offset_map, s_band_read_dnit_offset_map,  
clist_file_offset, top_up_offset_map maintain the table.

5. Inserted a debug printing into gxclutil.c, gxclrast.c .

[src/gxclist.c src/gxcldev.h src/gxclist.h src/gxclrast.c src/gxclread.c src/gxclutil.c]

2007-11-14T18:09:02.242685Z Igor Melichev

Fix (clist) : A preparation for providing clist instruction ids and offsets to debug trace.

DETAILS :

We would like this change to be algorithmically equivalent,
but the proof is too complex. Therefore we commit it separately
in order to check for raster differences.

1. Inserted a new field into cmd_prefix_s.
For now this field is never used, but it changes memory allocation.
Due to that the bufferring in the clist writer goes slightly different.
Particularly it may cause new effects while restarting failed instructions.

2. Early return from top_up_cbuf when the stream is over.
The new code does not top up the last portion of the data stream.
It shouldn't be important for the reader, but we can't proove for sure.
This change is necessary because we want to add more fields to gx_clist_state_s,
and the new fields would be invalid after s_close resets stream::state.
See the next patch for details.

[src/gxclist.h src/gxclrast.c]

2007-11-14T02:22:53.263144Z Ralph Giles

Add support for passing EXPAT_CFLAGS from the top-level makefile.
Passing -DHAVE_MEMMOVE is required in the unix build.

[src/expat.mak]

2007-11-14T02:06:05.012311Z Ralph Giles

Remove spurious executable bits.

[expat/MANIFEST expat/conftools/expat.m4 expat/tests/benchmark/benchmark.c expat/lib/internal.h expat/COPYING expat/Changes expat/lib/utf8tab.h expat/tests/runtestspp.cpp expat/tests/runtests.c expat/lib/expatw_static.dsp expat/lib/libexpat.def expat/amiga/include/proto/expat.h expat/tests/README.txt expat/xmlwf/xmlfile.c expat/xmlwf/xmlfile.h expat/xmlwf/ct.c expat/lib/Makefile.MPW expat/xmlwf/codepage.c expat/vms/descrip.mms expat/xmlwf/codepage.h expat/bcb5/elements.bpf expat/lib/amigaconfig.h expat/amiga/expat_lib.c expat/bcb5/elements.bpr expat/lib/expat.h expat/win32/README.txt expat/conftools/get-version.sh expat/doc/valid-xhtml10.png expat/examples/outline.dsp expat/xmlwf/readfilemap.c expat/bcb5/outline.mak expat/lib/xmlrole.c expat/amiga/launch.c expat/bcb5/expat_static.mak expat/lib/xmlrole.h expat/lib/winconfig.h expat/examples/elements.dsp expat/win32/expat.iss expat/win32/MANIFEST.txt expat/amiga/expat.xml expat/bcb5/outline.bpf expat/expat_config.h.in expat/lib/libexpatw.def expat/lib/expatw.dsp expat/bcb5/expat.mak expat/lib/xmltok.c expat/vms/README.vms expat/tests/benchmark/README.txt expat/bcb5/expat_static.bpf expat/lib/xmltok.h expat/tests/xmltest.sh expat/lib/latin1tab.h expat/bcb5/outline.bpr expat/tests/minicheck.c expat/xmlwf/xmlwf.dsp expat/conftools/PrintPath expat/tests/minicheck.h expat/Makefile.in expat/lib/expat_static.dsp expat/bcb5/libexpat_mtd.def expat/bcb5/expat_static.bpr expat/lib/xmltok_impl.c expat/bcb5/expatw.mak expat/amiga/include/interfaces/expat.h expat/lib/xmltok_impl.h expat/xmlwf/filemap.h expat/bcb5/expatw_static.mak expat/vms/expat_config.h expat/bcb5/expat.bpf expat/xmlwf/xmlwin32url.cxx expat/lib/xmltok_ns.c expat/xmlwf/xmltchar.h expat/doc/reference.html expat/tests/benchmark/benchmark.dsp expat/bcb5/expat.bpr expat/bcb5/xmlwf.mak expat/bcb5/setup.bat expat/lib/xmlparse.c expat/tests/benchmark/benchmark.dsw expat/conftools/install-sh expat/configure.in expat/conftools/libtool.m4 expat/bcb5/expatw.bpf expat/amiga/Makefile expat/bcb5/expatw_static.bpf expat/bcb5/expatw.bpr expat/bcb5/expatw_static.bpr expat/bcb5/xmlwf.bpf expat/lib/expat_external.h expat/configure expat/lib/macconfig.h expat/conftools/ac_c_bigendian_cross.m4 expat/lib/ascii.h expat/amiga/expat_vectors.c expat/conftools/mkinstalldirs expat/bcb5/README.txt expat/amiga/README.txt expat/bcb5/xmlwf.bpr expat/xmlwf/unixfilemap.c expat/doc/xmlwf.sgml expat/bcb5/all_projects.bpg expat/xmlwf/xmlurl.h expat/doc/expat.png expat/amiga/include/inline4/expat.h expat/examples/elements.c expat/expat.dsw expat/amiga/stdlib.c expat/amiga/include/libraries/expat.h expat/lib/iasciitab.h expat/xmlwf/xmlmime.c expat/tests/chardata.c expat/xmlwf/xmlmime.h expat/doc/style.css expat/README expat/tests/chardata.h expat/conftools/config.guess expat/doc/xmlwf.1 expat/conftools/ltmain.sh expat/conftools/config.sub expat/lib/nametab.h expat/bcb5/libexpatw_mtd.def expat/lib/asciitab.h expat/xmlwf/xmlwf.c expat/lib/expat.dsp expat/examples/outline.c expat/xmlwf/win32filemap.c expat/bcb5/elements.mak expat/bcb5/makefile.mak]

2007-11-13T18:57:18.728921Z Igor Melichev

Fix (make) : Could not build for x64 platform with Developer Studio 2005. 

DETAILS :

1. The old code uses the 32 bits compiler for compiling build utilities 
(genarchg, echogs), and then tries to link them with x64 libraries.

2. Developer Studio 2005 doesn't support -ZI 
(debug database for edit end continue) for the x64 platform. 

[src/msvccmd.mak]

2007-11-13T10:01:55.069333Z Ken Sharp

Fix (pdfwrite): type 3 fonts with exceedingly small BoundingBox
entries were clamped to 0 or 1.

Details:
Bug #689537 "FontBBox wrong in pdf generated by ps2pdf (breaks
acrobat 8)".

The type 3 font has a FontBBox of [0 0 0.3 0.3]. Because
pdfwrite uses integers to record the font bounding box, this was 
being clampled to [0 0 1 1]. This should not cause a prolem, but
for unknown reasons causes Acrobat 8 to render *very* slowly.

(gdevpdtf.h), 'struct /*type 3*/', alter the FontBBox member from
a gs_int_rect to a gs_rect to preserve floating point box values.

(gdevpdtt.c), pdf_make_font3_resource, copy the font bbox values
instead of floor'ing the lower and ceil'ing the upper values.

(gdevpdfu.c), create a new function 'pdf_write_font_bbox_float'
to write the bbox as floats instead of ints.

(gdevpdfx.h) prototype 'pdf_write_font_bbox_float'

(gdevpdtw.c), pdf_finish_write_contents_type3, use the new
routine to write out a floating point bounding box.

[src/gdevpdfx.h src/gdevpdtt.c src/gdevpdfu.c src/gdevpdtw.c src/gdevpdtf.h]

2007-11-12T08:59:35.891834Z Ken Sharp

Fix (pdfwrite): named objects, created via a pdfmark such as /BP,
could not have their content modified after the object was completed.

DETAILS:
Bug #689104 "Overwriting transformation /Matrix in XObject previously
created with /BP & /EP pdfmarks".

Some pdfmarks, such as /BP create named objects. These can accumulate
information until a matching pdfmark (/EP in this case) completes the
object. When complete, objects were written to the final destination
PDF file. This made it impossible to later modify the object.

(gdevpfm.c) pdfmark_bind_named_object, change the call to
pdf_substitute_resource to defer writing the object to the
destination file, if the object is named. This means the object is still
available for modification until the end of the job. NB if the object
is not named, we still write it immediately, as there is no mechanism
for modifying an unnamed object, nor do we currently have a mechanism
for maintaining a record of unnamed objects.

[src/gdevpdfm.c]

2007-11-10T17:20:49.620638Z Alex Cherepanov

Pre-scan the stream for '{' during the stream length check to avoid reading
to the end of the stream and closing it. Bug 689551, customer 661.

[lib/pdf_base.ps]

2007-11-09T21:18:04.579128Z Ralph Giles

Remove the JVERSION makefile variable.

We only support the current version 6 library, and it seems
unlikely to revise in the the near future. We also include
our own copy of the source now, so it is less important to
support a variety of third party library versions.

[src/openvms.mak src/macosx.mak src/watcw32.mak src/dvx-gcc.mak src/unixansi.mak src/msvclib.mak src/os2.mak src/openvms.mmk src/bcwin32.mak src/ugcclib.mak src/gs.mak src/Makefile.in doc/Make.htm src/msvc32.mak src/unix-gcc.mak src/macos-mcp.mak src/watclib.mak src/jpeg.mak]

2007-11-09T21:15:56.512922Z Ralph Giles

Remove the PNGVERSION makefile variable.
    
We no longer support building older versions of the libpng source,
and now include our own version, so there is no reason to maintain
this.

[src/openvms.mak src/macosx.mak src/watcw32.mak src/dvx-gcc.mak src/unixansi.mak src/msvclib.mak src/os2.mak src/openvms.mmk src/bcwin32.mak src/ugcclib.mak src/gs.mak src/libpng.mak doc/Make.htm src/msvc32.mak src/unix-gcc.mak src/macos-mcp.mak src/all-arch.mak src/watclib.mak]

2007-11-09T21:00:48.139238Z Ralph Giles

Update the top level makefiles with the current libpng version number.

[src/bcwin32.mak src/openvms.mak src/ugcclib.mak src/macosx.mak src/watcw32.mak src/dvx-gcc.mak src/msvc32.mak src/unix-gcc.mak src/unixansi.mak src/macos-mcp.mak src/msvclib.mak src/all-arch.mak src/openvms.mmk src/os2.mak src/watclib.mak]

2007-11-09T20:58:19.833269Z Ralph Giles

Use PNGSRCDIR and PNGVERSION instead of PSRCDIR and PVERSION in
the top level makefiles.

[src/openvms.mak src/macosx.mak src/watcw32.mak src/dvx-gcc.mak src/unixansi.mak src/msvclib.mak src/os2.mak src/openvms.mmk src/bcwin32.mak src/ugcclib.mak src/gs.mak src/libpng.mak src/Makefile.in doc/Make.htm src/msvc32.mak src/unix-gcc.mak src/macos-mcp.mak src/all-arch.mak src/watclib.mak]

2007-11-09T19:54:57.891517Z Ralph Giles

Minor cleanup of the expat makefile.

[src/expat.mak]

2007-11-09T01:14:15.828665Z Ralph Giles

Change the jbig2dec license from GPLv2 to GPLv2 or later.

[jbig2dec/LICENSE]

2007-11-08T07:57:21.838362Z Suzuki Toshiya

Fix: Ignore problematic post table in format 2.0 with ISOLatin1Encoding glyph names.

DETAILS:
Some TrueType fonts converted by "Windows Type 1 Installer" have
problematic post table format 2.0 including MacGlyphEncoding
entries which should be omitted. Such extra entries in the
beginning of glyphName array make /Encoding broken. By checking
if glyph name in post table is predefined one in MacGlyphEncoding,
such problematic post table can be detected. By ignoring such
problematic post table, bug 689495 is fixed.

However, some TrueType fonts designed for Microsoft redefines
MacGlyphEncoding glyph name out of predefined range. To permit
such font, the post table in format 2.0 is checked by
ISOLatin1Encoding which is the cross section of MacGlyphEncoding
and WinAnsiEncoding. ISOLatin1Encoding is enought to fix the
bug 689495.

[lib/gs_ttf.ps]

2007-11-07T07:13:45.310142Z Ralph Giles

Preliminary makefile for the expat third party library.

Can be used to link to the system expat with SHARE_EXPAT=1,
but compiling the source doesn't work on linux in this revision
because of missing configuration defines.

[src/gs.mak src/expat.mak]

2007-11-07T05:04:06.063702Z Ralph Giles

Copy the expat-2.0.1 tag source into the gs tree.

This 3rd party library is needed for XPS and eventually SVG support.

[expat]

2007-11-07T04:19:13.410191Z Alex Cherepanov

Add a skeleton implementation of the text extraction device.
It doesn't do anything useful yet, only prints "Hello world" once per page.

[src/gdevtxtw.c src/bcwin32.mak src/openvms.mak src/macosx.mak src/watcw32.mak src/Makefile.in src/msvc32.mak src/unix-gcc.mak src/unixansi.mak src/macos-mcp.mak src/devs.mak src/os2.mak]

2007-11-02T19:09:03.093400Z Marcos H. Woehrmann

Fix for Bug 689316.

On some systems XInitImage() appears to have
problems with images that are one pixel in height, so
if XInitImage() returns an error call XPutImage() instead.  

[src/gdevx.c]

2007-11-02T18:16:45.038692Z Ralph Giles

Document the interaction between a the vector device beginpage method
and gdev_vector_stream() more clearly.

[src/gdevvec.h]

2007-11-01T20:49:28.224038Z Ray Johnston

Make sure that errors are propogated to caller in the WTS device (such
as VMerror). Bug 689511 for customer 951.

DETAILS:

This doesn't really fix the underlying problem seen by the (embedded)
customer where the clist rendering uses a large amount of RAM.

[src/gdevwts.c]

2007-11-01T17:22:45.182105Z Igor Melichev

PS interpreter : Trace the executed operators' names (continued).

DETAILS :

Fix an inaccurate coding of the last patch.

[src/iinit.c]

2007-11-01T16:20:01.816428Z Igor Melichev

PS interpreter : Trace the executed operators' names.

DETAILS :

This change is syntactically equivalent for a default build.
For obtaining the new functionality Ghostscript must be compiled
with a new predefined macro DEBUG_TRACE_PS_OPERATORS.
The new debug switch '!' prints names of operators executed while the interpretation.
Note : Inline operators (which are expanded inside interp.c) are not printed. 

[src/iinit.c doc/Use.htm src/int.mak src/iinit.h src/interp.c]

2007-11-01T15:56:22.262417Z Alex Cherepanov

Move a 32K array from the stack to the heap to save stack space.

DETAILS:
Ghostscript is designed to run with 64K stack space for compatibility with
embedded environments. Unlike other MS systems, Windows NT enforces stack
space limit claimed by the application. MSVC 6 run-time uses about 8K
internally and remaining 56K stack was insufficient. 

[src/gdevpdfi.c]

2007-10-31T17:01:02.758539Z Ralph Giles

Rewrite gs_getdefaultdevice to avoid allocating memory.

The new version also skips tabs as whitespace and is more robust.

[src/gsdevice.c]

2007-10-31T17:00:59.582623Z Ralph Giles

Add a new GS_DEV_DEFAULT makefile variable for passing a preferred list
of default devices, in order of priority. These are passed through to
the C code, and searched for in gs_getdefaultdevice().

[src/gs.mak src/Makefile.in src/gscdefs.h src/gsdevice.c src/gscdef.c]

2007-10-31T17:00:55.551499Z Ralph Giles

Add Postcript bindings to gs_getdefaultdevice() and use them to set the
default device in the interpreter. Bug 689273.

[doc/Language.htm src/zdevice.c lib/gs_init.ps]

2007-10-31T17:00:51.435508Z Ralph Giles

Add a gs_getdefaultdevice() call and use it when printing the help
message. It just returns the first device as before. Bug 689273.

[src/gsdevice.h src/imainarg.c src/gsdevice.c]

2007-10-30T23:45:46.184301Z Ralph Giles

Add missing dependencies to the contrib device build.

[contrib/contrib.mak]

2007-10-30T19:26:01.651347Z Igor Melichev

Fix (banding) : Improving the debug trace about compositors (continued).

DETAILS :

This change is algorithmically equivalent for release build.
In the debug build it only improves debug printing
with distinguishing gs_ and gx_ operations.

[src/gstrans.c]

2007-10-30T17:47:49.373667Z Igor Melichev

Fix (banding) : Improving the debug trace about compositors.

DETAILS :

This change is algorithmically equivalent for release build.
In the debug build it only adds more debug printing.

1. Added a debug printing for alpha, overprint and rop compositors
when writing/reading from/to clist.

2. (gxclrast.c) When printing a matrix with the 'L' switch,
use global page coordinates as rectangle operations do.
It allows to map reading operatrions to corresponding writeing operations.
  

[src/gsropc.c doc/Use.htm src/gsalphac.c src/gsovrc.c src/gxclrast.c]

2007-10-30T00:58:44.912591Z Ralph Giles

Add a cast to prevent a warning.

[src/zfjpx.c]

2007-10-28T23:33:59.326612Z Alex Cherepanov

Move "true .setaccuratecurves" to the PDF graphic state initialization
where it belongs. This fix enables accurate curve rendering by GSview
doesn't use some parts of Ghostscript startup code. Bug 688434.

[lib/pdf_main.ps lib/pdf_ops.ps]

2007-10-28T18:22:29.779063Z Ralph Giles

Correct a typo.

[doc/Use.htm]

2007-10-28T17:17:47.899537Z Alex Cherepanov

Change pdf_base.ps::.pdfrun and pdf_sec.ps::.decpdfrun to ensure
"PDFScanRules" == "true" while scanning the PDF, and if necessary revert
it back to "null" before returning. Thanks to SaGS for the patch. Bug 688598.

DETAILS:
The bug is triggered by the construct "//DeviceGray" found in  the sample PDF.
The following command fails with the same error as GSView, and for the
same reason:

    pdfopt.bat media_365163.pdf output.pdf

When Ghostscript interprets a PDF directly, most of the job is done by
LIB\pdf_main.ps::dopdfpages which sets "PDFScanRules" correctly. However,
the initial part of scanning the PDF (trailer dict, ...), and the rebuild
logic scan the PDF with wrong "PDFScanRules". Also GS's own various tools
and GSView don't set/ reset it as needed.

Implementation details:

(A) ".pdfrun" and ".decpdfrun" dinamically construct procedures that do the
real work and immediately execute them. The patch changes  these procedures
to include setting/ restoring "PDFScanRules". If "PDFScanRules" == "true"
already, then "setuserparams" is not called at all, so normally
(when ".[dec]pdfrun" executed during "dopdfpages") there's practically no
impact on performance.

There are also "token" calls outside these 2 procedures, but these calls are
for scanning the xref and "# # obj" lines, which don't contain PDF name
objects.

(B) ".getuserparam" GS-specific operator changed to recognize scanner options
too ("PDFScanRules" and "PDFScanInvNum"). This is needed by ".[dec]pdfrun"
for restoring "PDFScanRules"; also used for an optimization (to omit calling
"setuserparams" when not actually needed).

Note:
    For "Process[DSC]Comment" it returns "true" if a procedure 
    is set, and not the actual procedure. To retrive the 
    procedures (or null if none set), use "currentuserparams". 

(C) ".currentuserparams" is NOT modified, so it does not return scanner
options. If it did, these ended up being put into "userparams" and be
affected by "save"/ "restore" (see the  redefinition of "restore" in
gs_lev2.ps).

[src/itoken.h lib/pdf_base.ps lib/pdf_sec.ps src/zusparam.c src/ztoken.c]

2007-10-28T14:19:46.108672Z Alex Cherepanov

Stop reading the xref+trailer at the closing ">>" because PDF 1.7 Reference
made "startxref" optional in some cases. Thanks to SaGS for thr patch.
Bug 688283.

DETAILS:
The PDF 1.7 Reference, section F.2.3 "First-Page Cross-Reference 
Table and Trailer (Part 3)", 2nd paragraph on page 1031 states:

   "The first-page trailer may optionally end with startxref, an 
    integer, and %%EOF, just as in an ordinary trailer. This 
    information is ignored."

(note the word "optionally"), so in such a case a PDF interpreter 
cannot rely on anything particular (like "startxref"/ "startref"/ 
"xref") to follow the trailer dictionary. Now consider a linearized 
PDF being incrementally updated, and you get that in the general 
case a "previous trailer" may lack the "startxref". Apparently, 
Acrobat does a similar thing when creating hybrid-ref PDFs.

[lib/pdf_main.ps lib/pdf_rbld.ps]

2007-10-27T19:55:00.858126Z Igor Melichev

Banding : Extend clist language with trapezoids, linear color trapezoids and linear color triangles (continued 9).

DETAILS :

Bug 689526 "Regression: performance issues with r8118".

This patch clips triangles an trapezoids with band bbox
during the clist playback. The old code spends much time 
for rasterizes parts that fall outside the band,
espcially if the band height is small.

Also fixed an obsolete comment.
  

[src/gxclrast.c]

2007-10-27T18:55:14.195971Z Alex Cherepanov

Extract and process default PDF file from the PDF collection when
it is defined. Otherwise process the container PDF file.

DETAILS:
The procedure pdf_collection_files can be extended to select other
PDF files from the collection and extract them for processing.

[lib/pdf_main.ps lib/pdf2dsc.ps]

2007-10-26T07:41:30.826491Z Ken Sharp

Fix (pdfwrite): Type 1 CharStrings could be converted to invalid 
type 2 CharStrings if the glyph program used implicit start points 
for subpaths.

DETAILS:
Bug #689055 "pdfwrite creates a bad Type1C font"

If a type 1 CharString used an implicit point, either the initial point 
(0,0) or the point resulting from a closepath, then the type 2 output 
code duplicated this. Unfortunately this is illegal in type 2 CharStrings
where each subpath must begin with one of the 'move' instructions.

(gdevpsfx.c) psf_convert_type1_to_type2, create a new boolean variable
'need_moveto' initialised to true. When we encounter a move operation,
set it to false. When we encounter a closepath, set it back to true.
Thus this variable is always true at the beginning of a subpath, and 
becomes false as soon as a move instruction is encountered.

While converting type 1 CharStrings, whenever the current instruction is 
a line drawing operation, if 'need_moveto' create a move instruction, 
taking account of any pending glyph widths.


This is only performed on the second (conversion) pass through the type 1 
CharSrtring as we don't need to worry about this during the first (hint 
collection) pass.

[src/gdevpsfx.c]

2007-10-26T01:49:56.180182Z Ralph Giles

Merge makeset.tcl into makehist.tcl.

[toolbin/makehist.tcl toolbin/makeset.tcl]

2007-10-26T01:49:54.293117Z Ralph Giles

Remove obsolete release and diff scripts.

[toolbin/3way.tcl toolbin/makefonts.tcl toolbin/maketars.tcl toolbin/makemaster.tcl toolbin/makeset.tcl toolbin/makewin.tcl]

2007-10-26T01:08:04.549848Z Ralph Giles

Document how to use -dTTYPAUSE with -dSAFER. Bug 687988.

[doc/Use.htm]

2007-10-25T22:14:22.288695Z Ralph Giles

Correct some gcc warnings.

[jbig2dec/config.h jbig2dec/jbig2_text.c jbig2dec/jbig2_image.h jbig2dec/jbig2_symbol_dict.c jbig2dec/jbig2_generic.c jbig2dec/jbig2_page.c jbig2dec/jbig2_refinement.c]

2007-10-25T00:30:18.383197Z Ralph Giles

Include an example of how to create non-ASCII font names in the cidfmap.
Bug 688203.

[doc/Use.htm]

2007-10-24T23:32:20.291355Z Ralph Giles

Append the CUPS font directory to the search path. Bug 689334.

[src/configure.ac]

2007-10-24T22:46:28.083133Z Ralph Giles

Add an XCFLAGS macro to the MSVC build to match the variable of the same
name in the unix builds. This is intended mainly for adding preprocessor
defines at make time. Bug 689530.

[src/msvc32.mak]

2007-10-24T22:46:25.428278Z Ralph Giles

Only add XLDFLAGS to LDFLAGS temporarily when checking for the
additional X libraries. Bug 689411.

[src/configure.ac]

2007-10-24T18:39:55.448984Z Ralph Giles

Use the proper build machinery to link to cups.

DETAILS:

Previously, the configure script just appended the output of cups-config
to CFLAGS and LIBS which could confuse other parts of the build. The
LIBS setting was actually ignored by cups.mak which hard coded liking
to cups and cupsimage through the genconf -lib option, although it
depended on it for the search patch if cups was in a non-standard
location.

Instead, we parse the output of cups-config to separate the dependent
libraries and additional search paths if any, and pass those through
to genconf in the intended way. This destroys the order of the link
line, but GNU ld, at least, applies all -L paths to all -l libraries,
so that should not distrurb the build. We pass any extra include paths
in a special variable and use it directly when compiling gdevcups.c to
avoid confusing the search path for other components.

Configure also used to ignore cups-config if it found cups/raster.h in
the current search path. We now prefer cups-config.

[src/Makefile.in src/configure.ac cups/cups.mak]

2007-10-24T18:39:51.211490Z Ralph Giles

Abstract the autoconf build's link line flattening for generic use.

DETAILS:

The Ghostscript build system expects a list of bare library names
for specifying library dependencies through the .dev files to
genconf. The configure script had some code to decompose the usual
unix-style "-lX11 -lXt" link flags returned by AC_PATH_XTRA.

As we've added more optional external libraries to the autoconf
build, this has become a general need, so the code is now abstracted
into an autoconf macro for use elsewhere in the configure script.

[src/configure.ac]

2007-10-24T07:31:09.815969Z Ken Sharp

Fix (pdfwrite) : An integer arithmetic overflow while converting Type 1 CharStrings into Type 2.

DETAILS :

Bug #689106 "Wrong charpath direction in PDF"
Patch from Rolf Becker with minor improvements.

A processing of big integers was implemented in gstype1.c
while rendering a glyph, but it was not implemented
in pdfwrite while converting a Type 1 font into Type 2.
It caused an incorrect glyph outlines embedded into PDF.
This patch factors out the old processing as a new
function gs_type1_check_float and applies it in gdevpsfx.c .
The function prototype is added to gxtype1.h as it needs to be public.

The patch also improves comments in code
because now we understand better what happens in there.
For more details see comments in code.

The change to gstype1.c is algorithmically equivalent
except inserting a new check for overflow in float2fixed.
The new check may fail when the old code
renders an incorrect outline.
We have no practical cases that demonstrate it.

[src/gstype1.c src/gdevpsfx.c src/gxtype1.h]

2007-10-23T03:48:59.052392Z Alex Cherepanov

Handle yet another type of broken PDF generated by Adobe Acrobat 8.1
that lacks startxref operator. Bug 689413, customer 531.

[lib/pdf_main.ps]

2007-10-21T20:49:29.646397Z Alex Cherepanov

Process duplicate entries in PDF 1.5 context stream the same way as
the entries from regular streams: the first entry found (i.e. the last
in the xref chain) takes efferct. Keep rebuilding logic intact, where
the last entry wins. Bug 689513, customer 700.

[lib/pdf_main.ps lib/pdf_rbld.ps]

2007-10-20T23:14:30.016619Z Alex Cherepanov

Check for unbalanced q operators in the pattern stream and add Q as needed.
Bug 689523, customer 870.

[lib/pdf_draw.ps]

2007-10-20T19:14:28.348994Z Alex Cherepanov

Make IGC_PTR_STABILITY_CHECK an independent compile-time flag that can be set
from the command line without editing gxobj.h .

[src/gxobj.h]

2007-10-20T16:34:38.276462Z Alex Cherepanov

Relax ICCBased color space validation. Don't reject correct PDF files that have
ICCBased color space as an alternative color space to another ICCBased color
space. Bug 689524, customer 870.

[lib/gs_icc.ps]

2007-10-20T00:55:55.884848Z Ralph Giles

Pass the CFLAGS obtained for fontconfig from pkg-config separately
to avoid contaminating the general build.

[src/Makefile.in src/configure.ac src/unix-aux.mak]

2007-10-20T00:37:23.775560Z Ralph Giles

Remove a redundant check for pkg-config.

[src/configure.ac]

2007-10-20T00:37:19.682121Z Ralph Giles

Look for fontconfig even if pkg-config doesn't find it.

DETAILS:

Like the comment says, pkg-config isn't universally installed,
so we should not depend on it. If pkg-config isn't available
or doesn't find fontconfig, check for the library and headers
it in the standard locations.

[src/configure.ac]

2007-10-18T18:58:54.836534Z Ralph Giles

Install header files as data, not executables. Bug 689466.

[src/unix-dll.mak]

2007-10-18T00:36:37.403207Z Ralph Giles

Remove a spurious CFLAGS instance from the jasper compile line.

DETAILS:

The definition of CC_ passed from the top level makefile should
already include a copy of the CFLAGS for environment overrides,
so the duplicate copy here was unnecessary.

Furthermore, the second expansion of CFLAGS at the end of the
compiler command line could result in picking up a version of
the jasper headers installed elsewhere in the system instead
of the copy in JASSRC, causing the build to fail on undefined
preprocessor symbols, since upstream doesn't have our error
reporting callback.

[src/jasper.mak]

2007-10-18T00:05:55.933230Z Ralph Giles

Replace our included libpng with the new upstream 1.2.22 release.

[libpng]

2007-10-18T00:01:45.449158Z Ralph Giles

Move the current copy of libpng out of the way for a pending update.

[libpng]

2007-10-17T23:04:50.954798Z Ralph Giles

Avoid memory corruption with broken files.

Patch from the Ubuntu libjasper package.

[jasper/src/libjasper/jpc/jpc_cs.c jasper/src/libjasper/jpc/jpc_dec.c jasper/src/libjasper/jp2/jp2_cod.c]

2007-10-16T07:54:08.209510Z Ken Sharp

ps2write: When encountering font names which contain unfortunate characters
such as white space, or delimiters, emit the name as an escaped string and 
'cvn' instead of a literal name.

DETAILS:
Bug #689420 "Errors with ps2write and special chars in FontName"

Patch from SaGS with some minor improvements.

Fonts whose name contains white space, or delimiter characters (eg /,(,[ etc)
were being written into the type 1 font stream using the name unchanged. This 
causes the resulting PostScript to fail on any PostScript interpreter. The 
exact error varies depending on the placement of the invalid character and 
the following data.

This is now handled by emitting the font name as a string, and using the cvn
operator to convert the string to a name, escaping characters if required. 
Note that both the C portion of the code needs to change, in order to write 
escaped names, and the PostScript prolog in order to undo any name escapement.

1. (gdevpsf1.c) write_font_name, check to see if the font name contains any
   characters which we need to escape. If so, then use the existing routine
   's_PSSE_template.process' to convert the name to an escaped character 
   sequence.

   Update the write_font_name routine so that it optionally writes a name
   to the output. If the name does not need escaping, then simply prepend a
   '/' to make a literal name, otherwise append a 'cvn' to convert the 
   escaped string to a name. When writing out the font header we just need
   the font name as a human readable string. When writing the /FontName
   entry in the font dictionary we need a PostScript name, either a literal
   or a PostScript escaped string converted to a name. (see below)

2. (gdevpsf1.c) psf_write_type1_font, alter the use of write_font_name in two
   places. Firstly to emit the name as part of the font comment, secondly to
   put the name as the value for the /FontName key in the fotn dictionary. In
   the first case we write it as a simple string, in the second as a name.

3. (opdfread.ps) The TypeDameons procedure extracts the FontName from the Font
   dictionary in the body of the job. Since the FontName can now be escaped,
   we need to undo the escapement before defining the font. Firstly we define
   a new procedure 'UnPDFEscape', secondly we call this when dealing with the
   FontName and the BaseFont keys, in order to convert the escaped name back
   to a normal name, so that the font can be found with findfont.

[src/gdevpsf1.c lib/opdfread.ps]

2007-10-16T00:36:28.849878Z Ralph Giles

Don't override the memory set by the caller in the JPXDecode stream.

[src/sjpx.c]

2007-10-16T00:36:27.806530Z Ralph Giles

It's the client's responsibility to call the set_defaults
method on a new stream. Bug 689362.

DETAILS:

The JPXDecode stream implementation was calling set_defaults
from within its own init method, clobbering the colorspace
request passed in through the stream's parameter dictionary.

[src/zfjpx.c src/sjpx.c]

2007-10-15T22:31:54.394164Z Henry Stiles

Error code from clist_decode_segment did not propagate back because
the inner automatic variable code shadowed the outer.

[src/gxclrast.c]

2007-10-15T18:09:18.231759Z Ray Johnston

Prevent C-stack overflow caused by infinite recursion. Related to
previous fix in same function to access the correct target color
procedure.

DETAILS:

Testing with other problem files detected the recursion. The previous
method to access the saved target get_color_comp_index is moved
before either use.

EXPECTED DIFFRENCES:

None.

[src/gdevp14.c]

2007-10-15T13:11:16.778228Z Ken Sharp

pdfwrite: When writing the /CreationDate /ModDate keys in the Info dictionary,
properly write the system local time instead of UTC.

DETAILS:
Bug #688783 "commit 6892 mis-uses the TZ environmental"

A rather lengthy thread, but in essence quite simple. A change to calculate
the system local time as an offset from UTC, and store this information in 
the form described in the PDF Reference (Section 3.8.3 "Dates" on p133 of 
the 1.6 PDF Reference).

The patch uses code supplied by SaGS.

(gdevpdf.c) pdf_initialize_ids, use the C runtime 'time' and 'gmtime' to 
determine the difference between local system time and GMT. Use this to 
calculate the difference (positive, negative, or none) from GMT, and the
number of hours and minutes comprising the difference. Use 'localtime' to
find the local system date and time.

Take all of the information from above, and format the result according to
the specification in the PDF Reference:

(D:YYYYMMDDhhmmssZhh'mm')

Where YYYY=4 digit local time year
        MM=2 digit local time month
        DD=2 digit local time day
        hh=2 digit local time hours (24 hour)
        mm=2 digit local time minutes
        ss=2 digit local time seconds
         Z=offset of local time from UTC
           Z=no difference
           +=local time later than UTC
           -=local time earlier than UTC
       hh'=hours difference between local time and UTC
       mm'=minutes difference between local time and UTC

[src/gdevpdf.c]

2007-10-15T06:43:04.430544Z Marcos H. Woehrmann

Added code to the pxlcolor device (gdevpx.c) to set the color space even
if the test for "portrait transformations" fails.

DETAILS:

The pclxl_begin_image() function performs a rather complicated test to
see if the image transformation can be "handled" (line 1434).  If this
test fails the routine falls through to using gx_default_begin_image().
However, in this case the pcl-xl color space is never set and if
the previous color space was eGray the pcl-xl stream will fail with
ExtraData (because 3 times as much data as expected will be written).
Presumably the inverse is also true, but I don't have a test case for it.

The solution is to call pclxl_set_color_space() in the use_default
case (a possibly more correct solution would be to call
pclxl_set_color_palette()).

[src/gdevpx.c]

2007-10-12T20:22:08.884187Z Ray Johnston

Fix SEGV when clist used with pdf14_cmykspot device.
Bug 689493 for customer #190.

DETAILS:

When the clist is used, the pdf14 device sets the clist color procs
(including get_color_comp_index) to it's own procedures, saving the
actual target procs. When the Separation name is new, we need to use
the saved target procs.

[src/gdevp14.c]

2007-10-12T16:38:07.833396Z Ray Johnston

Fix divide by zero crash. Bug 689493 reported by customer #190.

DETAILS:

When new_width is 0, just use 1 in the test (works well enough
for checking overflow)

[src/gdevprn.c]

2007-10-11T16:36:26.031981Z Ray Johnston

Fix incorrect colors with transparency to cmyk+spot devices (such as tiffsep).
Bug 689494 for customer #190.

DETAILS:

CMYK + Spot colors are subtractive. The blending with the 'bg' color was
inverted, causing very strange colors.

Note that the pdf14_cmykspot_put_image is VERY inefficient and at the
very least should have logic added to write runs of the same color
as a wide rectangle (rather than the current 1x1 pixel rectangles).

[src/gdevp14.c]

2007-10-10T23:02:18.957895Z Igor Melichev

Fix (stroking) : Prevent installing an extra clipper device, step 2.

DETAILS :

Bug 689427 "Superposed clippers".

The last patch doesn't fix the problem when stroking
a path with a shading color.

The new code distinguishes 3 cases :

1. When painting happens through low level device methods
which don't accept a clipping path. It happens inside 
stroke_fill, so the new code passes the clipper device to it.

2. When the painting happens through fill_path, 
which does handle a clipping path. It happens inside
FILL_STROKE_PATH, so the new code doesn't pass the clipper to it,
but passes the clipping path as it worked before the last patch.

3. When the stroking algorithm is called from 'strokepath',
don't need a clipping at all. This case works as before,
but the new code doesn't construct a clipping device.

Minor change : Added a new argument 'dev' to the macro
FILL_STROKE_PATH to simplify the code understanding and debugging.

[src/gxstroke.c]

2007-10-10T18:42:35.474048Z Ralph Giles

Pass the results of calling cups-config to cups.mak from configure 
through the top-level makefile rather than calling cups-config directly, 
so that passing an alternate cups environment to configure works.
Bug 689496.

DETAILS:

This is more consistent, since configure and cups.mak were previously 
calling cups independently. However, setting the cups environment at
the make level my have accidentally worked before; it won't work now.

[src/Makefile.in src/configure.ac cups/cups.mak]

2007-10-10T17:40:38.235834Z Ralph Giles

Turn on keyword substitution on pdf_cslayer.ps. This is the correct fix 
for the issue mentinoed in r8283. Also set native line endings and 
remove some spurious executable properties.

[lib/EndOfTask.ps lib/PDFX_def.ps lib/PDFA_def.ps lib/dumphint.ps lib/pdf_cslayer.ps]

2007-10-10T16:19:23.023493Z Marcos H. Woehrmann

Fixed Id line to make nightly regression run happy.

[lib/pdf_cslayer.ps]

2007-10-10T15:28:26.622499Z Igor Melichev

Fix (stroking) : Prevent installing an extra clipper device.

DETAILS :

Bug 689427 "Superposed clippers".

The old code installs a clipper in gx_stroke_path_only_aux
and then (indirectly) calls gx_general_fill_path
with passing same clipping path. It caused gx_general_fill_path
to install a second clipper with same clipping path.
This patch simply passes down a NULL clipping path.

Minor change : Added a 'pcpath' argument to the macro
FILL_STROKE_PATH for easier understanding and debugging.

[src/gxstroke.c]

2007-10-10T10:13:45.175824Z Igor Melichev

Fix (pdf14 device) : Optimize the buffer backdropping, step 2.

DETAILS :

1. Intersect the backdrop rectangle with the bbox of a real painting to the transparebcy buffer,
which is accummulated from pdf14_fill_rectangle. It reduces the rectangle for a faster blending.
1.1. Removed min_int, max_int from pdf14_buf_new against an integer overflow when computing 
sizes of rectangles.
1.2. Do intersect rectangles in In pdf14_put_image, pdf14_cmykspot_put_image, pdf14_custom_put_image.

2. dump_planar_rgba still could access outside the buffer due to a recent patch is incomplete.

[src/gdevp14.c]

2007-10-10T09:38:32.826812Z Igor Melichev

Fix (pdf14 device) : Optimize the buffer backdropping, step 1.

DETAILS :

This change is algorithmically equivalent.
It only defines some local variables as a preparation to the next change.

[src/gdevp14.c]

2007-10-10T08:59:39.164904Z Igor Melichev

Fix (pdf14 device) : Don't allocate transparency buffer for bands that appear outside the transparency bounding box.

DETAILS :

This is an optimization, which should be algorithmically equivalent.

For bands outside the transparency bounding box the old code
allocated a zero length buffer and performed fake operations with it.

The main change is gdevp14.c ln 550.
Others prevent an access to the buffer when it is not allocated.

Note that in some cases the new check is excessive
because (width <= 0 || height <= 0) normally means no buffer.
We check for (buf->data == NULL) anyway to simplify the sefity proof
and documentation.

[src/gdevp14.c]

2007-10-10T08:12:49.566532Z Igor Melichev

Fix (pdf14 device) : Properly intersect rects when composing transparency buffers (continued 2).

DETAILS :

Bug 689498 "transparency: The buffer backdroping code can write outside bufers.".
Bug 688631 "PDF segfault".

This patch ports the revision 7064 changes from pdf14_put_image to
pdf14_cmykspot_put_image and pdf14_custom_put_image, which were added 
after the revision 7064. They need same improvement, which was mised
due to a development miscoordination.

This change is committed without any testing,
because the author has no test cases which involve
pdf14_cmykspot_put_image and pdf14_custom_put_image.
Possibly they need to build Ghostscript with special options 
and to run the test case of the bug 688631 with special devices.
The bug 689498 is passed to Suport for further processing and testing.

[src/gdevp14.c]

2007-10-09T19:33:27.492485Z Till Kamppeter

On "make soinstall" some files did not get installed.

[src/unix-dll.mak]

2007-10-09T17:02:49.926924Z Igor Melichev

Fix (FAPI / UFST bridge) : A crash when processing an embedded CIDFontType 11.

DETAILS :

Debugged with running the test case of the bug 689471 with FAPI.
Needs an additional change to lib/FAPIconfig for running the test case with FAPI :

- /HookDiskFonts        [1 2 9 11 42]  % FontType values for disk PS fonts to be redirected to FAPI.
- /HookEmbeddedFonts    [1 2 9 11 42]  % FontType values for embedded PS fonts to be redirected to FAPI.
+ /HookDiskFonts        [2 9 11 42]  % FontType values for disk PS fonts to be redirected to FAPI.
+ /HookEmbeddedFonts    [2 9 11 42]  % FontType values for embedded PS fonts to be redirected to FAPI.

because UFST still can't handle embedded Type 1.

This patch passes impl_PCLchId2ptr as p_PCLglyphID2Ptr argument.
We believe it is correct for True Type,
but we're not sure about Type 1,
because Type 1 composite glyphs refer subglyphs 
in an inobvious way - see Type 1 specification.

[src/fapiufst.c]

2007-10-09T08:28:49.108879Z Ken Sharp

pdfwrite: Allow downsampling of images in a /Indexed colour space, provided the
downsampling type is 'subsample'.

DETAILS:
Bug 689265 "PDF created by GS 8.57 is much larger than from competitive creator"

The original job contains several images, including one large one, which are in a 
/Indexed colour space. We can't use average or bicubic downsampling with /Indexed
colour space, because the colours in the space may not be linear. It ought to be
possible to use subsampling though.

Where we previously checked the image colour space and decided to disable downsampling
if the colour space was /Indexed, we now additionally check the downsampling type
and permit it if the type is 'Subsample'.

(gdevpdfi.c) pdf_begin_typed_image, check the downsample type as well as the colour 
space before deciding not to allow downsampling. 

(gdevpdsi.c) psdf_setup_image_filters, check if the colour space is /Indexed before 
deciding which set of image parameters to use (2 places). Also, if we do encounter a
/Indexed space, make the compression filter into Flate to ensure we don't try and use any 
kind of JPEG compression, which may not work properly with Indexed spaces, and in any case
is not the most appropriate type of compression in this situation.

[src/gdevpsdi.c src/gdevpdfi.c]

2007-10-09T00:06:24.193850Z Igor Melichev

Fix (font emulation) : Could not handle unknown Ordering with FAPI.

DETAILS :

Debugged with running the test case of the bug 689471 with FAPI.

[lib/gs_fntem.ps]

2007-10-08T10:05:33.511010Z Ken Sharp

pdfwrite: Alter the AIIM URL emitted when creating PDF/A files.

DETAILS:
Bug #689375 ""

When writing PDF/A files we need to put a URL for the AIIM group in the metadata. Previously we were writing 'http://www.aiim.org/pdfa/ns/id.html' which is what Acrobat 7 does, now we write 'http://www.aiim.org/pdfa/ns/id/' which is what Acrobat 8 does.

(gzpdfe.c) pdf_write_document_metadata change the URL as above.

[src/gdevpdfe.c]

2007-10-08T07:13:32.510990Z Ken Sharp

pdfwrite: when encountering a glyph in a type 3 font for which no Charproc is defined 
emit a simple setcachedevice operation instead of an empty stream.

DETAILS:
Bug #688834 "Undefined characters in Type 3 fonts cause PDF conversion to fail"

The original report, based on an older version of pdfwrite, states that an error occurs with 
pdfwrite when using glyphs from a type 3 font where there is no charproc defined for the
glyphs.

In fact, with the current version of pdfwrite, no error occurs, but the resulting file
causes Acrobat to give warnings and display the result incorrectly. NB other PDF consumers
do not behave this way.

This appears to be caused by pdfwrite emitting an empty stream (length 0), because no charproc 
is captured for the glyph (since it has none). For some reason Acrobat takes exception to this.

A simple solution is to write a stream which is not empty. The sequence '0 0 0 0 0 0 d1'
, a

setcachedevice with arguments all 0, resolves the problem.

(gdevpdtt.c) In pdf_text_process, after capturing a Charproc for a type 3 font, check the length
of the stream. If it is 0 bytes, then emit '0 0 0 0 0 0 d1' and carry on.


[src/gdevpdtt.c]

2007-10-07T18:09:11.121700Z Igor Melichev

Fix (pdfwrite) : Ignore font errors that do not belong to embedded subset.

DETAILS :

Bug 689068 "ps2pdf13 fails with Error: /invalidfont in --ashow--".

The document could successfully rasterize,
but failed with invalidfont when converting to PDF.
It happened due to a missed glyph,
which is not atually used in the doeument.

The patch skips font errors that do not belong to the font subset.
However if the user requests to embed a complete font,
a warning is printed to stderr and the document fails
due to the font error as before the patch.

Changes :

1. gdevpdtb.c : Process a coplete font copy error as explained above.

2. gsfont.c : Ignore missed glyphs when computing the "fixed width" font feature.

[src/gdevpdtb.c src/gsfont.c]

2007-10-04T06:46:54.927607Z Ralph Giles

Revert a change inadvertently included r8257. This broke the MSVC
build, which does not define CC_SHARED.

[src/lib.mak]

2007-10-03T17:37:35.315273Z Ray Johnston

Revert patch 8268 (restoring the FCOfontmap-* files) and add the Encoding/
directory to the RESOURCE_LIST so that it will be include in the %rom%
file system. This is the _real_ fix to bug #689050 and explains why the
symptoms appeared to be related to having Wingdings installed on the
system. Thanks to Henry and Igor in pointing out the incorrect Encoding
used in the previous patch that led me to the actual problem.

[lib/FCOfontmap-PCLPS3 lib/FCOfontmap-PS3 src/int.mak lib/FCOfontmap-PCLPS2]

2007-10-03T04:40:18.040901Z Ray Johnston

Fix FCOfontmap-* files so that Wingdings will be found.
Bug #689050 for customer #951.

[lib/FCOfontmap-PCLPS3 lib/FCOfontmap-PS3 lib/FCOfontmap-PCLPS2]

2007-10-03T00:18:12.256656Z Ralph Giles

Document the .IgnoreNumCopies device parameter. Bug 689491.

[doc/Use.htm doc/Language.htm]

2007-10-02T23:55:30.880679Z Alex Cherepanov

Add extraction of layer information from Illustratir CS2/CS3 PDF files
to the code base but don't run it in the default configuration.

[src/int.mak doc/Develop.htm lib/pdf_cslayer.ps]

2007-10-02T07:31:58.125500Z Ken Sharp

pdfwrite: Convert 'text' followed by 'text charpath stroke' to a single text
operation by using text rendering mode 2.

DETAILS:
Bug #689310 "Offset between text and outline in pdfwrite.dev"

Emitting text, followed by the same text as an argument to charpath, and then stroking the
resulting path previously resulted in a large path being emitted and stroked in the PDF file. 

This is inefficient, but worse the path is not grid fitted, whereas the text is. When
used to stroke the outline of previously rendered text, either in a different colour or to
create a 'bold' effect, the emitted path did not always precisely match the rendered text.

This change is to emit this PostScript construct using the closest available match in PDF, 
which is the text rendering mode. There are two parts to this change, firstly to identify 
when a path is the result of a charpath, and secondly to merge text followed by charpath/stroke
operations into a single operation on output.

1. (gzpath.h) Add a new member 'last_charpath_segment' to the gx_path_s structure. Update the
   path garbage collection code for relocation of new variable.

2. (gxpath.c) Initialise the new member 'last_charpath_segment' to 0 in
   gx_path_init_contents, and also in path_alloc_copy to prevent copies being identified as
   the result of a charpath.

3. (gxchar.c) We need to be able to tell if a path was the result of a charpath. To do this
   we store the final segment of a path in 'last_charpath_segment' of the path
   structure during show_finish, if the current operation was a charpath. See also item 11.

4. (gdevpdfx.h) Add a new member 'last_charpath_op' to the gx_device_pdf_s structure, to
   hold the boolean argument associated with a charpath operation. Also add to the 
   pdf_substream_s structure to allow us to save and restore this value on entry to or
   exit from a PDF substream.

5. (gdevpdti.c) Save and restore the value of last_charpath_op in pdf_enter_substream
   and pdf_exit_substream.

6. (gdevpdfx.h) Add a new member variable 'last_charpath_op' to the 'pdf_substream_save_s' 
   structure to allow us to save and restore the last_charpath_op as noted above.

7. (gdevpdtt.c) During gdev_pdf_text_begin, if the operation is a charpath, check the
   following conditions, if met then store a copy of the charpath boolean variable in 
   a new member of the gx_device_pdf_s structure.
       1. Operation must be a charpath
       2. Current path must be empty (can't handle charpath concatenated to existing path)
       3. The font being used for the current text must be the same as the font used for
          the previous stored (but not yet emitted) text.
       4. The initial point of the text for the charpath must match the initial point of
          the previous stored text.
       5. The text bytes must be the same as the previous stored text.
       6. The point size of the text must match the previous stored text.
   Also, move the calculation of the font point size out of pdf_update_text_state so that
   we can calculate the size in pdf_compare_text_state_for_charpath' defined in 9 below
   without duplicating code.

8. (gdevpdtt.h) Prototype 'pdf_calculate_text_size'

9. (gdevpdts.c) Add a new function 'pdf_compare_text_state_for_charpath' to do the 
   checking noted above. The pdf_text_state_s structure is not defined publicly, so 
   we need code to access its members. Also add a function 'pdf_modify_text_render_mode'
   which will attempt to add a rendering mode (stroke, fill or clip) to existing text
   by updating the existing text rendering mode. Returns 0 if the existing text cannot
   be modified, and we fall back to emitting a path and stroke.

10. (gdevpdts.h) Add prototypes for the functions required in 9.

11. (gdevpdfd.c) In pdf_stroke_path, if the 'last_charpath_op' member of the pdf device
   structure is set, perform some more checks (below) and if passed, set the text render
   mode of the stored text, set the stroke colour, set the line width, and force the stored
   text to be emitted. This conveniently results in a gsave/grestore pair round the
   graphics state changes.
      1. The last charpath operation must have been 'false charpath'
      2. There must be a non-empty path (result of the charpath operation)
      3. The 'last_charpath_segment' stored in the path must match the actual last segment
         in the path. (can't handle path segments added to the result of a charpath)

12. (gdevpdfg.h) Make the pdf_reset_color routine public, as we need to be able to set the 
   colour from pdf_stroke_path.

13. (gddevpdfg.c) We need to be able to set a stroke colour while in a TEXT context,
   previously the routine pdf_reset_color, which emits colours and spaces, immediately
   switched to a STREAM context, which caused pending text to be flushed. pdf_reset_color
   was only called from two places, pdf_set_drawing_color and pdf_set_pure_color. The
   switch to a STREAM context has been moved to these rout