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.


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.

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,
	if (pdev == 0)
	code = (*dev_proc(pdev, open_device)) ((gx_device *) pdev);

Later the two control paths rejoin and we put some objects on the execution

    push_mark_estack(es_other, pattern_paint_cleanup);
    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.


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.


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.


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.


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.

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.


2008-07-28T10:10:53.373341Z Igor Melichev

Fix (clist writer) : Improve the logic about zero tile id.


Thanks to Peter for participation. See comment in code.


2008-07-28T07:52:42.264750Z Igor Melichev

Fix (printer) : A check for buffer space overflow was dramatically overestimated.


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 .


2008-07-27T21:06:38.633515Z Igor Melichev

Fix (shading) : Empty clipping was entirely lost.


Bug 689982 "A wrong shading raster".

The old code doesn't account that gx_cpath_from_rectangle
may normalize the given rectangle.


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.


2008-07-27T16:01:28.177923Z Igor Melichev

Fix (clist) : Skip writing unuseful data with linear color triangle.


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.


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.


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.


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.


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.

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.


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


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.


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.


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.


2008-07-23T21:55:21.014656Z Igor Melichev

Fix (graphics) : Write tile id into a pattern clist (continued).


Bug 689818 "Regression: Test file imagemask-with-pattern.ps fails with banding and pbmraw ".

The last patch appears incomplete, now fifing it.


2008-07-22T21:03:07.709088Z Ray Johnston

Turn off the NOISY 'VERBOSE' setting by default.


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.


2008-07-22T14:23:25.922113Z Ken Sharp

Fix (pdfwrite): limit checking of CIDfonts for 'fixed width' property.

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.


2008-07-22T06:24:14.072316Z Igor Melichev

Fix (graphics) : Write tile id into a pattern clist.


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.


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

[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.


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.


While the pdf14_trans_buffer_size was small enough, the mem_space calculation
would wrap around.


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.


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.


Russell Lang reports this caused problems originally, but it seems to 
work now, so reverting the behaviour per his request.


2008-07-16T17:19:29.238633Z Igor Melichev

Fix (transparency) : A mask buffer could left unreleased due to banding.


Bug 689944 "Reference to free object".

See comment in code. 


2008-07-16T15:00:17.682927Z Alex Cherepanov

Ignore out-of-range UniqueID in embedded Type 1 PDF fonts. Bug 689973.


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.


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.


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


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.


2008-07-11T23:10:56.624279Z Ralph Giles

Restore the 2_fracs image class to the psl2lib device.

It was inadvertently removed in r8828.


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.


2008-07-11T21:10:49.148153Z Ralph Giles

Merge clusterpush changes from the ghostpcl tree.


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.


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.


2008-07-10T23:36:00.202299Z Ralph Giles

Add the so build directories to the clusterpush exclude list.


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.


2008-07-10T17:00:39.840394Z Ralph Giles

Documentation update: we support Separation, DeviceN and a number of PDF 1.7 features.


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.


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.


2008-07-07T13:43:38.233194Z Ken Sharp

Fix warnings from the JPX decoder when using Visual Studio 9.

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


2008-07-07T08:56:59.749169Z Ken Sharp

Fix (pdfwrite): Images ina DeviceN space with more than 60 inks caused a crash.

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.


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.


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.


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

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.


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.


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

Check for this event and return an error instead.


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.


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.


2008-07-01T10:22:25.835951Z Igor Melichev

Fix (clist writer) : The maximal compositor command size was wrong.


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.


2008-06-30T18:15:51.663545Z Ralph Giles

Add a missing header dependency.


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.


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.


2008-06-24T14:16:29.258940Z Igor Melichev

Fix (graphics) : Clean image enumerator before releasing it.


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.


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.


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.  


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.  


2008-06-09T23:02:50.347013Z Ralph Giles

Add a modified version of the clusterpush script from the ghostpcl tree.


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.


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.


2008-05-31T00:57:34.917939Z Alex Cherepanov

Add work-around for PDF files that misspell 'endobj' as 'endjobj'. Bug 689876.


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.


2008-05-28T21:52:03.844656Z Igor Melichev

Fix (True Type font loader) : Work around incorrect numGlyphs (continued).


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.
which may need further adjustments.


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.


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.  


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.


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


2008-05-25T07:28:53.119264Z Igor Melichev

Fix : MSVC warnings.


Removed an extra debug printing that prints an unutialized variable.


2008-05-25T07:23:38.027951Z Igor Melichev

Fix (True Type font loader) : Work around incorrect numGlyphs.


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.

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.


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.

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.


2008-05-22T18:06:22.983939Z Igor Melichev

Enhancement (graphics) : Delay applying type 1 raster patterns until clist interpretation (continued 4).


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

[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).


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


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.


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_*

[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


2008-05-21T18:27:42.905572Z Michael Vrhel

Fix for 689811.  Enables custom color callback when banding of images is occurs.

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.


2008-05-21T13:42:08.542151Z Igor Melichev

Fix (Type 1 hinter) : The missed flex hewristic malfunctioned.


Bug 689821 "SegFault in gxhintn.c".

The old code is buggy with a wrong index advance along a cyclic buffer range.


2008-05-21T10:12:14.199391Z Igor Melichev

Enhancement (graphics) : Delay applying type 1 raster patterns until clist interpretation (continued 2).


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.


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.


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.


2008-05-21T01:37:08.729158Z Ralph Giles

Fix the autoconf build when libcairo isn't available.

The device properly disabled in r8752.


2008-05-21T01:26:49.215021Z Ralph Giles

Set properties on the new cairo device source file.


2008-05-21T01:24:45.439819Z Ralph Giles

Whitespace cleanup. Also comment out the warning about setlogop; this
isn't important for most documents.


2008-05-21T01:24:44.147836Z Ralph Giles

Don't compare a NULL extension string.


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.


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.


2008-05-21T01:24:40.923940Z Ralph Giles

Protect the use of pkg-config for libcairo.


2008-05-21T01:24:38.762206Z Ralph Giles

New 'cairo' output device using the libcairo graphics library.
Patch by Behdad Esfahbod.


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.

The rationale behind this decision is that the index is, probably,
not used when it is malformed but the file survives in the wild.


2008-05-19T14:47:52.443966Z Igor Melichev

Enhancement (graphics) : Delay applying type 1 raster patterns until clist interpretation (continued).


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 .


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.


2008-05-16T23:34:14.372367Z Ralph Giles

Add support for linecap/join and miterlimit.


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.


2008-05-16T00:05:41.073469Z Ralph Giles

Correct stroke and fill attribute overrides based on the path type.

Also includes some whitespace cleanup.


2008-05-16T00:05:40.066267Z Ralph Giles

Store clipping rectangles as a clip path and ignore other non-drawing


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.


2008-05-15T21:24:12.705572Z Ralph Giles

Return proper negative error codes on allocation failure.

Also some minor formatting.


2008-05-15T21:24:11.342484Z Ralph Giles

Be explicit about clearing the current fill or stroke color when
none is set.


2008-05-15T16:17:48.102316Z Michael Vrhel

Fix for previous commit.  I had the wrong version number test in the define.


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


2008-05-15T00:00:24.616940Z Marcos H. Woehrmann

Improve white-on-mask drawing mode.


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


2008-05-14T23:49:09.954483Z Marcos H. Woehrmann

Add support to pxlcolor and pxlmono for 24 bpp images.


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.


2008-05-13T19:52:08.912983Z Ralph Giles

Fix an incorrect curveto coordinate.


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.


2008-05-13T18:47:23.279847Z Ralph Giles

Support setting stroke and fill colors.


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.

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


2008-05-10T22:02:03.546959Z Alex Cherepanov

Ignore OutputIntent attribute if it is not an array; recover a broken PDF file.
Bug 689831.


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.


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.


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.


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.


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).


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.


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.


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.


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.


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.


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).


2008-05-07T09:15:27.593615Z Igor Melichev

Fix (graphics) : Imprecise pattern phase with negative cell origins (continued).


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.


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.


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.


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.


2008-05-02T20:13:50.255816Z Igor Melichev

Fix (graphics) : Imprecise pattern phase with negative cell origins.


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
  { gsave
    0 12 moveto
    { 144 rotate
      0 12 lineto
    } repeat
  { begin
    1 0 0 setrgbcolor
    15 15 translate
    0 0 1 setrgbcolor
    30 30 translate
    0 1 0 setrgbcolor
    -30 0 translate
    30 -30 translate
[1 0 0 1 0 0]
/Star4 exch def

/Pattern setcolorspace
Star4 setcolor

clippath pathbbox 
exch pop 30 exch
4 copy = = = =


The old code gives different rasters for this test while banded and unbanded rendering.


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.


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.


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.


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.


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.


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.

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.


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.


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.


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.



2008-04-20T04:51:21.386273Z Alex Cherepanov

Skip bogus endobj operators inside the object stream.
Bug 689795, customer 870.



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.


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[':'])


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.


2008-04-19T04:49:20.031557Z Alex Cherepanov

Add recognition of abbreviated filter names to the PDF inflation utility.


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.

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.


2008-04-17T17:31:57.458743Z Ralph Giles

Allow the ENABLE_CUSTOM_COLOR_CALLBACK preprocessor macro to be set
from the compiler command line.


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.

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.


2008-04-14T22:57:22.422088Z Michael Vrhel

Fixed Colorspace enumeration order for debug printing.


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.


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.

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.


2008-04-10T05:43:43.466565Z Igor Melichev

Enhancement (graphics) : Generalize prototypes of color serialization methods for big color data.


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.

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.


2008-04-08T21:55:08.170308Z Ralph Giles

We no longer have any outstanding port requests. Bug 689745.


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.


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.


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.

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.

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.

(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.


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.


2008-04-04T01:02:16.013247Z Ralph Giles

Include stdlib.h for malloc and free in the rinkj device. Bug 689780.


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.


2008-03-31T23:53:28.505732Z Ralph Giles

Don't override the memory pointer set by the client when initializing 
the luratech jpx decoder.


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.


2008-03-31T23:00:55.454967Z Igor Melichev

Fix (graphics) : Stroke width was wrong for short segments.


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.


2008-03-28T16:30:25.778081Z Igor Melichev

Fix (graphics) : rectfill applied a wrong path adjustment.


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.


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.


2008-03-27T08:37:58.577822Z Ken Sharp

Fix (pdfwrite): endstream/endobj not always emitted PDF/A compliant.

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). 

(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.

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.


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.


2008-03-24T20:02:07.895385Z Igor Melichev

Fix (clist writer) : Smaller tiles for strip_copy_rop (continued).


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.


2008-03-23T07:50:43.652322Z Igor Melichev

Fix (vector device): %pipe% IO device being opened as seekable (continued).


Revision 8602 caused an MSVC warning, which is now fixed.


2008-03-22T21:55:00.988313Z Igor Melichev

Fix (clist writer) : Smaller tiles for strip_copy_rop.


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.


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.

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.

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.


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.

PS interpreter seems to fall into an infinite loop running charpath when
the font is composite and the curent device is nulldevice.


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.


Patch from Alex mentioned in the bug 689731 and unrelated to that bug.


2008-03-12T22:32:03.336468Z Igor Melichev

Fix (graphics) : Optimize filling a path with a shading color (continuewd 3).


Bug 689748 "gs segfaults".

An unitialized variable since rev 8510.
We had no test files for that branch, now got one.


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.


2008-03-09T13:34:51.534239Z Igor Melichev

Fix (transparency) : Transparency compositor device recreation was incorrect.


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.


2008-03-07T13:39:35.783627Z Igor Melichev

Fix (bbox device) : box_fill_path needs as path for shfill.


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.


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.


2008-03-05T23:35:50.165171Z Igor Melichev

Fix (clist) : Some transparency compositor commands don't need CTM.


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.


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.


2008-03-03T20:16:06.744980Z Igor Melichev

Fix (images) : Revert an unintentional change to siscale.c .


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.


2008-03-03T16:01:12.306842Z Igor Melichev

Fix (clist) : Crop transparencsy commands while clist writing, step 3.


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.


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.


Removing non-ascii chars that was not detected by MSVC.


2008-03-03T10:13:01.196997Z Igor Melichev

Fix (clist) : Crop transparencsy commands while clist writing, step 1a.


The last commitment is incomplete, now fixing.


2008-03-03T10:11:27.428498Z Igor Melichev

Fix (clist) : Crop transparencsy commands while clist writing, step 1.


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.


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).


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.


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.


2008-03-01T10:18:20.389016Z Ken Sharp

Fix (pdfwrite): problems with type 3 fonts executing 'show'.

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

(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'.

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.


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]