[gs-commits] rev 11833 - in branches/chrisl-test-gs: . Resource/Init base contrib cups doc freetype freetype/builds/unix freetype/builds/win32/vc2005 freetype/builds/win32/vc2008 freetype/builds/win32/visualc freetype/builds/win32/visualce freetype/builds/wince/vc2005-ce freetype/builds/wince/vc2008-ce freetype/devel freetype/docs freetype/docs/reference freetype/include/freetype freetype/include/freetype/config freetype/include/freetype/internal freetype/src/autofit freetype/src/base freetype/src/cache freetype/src/cff freetype/src/cid freetype/src/pshinter freetype/src/raster freetype/src/sfnt freetype/src/smooth freetype/src/truetype freetype/src/type42 freetype/src/winfonts jbig2dec lib man psi toolbin/localcluster toolbin/tests

chrisl at ghostscript.com chrisl at ghostscript.com
Thu Oct 21 09:20:24 UTC 2010


Author: chrisl
Date: 2010-10-21 09:19:31 +0000 (Thu, 21 Oct 2010)
New Revision: 11833

Added:
   branches/chrisl-test-gs/base/png.mak
   branches/chrisl-test-gs/base/tiff.mak
   branches/chrisl-test-gs/base/valgrind.h
   branches/chrisl-test-gs/base/whitelst.c
   branches/chrisl-test-gs/base/whitelst.h
   branches/chrisl-test-gs/doc/Details9.htm
   branches/chrisl-test-gs/doc/History9.htm
Removed:
   branches/chrisl-test-gs/base/bcwin32.mak
   branches/chrisl-test-gs/base/gdevcairo.c
   branches/chrisl-test-gs/base/gp_iwatc.c
   branches/chrisl-test-gs/base/libpng.mak
   branches/chrisl-test-gs/base/libtiff.mak
   branches/chrisl-test-gs/base/watclib.mak
   branches/chrisl-test-gs/base/watcw32.mak
   branches/chrisl-test-gs/base/wccommon.mak
   branches/chrisl-test-gs/base/wctail.mak
Modified:
   branches/chrisl-test-gs/
   branches/chrisl-test-gs/Resource/Init/gs_cff.ps
   branches/chrisl-test-gs/Resource/Init/gs_fntem.ps
   branches/chrisl-test-gs/Resource/Init/gs_init.ps
   branches/chrisl-test-gs/Resource/Init/gs_lev2.ps
   branches/chrisl-test-gs/Resource/Init/gs_res.ps
   branches/chrisl-test-gs/Resource/Init/gs_ttf.ps
   branches/chrisl-test-gs/Resource/Init/opdfread.ps
   branches/chrisl-test-gs/Resource/Init/pdf_draw.ps
   branches/chrisl-test-gs/Resource/Init/pdf_font.ps
   branches/chrisl-test-gs/Resource/Init/pdf_main.ps
   branches/chrisl-test-gs/Resource/Init/pdf_ops.ps
   branches/chrisl-test-gs/Resource/Init/pdf_rbld.ps
   branches/chrisl-test-gs/Resource/Init/pdf_sec.ps
   branches/chrisl-test-gs/base/Makefile.in
   branches/chrisl-test-gs/base/configure.ac
   branches/chrisl-test-gs/base/devs.mak
   branches/chrisl-test-gs/base/gdevbbox.c
   branches/chrisl-test-gs/base/gdevbit.c
   branches/chrisl-test-gs/base/gdevdbit.c
   branches/chrisl-test-gs/base/gdevddrw.c
   branches/chrisl-test-gs/base/gdevimgn.c
   branches/chrisl-test-gs/base/gdevmem.c
   branches/chrisl-test-gs/base/gdevnfwd.c
   branches/chrisl-test-gs/base/gdevp14.c
   branches/chrisl-test-gs/base/gdevp14.h
   branches/chrisl-test-gs/base/gdevpdf.c
   branches/chrisl-test-gs/base/gdevpdfb.c
   branches/chrisl-test-gs/base/gdevpdfb.h
   branches/chrisl-test-gs/base/gdevpdfc.c
   branches/chrisl-test-gs/base/gdevpdfd.c
   branches/chrisl-test-gs/base/gdevpdfe.c
   branches/chrisl-test-gs/base/gdevpdfg.c
   branches/chrisl-test-gs/base/gdevpdfi.c
   branches/chrisl-test-gs/base/gdevpdfj.c
   branches/chrisl-test-gs/base/gdevpdfk.c
   branches/chrisl-test-gs/base/gdevpdfm.c
   branches/chrisl-test-gs/base/gdevpdfo.c
   branches/chrisl-test-gs/base/gdevpdfo.h
   branches/chrisl-test-gs/base/gdevpdfp.c
   branches/chrisl-test-gs/base/gdevpdft.c
   branches/chrisl-test-gs/base/gdevpdfu.c
   branches/chrisl-test-gs/base/gdevpdfv.c
   branches/chrisl-test-gs/base/gdevpdfx.h
   branches/chrisl-test-gs/base/gdevpdtb.c
   branches/chrisl-test-gs/base/gdevpdtc.c
   branches/chrisl-test-gs/base/gdevpdtd.c
   branches/chrisl-test-gs/base/gdevpdte.c
   branches/chrisl-test-gs/base/gdevpdtf.c
   branches/chrisl-test-gs/base/gdevpdtf.h
   branches/chrisl-test-gs/base/gdevpdti.c
   branches/chrisl-test-gs/base/gdevpdtt.c
   branches/chrisl-test-gs/base/gdevprn.c
   branches/chrisl-test-gs/base/gdevpsdi.c
   branches/chrisl-test-gs/base/gdevrinkj.c
   branches/chrisl-test-gs/base/gdevtfax.c
   branches/chrisl-test-gs/base/gdevtfnx.c
   branches/chrisl-test-gs/base/gdevtifs.c
   branches/chrisl-test-gs/base/gdevtifs.h
   branches/chrisl-test-gs/base/gdevtsep.c
   branches/chrisl-test-gs/base/gdevxcmp.c
   branches/chrisl-test-gs/base/gdevxini.c
   branches/chrisl-test-gs/base/gdevxxf.c
   branches/chrisl-test-gs/base/gp_upapr.c
   branches/chrisl-test-gs/base/gsbitops.c
   branches/chrisl-test-gs/base/gsbitops.h
   branches/chrisl-test-gs/base/gscdevn.c
   branches/chrisl-test-gs/base/gscicach.c
   branches/chrisl-test-gs/base/gsciemap.c
   branches/chrisl-test-gs/base/gscms.h
   branches/chrisl-test-gs/base/gscolor2.c
   branches/chrisl-test-gs/base/gscpixel.c
   branches/chrisl-test-gs/base/gscsepr.c
   branches/chrisl-test-gs/base/gscspace.c
   branches/chrisl-test-gs/base/gsdevice.c
   branches/chrisl-test-gs/base/gsdparam.c
   branches/chrisl-test-gs/base/gsdps1.c
   branches/chrisl-test-gs/base/gsequivc.c
   branches/chrisl-test-gs/base/gsicc.c
   branches/chrisl-test-gs/base/gsicc_cache.c
   branches/chrisl-test-gs/base/gsicc_cache.h
   branches/chrisl-test-gs/base/gsicc_create.c
   branches/chrisl-test-gs/base/gsicc_manage.c
   branches/chrisl-test-gs/base/gsimage.c
   branches/chrisl-test-gs/base/gsiodisk.c
   branches/chrisl-test-gs/base/gsmdebug.h
   branches/chrisl-test-gs/base/gsovrc.c
   branches/chrisl-test-gs/base/gsovrc.h
   branches/chrisl-test-gs/base/gspaint.c
   branches/chrisl-test-gs/base/gsptype1.c
   branches/chrisl-test-gs/base/gsptype1.h
   branches/chrisl-test-gs/base/gsropt.h
   branches/chrisl-test-gs/base/gsstate.c
   branches/chrisl-test-gs/base/gstext.c
   branches/chrisl-test-gs/base/gstrans.c
   branches/chrisl-test-gs/base/gstype42.c
   branches/chrisl-test-gs/base/gsutil.c
   branches/chrisl-test-gs/base/gsutil.h
   branches/chrisl-test-gs/base/gxblend.c
   branches/chrisl-test-gs/base/gxblend.h
   branches/chrisl-test-gs/base/gxblend1.c
   branches/chrisl-test-gs/base/gxccman.c
   branches/chrisl-test-gs/base/gxchar.c
   branches/chrisl-test-gs/base/gxclbits.c
   branches/chrisl-test-gs/base/gxclimag.c
   branches/chrisl-test-gs/base/gxclip.c
   branches/chrisl-test-gs/base/gxclist.c
   branches/chrisl-test-gs/base/gxclist.h
   branches/chrisl-test-gs/base/gxclrast.c
   branches/chrisl-test-gs/base/gxcmap.c
   branches/chrisl-test-gs/base/gxcolor2.h
   branches/chrisl-test-gs/base/gxcspace.h
   branches/chrisl-test-gs/base/gxdevcli.h
   branches/chrisl-test-gs/base/gxdevice.h
   branches/chrisl-test-gs/base/gxfcopy.c
   branches/chrisl-test-gs/base/gxfont1.h
   branches/chrisl-test-gs/base/gxi12bit.c
   branches/chrisl-test-gs/base/gxi16bit.c
   branches/chrisl-test-gs/base/gxicolor.c
   branches/chrisl-test-gs/base/gximag3x.c
   branches/chrisl-test-gs/base/gximage.h
   branches/chrisl-test-gs/base/gximono.c
   branches/chrisl-test-gs/base/gxiscale.c
   branches/chrisl-test-gs/base/gxp1fill.c
   branches/chrisl-test-gs/base/gxp1impl.h
   branches/chrisl-test-gs/base/gxpcmap.c
   branches/chrisl-test-gs/base/gxpcolor.h
   branches/chrisl-test-gs/base/gxshade.c
   branches/chrisl-test-gs/base/gxtype1.c
   branches/chrisl-test-gs/base/lib.mak
   branches/chrisl-test-gs/base/macos-mcp.mak
   branches/chrisl-test-gs/base/macosx.mak
   branches/chrisl-test-gs/base/mkromfs.c
   branches/chrisl-test-gs/base/msvclib.mak
   branches/chrisl-test-gs/base/openvms.mak
   branches/chrisl-test-gs/base/openvms.mmk
   branches/chrisl-test-gs/base/siscale.c
   branches/chrisl-test-gs/base/sjpx.c
   branches/chrisl-test-gs/base/sjpx.h
   branches/chrisl-test-gs/base/sjpx_luratech.c
   branches/chrisl-test-gs/base/stdint_.h
   branches/chrisl-test-gs/base/strmio.h
   branches/chrisl-test-gs/base/time_.h
   branches/chrisl-test-gs/base/ugcclib.mak
   branches/chrisl-test-gs/base/unix-gcc.mak
   branches/chrisl-test-gs/base/unixansi.mak
   branches/chrisl-test-gs/base/unixinst.mak
   branches/chrisl-test-gs/base/version.mak
   branches/chrisl-test-gs/base/winlib.mak
   branches/chrisl-test-gs/contrib/gdevbjc_.h
   branches/chrisl-test-gs/cups/gdevcups.c
   branches/chrisl-test-gs/cups/pstoraster.in
   branches/chrisl-test-gs/doc/
   branches/chrisl-test-gs/doc/API.htm
   branches/chrisl-test-gs/doc/AUTHORS
   branches/chrisl-test-gs/doc/C-style.htm
   branches/chrisl-test-gs/doc/Changes.htm
   branches/chrisl-test-gs/doc/Commprod.htm
   branches/chrisl-test-gs/doc/DLL.htm
   branches/chrisl-test-gs/doc/Deprecated.htm
   branches/chrisl-test-gs/doc/Details.htm
   branches/chrisl-test-gs/doc/Details8.htm
   branches/chrisl-test-gs/doc/Develop.htm
   branches/chrisl-test-gs/doc/Devices.htm
   branches/chrisl-test-gs/doc/Drivers.htm
   branches/chrisl-test-gs/doc/Fonts.htm
   branches/chrisl-test-gs/doc/Helpers.htm
   branches/chrisl-test-gs/doc/History1.htm
   branches/chrisl-test-gs/doc/History2.htm
   branches/chrisl-test-gs/doc/History3.htm
   branches/chrisl-test-gs/doc/History4.htm
   branches/chrisl-test-gs/doc/History5.htm
   branches/chrisl-test-gs/doc/History6.htm
   branches/chrisl-test-gs/doc/History7.htm
   branches/chrisl-test-gs/doc/History8.htm
   branches/chrisl-test-gs/doc/Install.htm
   branches/chrisl-test-gs/doc/Issues.htm
   branches/chrisl-test-gs/doc/Language.htm
   branches/chrisl-test-gs/doc/Lib.htm
   branches/chrisl-test-gs/doc/Make.htm
   branches/chrisl-test-gs/doc/News.htm
   branches/chrisl-test-gs/doc/Projects.htm
   branches/chrisl-test-gs/doc/Ps-style.htm
   branches/chrisl-test-gs/doc/Ps2epsi.htm
   branches/chrisl-test-gs/doc/Ps2pdf.htm
   branches/chrisl-test-gs/doc/Ps2ps2.htm
   branches/chrisl-test-gs/doc/Psfiles.htm
   branches/chrisl-test-gs/doc/Readme.htm
   branches/chrisl-test-gs/doc/Release.htm
   branches/chrisl-test-gs/doc/Source.htm
   branches/chrisl-test-gs/doc/Unix-lpr.htm
   branches/chrisl-test-gs/doc/Use.htm
   branches/chrisl-test-gs/doc/Xfonts.htm
   branches/chrisl-test-gs/doc/gs-vms.hlp
   branches/chrisl-test-gs/freetype/ChangeLog
   branches/chrisl-test-gs/freetype/ChangeLog.23
   branches/chrisl-test-gs/freetype/Jamfile
   branches/chrisl-test-gs/freetype/README
   branches/chrisl-test-gs/freetype/builds/unix/config.guess
   branches/chrisl-test-gs/freetype/builds/unix/config.sub
   branches/chrisl-test-gs/freetype/builds/unix/configure
   branches/chrisl-test-gs/freetype/builds/unix/configure.ac
   branches/chrisl-test-gs/freetype/builds/unix/configure.raw
   branches/chrisl-test-gs/freetype/builds/unix/ftconfig.in
   branches/chrisl-test-gs/freetype/builds/unix/unix-cc.in
   branches/chrisl-test-gs/freetype/builds/win32/vc2005/freetype.vcproj
   branches/chrisl-test-gs/freetype/builds/win32/vc2005/index.html
   branches/chrisl-test-gs/freetype/builds/win32/vc2008/freetype.vcproj
   branches/chrisl-test-gs/freetype/builds/win32/vc2008/index.html
   branches/chrisl-test-gs/freetype/builds/win32/visualc/freetype.dsp
   branches/chrisl-test-gs/freetype/builds/win32/visualc/freetype.vcproj
   branches/chrisl-test-gs/freetype/builds/win32/visualc/index.html
   branches/chrisl-test-gs/freetype/builds/win32/visualce/freetype.dsp
   branches/chrisl-test-gs/freetype/builds/win32/visualce/freetype.vcproj
   branches/chrisl-test-gs/freetype/builds/win32/visualce/index.html
   branches/chrisl-test-gs/freetype/builds/wince/vc2005-ce/freetype.vcproj
   branches/chrisl-test-gs/freetype/builds/wince/vc2005-ce/index.html
   branches/chrisl-test-gs/freetype/builds/wince/vc2008-ce/freetype.vcproj
   branches/chrisl-test-gs/freetype/builds/wince/vc2008-ce/index.html
   branches/chrisl-test-gs/freetype/configure
   branches/chrisl-test-gs/freetype/devel/ftoption.h
   branches/chrisl-test-gs/freetype/docs/CHANGES
   branches/chrisl-test-gs/freetype/docs/VERSION.DLL
   branches/chrisl-test-gs/freetype/docs/reference/ft2-base_interface.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-basic_types.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-bdf_fonts.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-bitmap_handling.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-cache_subsystem.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-cid_fonts.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-computations.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-font_formats.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-gasp_table.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-glyph_management.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-glyph_stroker.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-glyph_variants.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-gx_validation.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-gzip.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-header_file_macros.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-incremental.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-index.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-lcd_filtering.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-list_processing.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-lzw.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-mac_specific.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-module_management.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-multiple_masters.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-ot_validation.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-outline_processing.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-pfr_fonts.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-quick_advance.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-raster.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-sfnt_names.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-sizes_management.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-system_interface.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-toc.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-truetype_engine.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-truetype_tables.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-type1_tables.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-user_allocation.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-version.html
   branches/chrisl-test-gs/freetype/docs/reference/ft2-winfnt_fonts.html
   branches/chrisl-test-gs/freetype/include/freetype/config/ftconfig.h
   branches/chrisl-test-gs/freetype/include/freetype/freetype.h
   branches/chrisl-test-gs/freetype/include/freetype/ftcache.h
   branches/chrisl-test-gs/freetype/include/freetype/ftimage.h
   branches/chrisl-test-gs/freetype/include/freetype/ftlcdfil.h
   branches/chrisl-test-gs/freetype/include/freetype/ftmodapi.h
   branches/chrisl-test-gs/freetype/include/freetype/internal/ftobjs.h
   branches/chrisl-test-gs/freetype/src/autofit/aflatin.c
   branches/chrisl-test-gs/freetype/src/base/ftobjs.c
   branches/chrisl-test-gs/freetype/src/base/ftstream.c
   branches/chrisl-test-gs/freetype/src/base/ftsynth.c
   branches/chrisl-test-gs/freetype/src/cache/ftccache.c
   branches/chrisl-test-gs/freetype/src/cache/ftcsbits.c
   branches/chrisl-test-gs/freetype/src/cff/cffgload.c
   branches/chrisl-test-gs/freetype/src/cff/cffload.c
   branches/chrisl-test-gs/freetype/src/cff/cffobjs.c
   branches/chrisl-test-gs/freetype/src/cid/cidgload.c
   branches/chrisl-test-gs/freetype/src/pshinter/pshalgo.c
   branches/chrisl-test-gs/freetype/src/raster/ftraster.c
   branches/chrisl-test-gs/freetype/src/sfnt/ttload.c
   branches/chrisl-test-gs/freetype/src/sfnt/ttpost.c
   branches/chrisl-test-gs/freetype/src/smooth/ftgrays.c
   branches/chrisl-test-gs/freetype/src/smooth/ftsmooth.c
   branches/chrisl-test-gs/freetype/src/truetype/ttgload.c
   branches/chrisl-test-gs/freetype/src/truetype/ttinterp.c
   branches/chrisl-test-gs/freetype/src/truetype/ttinterp.h
   branches/chrisl-test-gs/freetype/src/truetype/ttobjs.c
   branches/chrisl-test-gs/freetype/src/truetype/ttpload.c
   branches/chrisl-test-gs/freetype/src/type42/t42parse.c
   branches/chrisl-test-gs/freetype/src/winfonts/winfnt.c
   branches/chrisl-test-gs/ghostscript.vcproj
   branches/chrisl-test-gs/jbig2dec/jbig2_page.c
   branches/chrisl-test-gs/jbig2dec/os_types.h
   branches/chrisl-test-gs/lib/bdftops.bat
   branches/chrisl-test-gs/lib/dumphint.bat
   branches/chrisl-test-gs/lib/eps2eps.bat
   branches/chrisl-test-gs/lib/font2c.bat
   branches/chrisl-test-gs/lib/gsbj.bat
   branches/chrisl-test-gs/lib/gsdj.bat
   branches/chrisl-test-gs/lib/gsdj500.bat
   branches/chrisl-test-gs/lib/gslj.bat
   branches/chrisl-test-gs/lib/gslp.bat
   branches/chrisl-test-gs/lib/gsnd.bat
   branches/chrisl-test-gs/lib/gsndt.bat
   branches/chrisl-test-gs/lib/gst.bat
   branches/chrisl-test-gs/lib/gstt.bat
   branches/chrisl-test-gs/lib/lpgs.bat
   branches/chrisl-test-gs/lib/lpr2.bat
   branches/chrisl-test-gs/lib/pdf2dsc.bat
   branches/chrisl-test-gs/lib/pdf2ps.bat
   branches/chrisl-test-gs/lib/pdfopt.bat
   branches/chrisl-test-gs/lib/pf2afm.bat
   branches/chrisl-test-gs/lib/pfbtopfa.bat
   branches/chrisl-test-gs/lib/pftogsf.bat
   branches/chrisl-test-gs/lib/ps2ascii.bat
   branches/chrisl-test-gs/lib/ps2epsi.bat
   branches/chrisl-test-gs/lib/ps2pdf.bat
   branches/chrisl-test-gs/lib/ps2pdf12.bat
   branches/chrisl-test-gs/lib/ps2pdf13.bat
   branches/chrisl-test-gs/lib/ps2pdf14.bat
   branches/chrisl-test-gs/lib/ps2pdfxx.bat
   branches/chrisl-test-gs/lib/ps2ps.bat
   branches/chrisl-test-gs/lib/ps2ps2.bat
   branches/chrisl-test-gs/lib/viewrgb.ps
   branches/chrisl-test-gs/man/dvipdf.1
   branches/chrisl-test-gs/man/font2c.1
   branches/chrisl-test-gs/man/gs.1
   branches/chrisl-test-gs/man/gslp.1
   branches/chrisl-test-gs/man/gsnd.1
   branches/chrisl-test-gs/man/pdf2dsc.1
   branches/chrisl-test-gs/man/pdf2ps.1
   branches/chrisl-test-gs/man/pdfopt.1
   branches/chrisl-test-gs/man/pf2afm.1
   branches/chrisl-test-gs/man/pfbtopfa.1
   branches/chrisl-test-gs/man/printafm.1
   branches/chrisl-test-gs/man/ps2ascii.1
   branches/chrisl-test-gs/man/ps2epsi.1
   branches/chrisl-test-gs/man/ps2pdf.1
   branches/chrisl-test-gs/man/ps2pdfwr.1
   branches/chrisl-test-gs/man/ps2ps.1
   branches/chrisl-test-gs/man/wftopfa.1
   branches/chrisl-test-gs/psi/dmmain.c
   branches/chrisl-test-gs/psi/dmmain.r
   branches/chrisl-test-gs/psi/dxmain.c
   branches/chrisl-test-gs/psi/dxmainc.c
   branches/chrisl-test-gs/psi/fapi_ft.c
   branches/chrisl-test-gs/psi/fapibstm.c
   branches/chrisl-test-gs/psi/fapiufst.c
   branches/chrisl-test-gs/psi/ifapi.h
   branches/chrisl-test-gs/psi/iname.c
   branches/chrisl-test-gs/psi/int.mak
   branches/chrisl-test-gs/psi/mkfilelt.cpp
   branches/chrisl-test-gs/psi/msvc32.mak
   branches/chrisl-test-gs/psi/os2.mak
   branches/chrisl-test-gs/psi/psromfs.mak
   branches/chrisl-test-gs/psi/zchar42.c
   branches/chrisl-test-gs/psi/zcolor.c
   branches/chrisl-test-gs/psi/zdevice.c
   branches/chrisl-test-gs/psi/zfapi.c
   branches/chrisl-test-gs/psi/zfjpx.c
   branches/chrisl-test-gs/psi/zfont1.c
   branches/chrisl-test-gs/psi/zfont2.c
   branches/chrisl-test-gs/psi/zfrsd.c
   branches/chrisl-test-gs/psi/zimage.c
   branches/chrisl-test-gs/psi/zpcolor.c
   branches/chrisl-test-gs/psi/zusparam.c
   branches/chrisl-test-gs/toolbin/localcluster/build.pl
   branches/chrisl-test-gs/toolbin/localcluster/clustermaster.pl
   branches/chrisl-test-gs/toolbin/localcluster/clustermonitor.pl
   branches/chrisl-test-gs/toolbin/localcluster/compare.pl
   branches/chrisl-test-gs/toolbin/localcluster/readlog.pl
   branches/chrisl-test-gs/toolbin/localcluster/readme
   branches/chrisl-test-gs/toolbin/localcluster/run.pl
   branches/chrisl-test-gs/toolbin/tests/check_dirs.py
Log:
Bring my test branch up to date with trunk.



Property changes on: branches/chrisl-test-gs
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gs_2_colors:10650-10937
/branches/gs_extendgraphic:10114-10199
/branches/smask_work:9134-9665
/trunk/gs:9406-9673,10203-10422,11160-11285,11288-11303,11533-11535
   + /branches/gs_2_colors:10650-10937
/branches/gs_extendgraphic:10114-10199
/branches/smask_work:9134-9665
/tags/ghostscript-9.00:11638-11654
/trunk/gs:11533-11832

Modified: branches/chrisl-test-gs/Resource/Init/gs_cff.ps
===================================================================
--- branches/chrisl-test-gs/Resource/Init/gs_cff.ps	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/Resource/Init/gs_cff.ps	2010-10-21 09:19:31 UTC (rev 11833)
@@ -734,6 +734,7 @@
   /DEBUG CFFDEBUG def	% bring the binding closer
   /StringCache 1 dict def % Private DICT may be reused.
 
+systemdict /OLDCFF known {
 	% Read the header.
 
   /f cff def
@@ -758,6 +759,7 @@
   /offsets 50 dict def
   /queued [] def
   /opdict null def		% reserve a slot
+
   /fonts [ topdicts {
     0 () /SubFileDecode filter /f exch def
     40 dict begin
@@ -817,7 +819,6 @@
     } ifelse
     end
   } forall
-
 	% Wrap up.
 
   resname mark 0 1 fonts length 1 sub {
@@ -836,6 +837,27 @@
       1 index exch definefont
     } ifelse
   } for .dicttomark
+
+} {
+  forcecidfont
+  [ { cff 1024 string readstring not { exit } if } loop ]
+  .parsecff /fonts exch def
+
+  resname
+  mark fonts {
+    forceresname { exch pop resname exch } if
+    dup /CIDFontType known { % This is a CIDFont.
+      dup /CIDFontName 3 index put
+      1 index exch /CIDFont defineresource
+    } {      	             % This is a font.
+      dup /FontName 3 index put
+      dup /FontType 2 put
+      1 index exch
+      definefont
+    } ifelse
+  } forall .dicttomark
+} ifelse
+
   end		% temporary dict
   end		% FontSetInit ProcSet
   /FontSet defineresource

Modified: branches/chrisl-test-gs/Resource/Init/gs_fntem.ps
===================================================================
--- branches/chrisl-test-gs/Resource/Init/gs_fntem.ps	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/Resource/Init/gs_fntem.ps	2010-10-21 09:19:31 UTC (rev 11833)
@@ -318,10 +318,15 @@
     } {
       dup //encodingnames
       exch .knownget {
-        exch pop
-        /Decoding findresource 1 index exch /Decoding exch put
-      } {
-        % unknown encoding, convert it to decoding :
+        { /Decoding findresource } stopped {pop pop true}{ exch pop 1 index exch /Decoding exch put false } ifelse
+      }
+      {
+          true
+      } ifelse 
+
+      {
+        % unknown encoding, or an encoding for which we don't have a
+        % predefined decoding, convert it to decoding :
         dup length dict begin
         /.notdef 0 def
         0 1 currentdict length 1 sub
@@ -335,8 +340,8 @@
         pop
         currentdict end
         1 index exch /Decoding exch put
+      } if
       } ifelse
-    } ifelse
     exit
   } loop
   dup /CIDFontType known {

Modified: branches/chrisl-test-gs/Resource/Init/gs_init.ps
===================================================================
--- branches/chrisl-test-gs/Resource/Init/gs_init.ps	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/Resource/Init/gs_init.ps	2010-10-21 09:19:31 UTC (rev 11833)
@@ -30,7 +30,7 @@
 % Interpreter library version number
 % NOTE: the interpreter code requires that the first non-comment token
 % in this file be an integer, and that it match the compiled-in version!
-900
+901
 
 % Check the interpreter revision.
 dup revision ne

Modified: branches/chrisl-test-gs/Resource/Init/gs_lev2.ps
===================================================================
--- branches/chrisl-test-gs/Resource/Init/gs_lev2.ps	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/Resource/Init/gs_lev2.ps	2010-10-21 09:19:31 UTC (rev 11833)
@@ -900,6 +900,16 @@
   .dicttomark 
 ] def
 
+% Special type to install
+% sGray ICC profile color space
+/CIEsGRAYICC [ /ICCBased
+  mark
+    /N 1 
+    /DataSource (sgray)
+    /Alternate [/DeviceGray]
+    /Name (sgray) 
+  .dicttomark 
+] def
 
 % ------ Painting ------ %
 

Modified: branches/chrisl-test-gs/Resource/Init/gs_res.ps
===================================================================
--- branches/chrisl-test-gs/Resource/Init/gs_res.ps	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/Resource/Init/gs_res.ps	2010-10-21 09:19:31 UTC (rev 11833)
@@ -926,6 +926,7 @@
 	} ifelse
       } forall dup null eq { pop true exit } if
     } if
+    dup / eq { //false exit } if  % / throws an error from findlibfile
 		% Convert names to strings; give up on other types.
     dup type /nametype eq { .namestring } if
     dup type /stringtype ne { false exit } if
@@ -1074,6 +1075,10 @@
     /sRGBICC exch /ColorSpace defineresource pop
     systemdict /CIEsRGBICC undef
   } if
+  systemdict /CIEsGRAYICC .knownget {
+    /sGrayICC exch /ColorSpace defineresource pop
+    systemdict /CIEsGRAYICC undef
+  } if
 	% ColorSpaceFamily resources
   colorspacedict { pop dup /ColorSpaceFamily defineresource pop } forall
 	% Filter resources

Modified: branches/chrisl-test-gs/Resource/Init/gs_ttf.ps
===================================================================
--- branches/chrisl-test-gs/Resource/Init/gs_ttf.ps	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/Resource/Init/gs_ttf.ps	2010-10-21 09:19:31 UTC (rev 11833)
@@ -464,8 +464,8 @@
       /i2 exch def
       /scode startc i2 getu16a def
       /ecode endc i2 getu16a def
-      scode ecode gt {   % Bug 691326. 
-        /ecode scode def % Acrobat does this contrary to TTF spec that
+      scode ecode 1 add gt {   % Bug 691326. 
+        /ecode scode 1 add def % Acrobat does this contrary to TTF spec that
       } if               % requires such intervals to be ignored.
 
       numcodes scode firstcode sub
@@ -483,7 +483,7 @@
       /i2 exch def
       /scode startc i2 getu16a def
       /ecode endc i2 getu16a def
-      scode ecode gt { /ecode scode def } if % Bug 691326. See above.
+      scode ecode 1 add gt { /ecode scode 1 add def } if % Bug 691326. See above.
 
       numcodes scode firstcode sub
 		% Hack for fonts that have only 0x0000 and 0xf000 ranges

Modified: branches/chrisl-test-gs/Resource/Init/opdfread.ps
===================================================================
--- branches/chrisl-test-gs/Resource/Init/opdfread.ps	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/Resource/Init/opdfread.ps	2010-10-21 09:19:31 UTC (rev 11833)
@@ -255,6 +255,8 @@
 /TempMatrix matrix def
 /GraphicStateStack 20 array def
 /GraphicStateStackPointer 0 def
+/InitialTextMatrixStack 20 array def
+/InitialTextMatrixStackPointer 0 def
 /PDFColorSpaces 50 dict def
 /InstalledFonts 50 dict def
 /MacRomanEncodingInverse null def
@@ -1099,6 +1101,15 @@
 
 /RunDelayedStream % <stream_obj> RunDelayedStream -
 {
+  % Save InitialTextMatrix, as this is local to each content stream
+  //GraphicState /InitialTextMatrix get
+  //InitialTextMatrixStack //PDFReader /InitialTextMatrixStackPointer get
+    2 copy get null eq {
+      2 copy currentglobal true setglobal matrix exch setglobal put
+    } if
+  get copy pop
+  //PDFReader /InitialTextMatrixStackPointer 2 copy get 1 add put
+  % Execute the stream
   //MakeStreamReader exec                                       % file
   mark exch
   cvx exec                                                      %
@@ -1106,6 +1117,11 @@
     mark (Data left on ostack after a delayed stream execution.) //error exec
   } if
   cleartomark
+  % Restore InitialTextMatrix
+  //PDFReader /InitialTextMatrixStackPointer 2 copy get 1 sub put
+  //InitialTextMatrixStack //PDFReader /InitialTextMatrixStackPointer get get
+  //GraphicState /InitialTextMatrix get
+  copy pop
 } bind def
 
 % ===================== Font Management ======================

Modified: branches/chrisl-test-gs/Resource/Init/pdf_draw.ps
===================================================================
--- branches/chrisl-test-gs/Resource/Init/pdf_draw.ps	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/Resource/Init/pdf_draw.ps	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1040,40 +1040,43 @@
   2 copy getu16 16 bitshift 3 1 roll 2 add getu16 add
 } bind def
 
-/jp2_csp_dict <<
-  12 { /DeviceCMYK } bind  % CMYK
-% 14                       % LAB
-  16 { /DeviceRGB } bind   % sRGB {/sRGBICC /ColorSpace findresource}
-  17 { /DeviceGray } bind  % Gray {/sGray /ColorSpace findresource}
+/jp2_csp_dict mark
+  12 { /DeviceCMYK }       % CMYK
+  14 { /Lab }              % LAB
+  16 { /sRGBICC /ColorSpace findresource } bind
+  17 { /sGrayICC /ColorSpace findresource } bind
   18 3 index               % YCC is converted to RGB
 % 19                       % CIEJab not supportec by PDF 1.7
 % 20                       % e-sRGB
 % 21                       % ROMMRGB
 % 24                       % e-sYCC
->> readonly def
+.dicttomark readonly def
  
 % Process jp2 blocks (aka boxes). All procedures have the signature
 % <file> <length> -> ... <file> <flush_length>
-/jp2_tag_dict <<
+/jp2_tag_dict 10 dict begin
+
   /jp2h { % descend into a sub-stream, don't return.
     () /SubFileDecode filter 0
-  } bind
+  } bdef
+
   /ihdr {
     14 sub                               % file len-14
-    1 index 14 string readstring pop     % file len-14 (14)
-    /Components 1 index 8 getu16         % file len-14 (14) /Components NC
+    1 index (1234567890abcd) readstring pop  % file len-14 (14)
+    /JPXComponents 1 index 8 getu16          % file len-14 (14) /JPXComponents NC
     def                                  % file len-14 (14)
     10 get 16#7F and 1 add
-    8 .min % color depth is reduced in the library
+    dup 12 eq { pop 16 } if    
     /BitsPerComponent exch def           % file len-14 
-  } bind
+  } bdef
+
   /colr {
     currentdict /ColorSpace known not {
       3 sub
-      1 index 3 string readstring pop      % file len-3 (3)
+      1 index (123) readstring pop      % file len-3 (3)
       0 get dup 1 eq {
         pop 4 sub                          % file len-7
-        1 index 4 string readstring pop    % file len-16 (4) 
+        1 index (1234) readstring pop    % file len-16 (4) 
         0 getu32                           % file len-16 enum
         //jp2_csp_dict exch .knownget {
           exec /ColorSpace exch def        % file len-7
@@ -1082,28 +1085,41 @@
           pdfformaterror
         } ifelse
       } {
-        2 eq {
-          3 dict begin
-          /N /Components load def
-          string 1 index exch readstring pop % file ()
-          /ReusableStreamDecode filter /DataSource exch def
-          currentdict end
-          /ICCBased exch 2 array astore
-          /ColorSpace exch                 % file /ColorSpace [...]
-          def 0                            % file 0
+        dup 2 eq exch 3 eq or {
+          1 index exch () /SubFileDecode filter /ReusableStreamDecode filter
+          /JPXICC exch def
+          0                                % file 0
         } {
           (   **** Warning: Unknown color space method in JPX stream.\n)
           pdfformaterror
         } ifelse
       } ifelse
     } if
-  } bind
+  } bdef
+
   % Palette colors are decoded by the library.
   % For now, ignore 'pclr' table.
-  /pclr { }
->> readonly def
+  /pclr { } bdef
 
+  /cdef {
+    pop
+    dup (12) readstring pop
+    0 getu16 {
+      dup (123456) readstring pop
+      2 getu16
+      dup 3 lt {
+        { /JPXColors /JPXOpacity /JPXPremult } exch get
+          currentdict 1 index .knownget { 1 add } { 1 } ifelse def
+      } {
+        pop
+      } ifelse
+    } repeat
+    0
+  } bdef
 
+currentdict end readonly def
+
+
 % Parse jp2 file format to get color space and image depth info.
 % <file> get_jp2_csp -
 /get_jp2_csp {
@@ -1233,6 +1249,23 @@
             } ifelse
 
             //false resolvestream get_jp2_csp
+
+            currentdict /ColorSpace oknown not {
+              currentdict /JPXICC .knownget {
+                 [ /ICCBased mark
+                     /DataSource 5 -1 roll
+                     /N currentdict /JPXColors .knownget not {
+                       currentdict /JPXComponents get
+                     } if
+                   .dicttomark
+                 ] /ColorSpace exch def
+              } if
+            } if
+
+            { /JPXICC /JPXColors /JPXComponents /JPXOpacity /JPXPremult } {
+              currentdict exch undef
+            } forall
+
           } ifelse
         } if
       } if
@@ -1706,8 +1739,23 @@
 
 % ============================== Annotations ============================== %
 
+% Create links from separate widget annotations to the parent field nodes.
+% Surprisingly, separate widget annotations don't have a link to the parent
+% from which they inherit some data.
+/link_widget_annots { % <<parent>> <<kid>> -> <<parent>> <<kid>>
+  dup /Kids knownoget {
+    { oforce
+      dup type /dicttype eq {
+        link_widget_annots
+      } if
+      pop
+    } forall
+  } if
+  dup /Parent oknown not {
+    2 copy exch /ParentField exch put
+  } if
+} bdef
 
-
 % Get and normalize an annotation's rectangle.
 /annotrect {		% <annot> annotrect <x> <y> <w> <h>
   /Rect oget aload pop
@@ -1809,6 +1857,75 @@
   } ifelse
 } bdef
 
+/set_bc_color <<
+ 1 { 0 get oforce setgray } bind
+ 3 { { oforce } forall setrgbcolor } bind
+ 4 { { oforce } forall setcmykcolor } bind
+>> readonly def
+
+% Get an inherited attribute from a node through /Parent and /ParentField
+% links. The latter is set at start-up to access parents of annotations and
+% defaults at AcroForm.
+/fget	% <field> <key> fget <value> -true-
+ {	% <field> <key> fget -false-
+   {
+     2 copy knownoget {
+       exch pop exch pop //true exit
+     } {
+       exch
+       dup /Parent knownoget {
+         exch pop exch
+       } {
+         /ParentField knownoget {
+           exch
+         } {
+           pop //false exit
+         } ifelse
+       } ifelse
+     } ifelse
+   } loop
+ } bind def
+
+% <annot> foo <annot>
+/make_tx_da {
+  dup /AP << /N 10 dict dup cvx begin >> put
+  /Subtype /Form def
+  /BBox [ 0 0 4 index /Rect oget { oforce } forall  3 -1 roll sub abs 3 1 roll sub abs exch ] def
+  /Resources 1 index /DR fget not { 0 dict } if def
+  /File 1 index /V fget not { () } if length
+     2 index /DA fget not { () } if length add
+     500 add 65535 .min  string dup 3 1 roll def
+  /NullEncode filter    % <annot> file 
+
+  dup (BT ) writestring
+  1 index /DA fget not { () } if
+  [ exch
+    { token {
+        dup /Tf eq {
+          2 index 0 eq {
+            /BBox load 3 get
+            0.75 mul   % empirical constant
+            4 -1 roll pop 3 1 roll
+          } if
+        } if
+        exch
+      } {
+        exit
+      } ifelse
+    } loop
+  ]
+  { 1 index exch write== } forall
+  dup 2 index /MaxLen fget not { 0 } if write=
+  dup 2 index /V fget not { () } if write==
+  dup 2 index /Ff fget not { 0 } if write=
+  dup 2 index /Q fget not { 0 } if write=
+  dup (Tform ET) write=
+  dup .fileposition /Length exch def
+  /File File 0 Length getinterval def
+  closefile             % <annot>
+  end
+} bdef
+
 /drawwidget {			% <scalefactor_x> <scalefactor_y> <annot> drawwidget -
   dup /AP knownoget {
     dup /N known not {
@@ -1867,48 +1984,54 @@
       DoForm Q
     } if
   } {
-    dup /FT knownoget {
-      /Tx eq {
-	  % Stack: scalex scaley annot
-	dup /DA known 1 index /V known and {
-	  dup /DA oget
-	  q graphicsbeginpage textbeginpage
-	  1 index annotrect pop pop translate
-	  3 index 3 index scale		% Apply scale factors
-	  cvx exec
-	  dup /V oget
-	  0 0 moveto dup false charpath pathbbox newpath 3 -1 roll
-	  sub abs 3 1 roll sub abs
-	  3 index annotrect 4 2 roll pop pop
-	  6 index mul exch 6 index mul
-	    % stack: scale annot V vsize hsize vrect hrect
-	  % Calculate horizontal justification first
-	  % horizontal can be left (Q=0), center (Q=1), or right (Q=2) justification
-	  3 -1 roll 
-	    % stack: scalex scaley annot V vsize vrect hrect hsize 
-	  5 index /Q knownoget not { 0 } if	% default 0 == left
-	  dup 0 eq {
-	      pop pop pop 0		% left justified
+    dup /MK knownoget {    % mk
+      dup /BG knownoget {  % mk bg
+        dup length         % mk bg len
+        //set_bc_color exch .knownget {
+           gsave
+           exec
+           3 index 3 index scale
+           1 index annotrect rectfill
+           grestore
 	    } {
-	    1 eq {
-	      2 div exch 2 div exch sub	% centered
+          pop
+        } ifelse
+      } if
+      dup /BC knownoget {
+        dup length
+        //set_bc_color exch .knownget {
+           gsave
+           exec
+           1 setlinewidth
+           3 index 3 index scale
+           1 index annotrect rectstroke
+           grestore
 	    } {
-	      sub			% right justified (hrect - hsize)
+          pop
 	    } ifelse
-	  } ifelse
-	    % stack: scalex scaley annot V vsize vrect hoffset
-	  % Center the text vertically in the rect (Acrobat Reader seems to do this)
-	  3 1 roll 2 div exch 2 div sub abs
-	    % stack: scalex scaley annot V hoffset voffset
-	  moveto show
-	  Q
 	} if
+      pop
       } if
+    NeedAppearances {
+      dup /FT fget {
+        /Tx eq {
+          % Stack: scalex scaley annot
+	  dup /V oknown {
+            dup /DA fget {
+              pop
+              make_tx_da
+              3 copy drawwidget
     } if
+  	  } if
+        } if
+      } if
+    } if
   } ifelse
   pop pop pop
 } bdef
 
+currentdict /set_bc_color undef
+
 %  For annotation object we have to determine the size of the output rectangle
 %  and the size of the BBox for the form XObject. From these we calculate
 %  a scale factors for drawing it.
@@ -1948,10 +2071,55 @@
 } bdef
 
 % Draw an annotation.
-/drawannottypes mark
+/drawannottypes 20 dict begin
+
+  % x0 y0 x1 y1 x2 y2 x3 y3 -> x0 y0 x1-x0 y1-y0 x2-x0 y2-y0  
+  /quadpoints2basis {
+    8 { oforce 8 1 roll } repeat
+
+    % The text is oriented with respect to the vertex with the smallest
+    % y value (or the leftmost of those, if there are two such vertices)
+    % (x0, y0) and the next vertex in a counterclockwise direction
+    % (x1, y1), regardless of whether these are the first two points in
+    % the QuadPoints array.
+
+    2 {
+      2 index 1 index eq {
+        3 index 2 index gt {
+          4 2 roll
+        } if  
+      } {
+        2 index 1 index gt {
+          4 2 roll
+        } if
+      } ifelse
+      8 4 roll
+    } repeat
+    6 index 3 index gt {
+      8 4 roll
+    } if
+
+    %  ^
+    %  |
+    %  * (x2,y2)    * (x3,y3)
+    %  |
+    %  |
+    %  *------------*-> 
+    %  (x0,y0)      (x1,y1)
+
+    pop pop           % x0 y0 x1 y1 x2 y2
+    4 index sub exch  % x0 y0 x1 y1 y2-y0 x2
+    5 index sub exch  % x0 y0 x1 y1 x2-x0 y2-y0
+    4 2 roll
+    4 index sub exch  % x0 y0 x2-x0 y2-y0 y1-y0 x1
+    5 index sub exch  % x0 y0 x2-x0 y2-y0 x1-x0 y1-y0 
+    4 2 roll          % x0 y0 x1-x0 y1-y0 x2-x0 y2-y0 
+  } bdef
+
   /Link { % <annot> -> <false>
     dup drawborder dup calc_annot_scale 3 -1 roll drawwidget //false
-  } bind
+  } bdef
+
   /Ink { % <annot> -> <annot> <true>
          % <annot> -> <false>
     dup /AP oknown {
@@ -1973,9 +2141,321 @@
       } if
       //false
     } ifelse
-  } bind
-.dicttomark readonly def
+  } bdef
 
+  /Underline {
+    dup /AP oknown {
+      //true
+    } {
+      0 setlinecap
+      dup annotsetcolor
+      dup calc_annot_scale scale
+
+      /QuadPoints knownoget {
+        aload length 8 idiv {
+          //quadpoints2basis exec
+
+          % Acrobat draws the line at 1/7 of the box width from the bottom
+          % of the box and 1/16 thick of the box width. /Rect is ignored.
+
+          2 copy dup mul exch dup mul add sqrt 16 div setlinewidth
+          7 div 4 index add exch % x0 y0 x1-x0 y1-y0 (y2-y0)/7+y0 x2-x0
+          7 div 5 index add exch % x0 y0 x1-x0 y1-y0 (x2-x0)/7+x0 (y2-y0)/7+y0
+          2 copy moveto
+          2 index add exch
+          3 index add exch lineto % x0 y0 x1-x0 y1-y0
+          pop pop pop pop
+          stroke
+        } repeat
+      } if
+      //false
+    } ifelse
+  } bdef
+
+  /StrikeOut {
+    dup /AP oknown {
+      //true
+    } {
+      0 setlinecap
+      dup annotsetcolor
+      dup calc_annot_scale scale
+
+      /QuadPoints knownoget {
+        aload length 8 idiv {
+          //quadpoints2basis exec
+
+          % Acrobat draws the line at 3/7 of the box width from the bottom
+          % of the box and 1/16 thick of the box width. /Rect is ignored.
+
+          2 copy dup mul exch dup mul add sqrt 16 div setlinewidth
+          0.4285714 mul 4 index add exch % x0 y0 x1-x0 y1-y0 (y2-y0)*3/7+y0 x2-x0
+          0.4285714 mul 5 index add exch % x0 y0 x1-x0 y1-y0 (x2-x0)*3/7+x0 (y2-y0)*3/7+y0
+          2 copy moveto
+          2 index add exch
+          3 index add exch lineto % x0 y0 x1-x0 y1-y0
+          pop pop pop pop
+          stroke
+        } repeat
+      } if
+      //false
+    } ifelse
+  } bdef
+
+  % Connect 2 points with an arc that has max distance from the line
+  % segment to the ark equal 1/4 of the radius.
+  /highlight-arc {                      % x1 y1 x0 y0 -> -
+    4 2 roll                            % x0 y0 x1 y1
+    dup 3 index add 2 div               % x0 y0 x1 y1 (y1+y0)/2
+    2 index 5 index sub .9375 mul add   % x0 y0 x1 y1 (y1+y0)/2+15/16*dx=yc
+    4 index 3 index add 2 div           % x0 y0 x1 y1 yc (x0+x1)/2
+    2 index 5 index sub .9375 mul add   % x0 y0 x1 y1 yc xc
+    exch                                % x0 y0 x1 y1 xc yc
+    dup 3 index exch sub                % x0 y0 x1 y1 xc yc y1-yc
+    4 index 3 index sub                 % x0 y0 x1 y1 xc yc y1-yc x1-xc
+    dup dup mul 2 index dup mul add sqrt %x0 y0 x1 y1 xc yc y1-yc x1-xc r
+    3 1 roll atan                       % x0 y0 x1 y1 xc yc r a1
+    6 index 3 index sub                 % x0 y0 x1 y1 xc yc r a1 y0-yc
+    8 index 5 index sub                 % x0 y0 x1 y1 xc yc r a1 y0-yc x0-xc
+    atan                                % x0 y0 x1 y1 xc yc r a1 a2
+    exch arcn                           % x0 y0 x1 y1
+    pop pop pop pop
+  } bind def
+
+  /emptydict 0 dict readonly def
+
+  /Highlight {
+    % Acrobat ignores /AP and uses transparent highlighting
+    0 setlinecap
+    dup annotsetcolor
+    /QuadPoints knownoget {
+      aload length 8 idiv {
+        6 -2 roll
+        2 copy moveto
+        //highlight-arc exec
+        2 copy lineto
+        //highlight-arc exec
+        closepath
+      } repeat
+      PDFusingtransparency {
+        //emptydict
+        pathbbox 2 index add exch 3 index add exch .begintransparencygroup
+        /Multiply .setblendmode
+        fill
+        .endtransparencygroup
+      } { % for -dNOTRANSPARENCY
+        stroke newpath
+      } ifelse
+    } if
+    //false
+  } bdef
+  currentdict /emptydict undef
+  currentdict /highlight-arc undef
+
+  /Squiggly {
+    dup /AP oknown {
+      //true
+    } {
+      dup annotsetcolor
+      dup calc_annot_scale scale
+
+      /QuadPoints knownoget {
+        aload length 8 idiv {
+          gsave
+          8 copy moveto lineto
+          4 2 roll lineto lineto closepath clip newpath
+          //quadpoints2basis exec
+          6 -2 roll translate    % adjust for x0 y0      % x1-x0 y1-y0 x2-x0 y2-y0
+          1 index 56 div 1 index 56 div translate        % zigzag box is 1/56 up
+          1 index 72 div 1 index 72 div translate        % the line in the box is 1/72 up
+          2 copy dup mul exch dup mul add sqrt           % x1-x0 y1-y0 x2-x0 y2-y0 |p2|
+          4 index dup mul 4 index dup mul add sqrt       % x1-x0 y1-y0 x2-x0 y2-y0 |p2| |p1|
+          dup 0 gt 2 index 0 gt and {                 
+            div                                          % x1-x0 y1-y0 x2-x0 y2-y0 |p2|/|p1|=p12 
+            dup 1 exch div 4 mul 1 add cvi exch 6 2 roll % cnt p12 x1-x0 y1-y0 x2-x0 y2-y0
+            4 2 roll                                     % cnt p12 x2-x0 y2-y0 x1-x0 y1-y0
+            4 index mul exch 4 index mul exch            % cnt p12 x2-x0 y2-y0 (x1-x0)*p12 (y1-y0)*p12
+            4 2 roll 0 0 6 array astore concat           % cnt p12
+            1 40 div 1 72 div scale                     
+            pop                                          % cnt
+            0 0 moveto
+            1 setlinecap
+            1 setlinejoin
+            1 setlinewidth
+            {
+              5 10 lineto
+              10 0 lineto
+              10 0 translate 
+            } repeat
+            stroke
+          } {
+            6 { pop } repeat
+          } ifelse
+          grestore
+        } repeat
+      } if
+      //false
+    } ifelse
+  } bdef
+
+  /Text {
+    dup /AP oknown {
+      //true
+    } {
+      dup calc_annot_scale scale
+      annotrect 4 2 roll translate
+      exch pop
+
+      % Draw a page icon
+      0.5 exch 18.5 sub translate
+      1 setlinewidth
+      0.75 setgray
+      0.5 -1 moveto 10 -1 lineto 15 4 lineto 15 17.5 lineto stroke
+
+      0 0 moveto
+      9 0 lineto
+      14 5 lineto
+      14 18 lineto
+      0 18 lineto closepath
+      gsave .5 setgray fill grestore 0 setgray stroke
+
+      3 8 moveto 7.5 8 lineto
+      3 11 moveto 10 11 lineto
+      3 14 moveto 10 14 lineto
+      9 0 moveto 9 5 lineto 14 5 lineto
+      stroke
+      //false
+    } ifelse
+  } bdef
+ 
+  /frame {
+    { 255 div } forall setrgbcolor
+    -95 -25 translate
+    2 190 atan rotate
+    {
+      6 0 moveto
+      190 0 190 6 6 arct 
+      190 47 184 47 6 arct 
+      0 47 0 41 6 arct
+      0 0 6 0 6 arct
+      closepath
+
+      10 4 moveto
+      185 4 185 9 5 arct
+      185 43 180 43 5 arct
+      5 43 5 38 5 arct
+      5 4 9 4 5 arct
+      closepath
+      eofill
+   }
+   gsave 1 -1 translate 0.75 setgray dup exec grestore
+   exec
+  } bdef
+
+  % (text) y h -> -
+  /text { 
+    /Times-Bold findfont exch scalefont setfont  % (text) y
+    gsave
+    0 0 moveto
+    1 index //false charpath flattenpath pathbbox
+    pop exch pop sub 2 div
+    grestore
+    95 add exch moveto
+    gsave 1 -1 rmoveto  0.75 setgray dup show grestore
+    show
+  } bdef
+ 
+  /red   <ef4023> readonly def
+  /green <3fae49> readonly def
+  /blue  <0072bc> readonly def
+
+  /stamp_dict 14 dict begin
+    /Approved {
+      //green //frame exec
+      (APPROVED) 13 30 //text exec
+    } bdef
+    /AsIs {
+      //red //frame exec
+      (AS IS) 13 30 //text exec
+    } bdef
+    /Confidential {
+      //red //frame exec
+      (CONFIDENTIAL) 17 20 //text exec
+    } bdef
+    /Departmental {
+      //blue //frame exec
+      (DEPARTMENTAL) 17 20 //text exec
+    } bdef
+    /Draft {
+      //red //frame exec
+      (DRAFT) 13 30 //text exec
+    } bdef
+    /Experimental {
+      //blue //frame exec
+      (EXPERIMENTAL) 17 20 //text exec
+    } bdef
+    /Expired {
+      //red //frame exec
+      (EXPIRED) 13 30 //text exec
+    } bdef
+    /Final {
+      //red //frame exec
+      (FINAL) 13 30 //text exec
+    } bdef
+    /ForComment {
+      //green //frame exec
+      (FOR COMMENT) 17 20 //text exec
+    } bdef
+    /ForPublicRelease {
+      //green //frame exec
+      (FOR PUBLIC) 26 18 //text exec
+      (RELEASE)  8.5 18 //text exec
+    } bdef
+    /NotApproved {
+      //red //frame exec
+      (NOT APPROVED) 17 20 //text exec
+    } bdef
+    /NotForPublicRelease {
+      //red //frame exec
+      (NOT FOR) 26 18 //text exec
+      (PUBLIC RELEASE) 8.5 18 //text exec
+    } bdef
+    /Sold {
+      //blue //frame exec
+      (SOLD) 13 30 //text exec
+    } bdef
+    /TopSecret {
+      //red //frame exec
+      (TOP SECRET) 14 26 //text exec
+    } bdef
+  currentdict end readonly def
+
+  {/text/frame/red/green/blue} {currentdict exch undef} forall
+
+  /Stamp  {
+    dup /AP oknown {
+      //true
+    } {
+      dup calc_annot_scale scale
+
+      % translate to the center of Rect
+      dup annotrect
+      4 2 roll  % dx dy x0 y0
+      2 index 2 div add exch
+      3 index 2 div add exch translate  % dx dy
+      
+      50 div exch 190 div .min dup scale
+
+      /Name knownoget not { /Draft } if
+      //stamp_dict 1 index known not { exch pop /Draft exch } if
+      //stamp_dict exch get exec
+
+      //false
+    } ifelse
+  } bdef
+
+  currentdict /quadpoints2basis undef
+currentdict end readonly def
+
 /drawannot {		% <annot> drawannot -
   dup annotvisible {
     gsave

Modified: branches/chrisl-test-gs/Resource/Init/pdf_font.ps
===================================================================
--- branches/chrisl-test-gs/Resource/Init/pdf_font.ps	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/Resource/Init/pdf_font.ps	2010-10-21 09:19:31 UTC (rev 11833)
@@ -77,6 +77,7 @@
 
 /known_symbolic_fonts <<
   /Wingdings2 0
+  /ZapfDingbats 0
 >> readonly def
 
 % Get the Encoding for a font.
@@ -224,7 +225,7 @@
                         %   <font-resource> <font> <Encoding|null>
                         %   <Metrics|null> <GlyphMap|null>
 
-  2 index /Widths known {
+  2 index /Widths oknown {
     dup //null eq { pop dup /Encoding get } if
     7 dict begin
       dup length dict
@@ -1769,6 +1770,16 @@
   } if {
     /PSFont get 
   } {
+  
+    % In the event we have a Type 0 dictionary with a spurious
+    % FontDescriptor object, remove it here to prevent confusion
+    % later on.
+    % Bug 691589
+    dup /Subtype get /Type0 eq 1 index /FontDescriptor known and
+    {
+        dup /FontDescriptor undef
+    }if
+
     dup dup /FontDescriptor knownoget {
                                           % font-res font-res font-desc
       % The same font descriptor can be reused in a CID and non-CID contexts.

Modified: branches/chrisl-test-gs/Resource/Init/pdf_main.ps
===================================================================
--- branches/chrisl-test-gs/Resource/Init/pdf_main.ps	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/Resource/Init/pdf_main.ps	2010-10-21 09:19:31 UTC (rev 11833)
@@ -658,6 +658,24 @@
     } if
     pop
   } if
+
+  % Enumerate all AcroForm fielda and link all separate widgets
+  % to the parent field.
+  Trailer /Root oget /AcroForm knownoget {
+    dup /NeedAppearances knownoget not { //false } if {
+      /NeedAppearances //true def
+      dup
+      /Fields knownoget {
+        { oforce
+          link_widget_annots
+          pop
+        } forall 
+      } if
+      pop
+    } {
+      pop
+    } ifelse
+  } if
 } bind def
 
 % Verify that each entry in the xref table is pointing at an object with
@@ -724,7 +742,7 @@
 
 /pdfopenfile {		% <file> pdfopenfile <dict>
    pdfdict readonly pop		% can't do it any earlier than this
-   15 dict begin
+   30 dict begin
    /LocalResources 0 dict def
    /DefaultQstate //null def	% establish binding
    /Printed where { pop } {
@@ -737,6 +755,7 @@
    cvlit /PDFfile exch def
    /PDFsource PDFfile def
    /Repaired false def
+   /NeedAppearances //false def
    currentglobal true .setglobal globaldict begin
    /UndefProcList 0 dict def
    end .setglobal
@@ -1307,6 +1326,8 @@
 	       dup pdf_cached_PDF2PS_matrix exch
 	       dup /Rotate pget not { 0 } if 90 idiv exch
                pdfpagenumber
+               /FirstPage where {pop dup FirstPage lt {/rangecheck signalerror} if} if
+               /LastPage where {pop dup LastPage gt {/rangecheck signalerror} if} if
                true % now we have a page# and a transformation matrix
              } if
            } if
@@ -1881,6 +1902,11 @@
      {
        oforce
        dup //null ne {
+         dup /Subtype knownoget {
+           /Highlight eq {      % Highlight annotation is always implemented
+             pop pop //true exit  % as transparency.
+           } if
+         } if
          /AP knownoget {	% Get appearance dict for the annoation
            /N knownogetdict { 	% Get the /N (i.e. normal) appearance stream
              4 dict exch resourceusestransparency { pop //true exit } if

Modified: branches/chrisl-test-gs/Resource/Init/pdf_ops.ps
===================================================================
--- branches/chrisl-test-gs/Resource/Init/pdf_ops.ps	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/Resource/Init/pdf_ops.ps	2010-10-21 09:19:31 UTC (rev 11833)
@@ -92,15 +92,15 @@
 
 /q {
   gsave //nodict begin
-  PDFusingtransparency {.pushextendedgstate cvx} if
+  PDFusingtransparency { .pushextendedgstate } if
 } bdef
 
 % Some PDF files have excess Q operators!
 /Q {
-  PDFusingtransparency {.popextendedgstate cvx} if
   currentdict /self .knownget {
     exec //nodict eq {
       end
+      PDFusingtransparency { .popextendedgstate } if
       % Restore graphics state, but do not modify path. Paths are not part
       % of the PDF graphics state; see 4.4.1 of PDF reference 3rd ed.
       % Collecting the path with one ctm and re-playing it with another ctm
@@ -755,7 +755,7 @@
 	% Tr 0 - Fill
 	{ setfillstate show } bind
 	% Tr 1 - Stroke
-	{ setstrokestate
+	{ currentlinewidth exch setstrokestate
         % Need to set the stroke width to a value which gives the correct
         % width under pdfwrite. Pdfwrite uses (in text mode) an identity
         % CTM, so we need to calculate the stroke width which would result
@@ -769,7 +769,7 @@
           % we can ignore it. (wrong answer, but consistent)
           pop pop currentlinewidth
         }ifelse setlinewidth
-        .swapcolors show .swapcolors } bind
+        .swapcolors show .swapcolors setlinewidth} bind
 	% Tr 2 - Fill then Stroke
 	{ gsave 0 .settextrenderingmode 
 	  setfillstate dup show currentpoint 3 -1 roll 

Modified: branches/chrisl-test-gs/Resource/Init/pdf_rbld.ps
===================================================================
--- branches/chrisl-test-gs/Resource/Init/pdf_rbld.ps	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/Resource/Init/pdf_rbld.ps	2010-10-21 09:19:31 UTC (rev 11833)
@@ -282,11 +282,13 @@
     { % stack: <length> <working_str> <loc> <string>
       % Now that we have line, get obj num, ref num, and 'obj'.  Verify that each
       % of these is correct type.
-      (obj) search {
-        exch pop exch pop
+      dup (obj) search {                % preliminary check for obj
+        pop pop pop
         /integertype typed_token {	% get obj number
           /integertype typed_token {	% get ref number
+            /nametype typed_token {	% get 'obj' text
 	    pop				% pop remaining string
+	      /obj eq {			% verify name is 'obj'
 	    % make sure we have room in the arrays.  We work in increments
 	    % of 20 each time we increase the size.
 	    1 index 20 add 20 idiv 20 mul
@@ -296,12 +298,14 @@
 	    4 index PDFoffset sub 3 index
 	    //true setxrefentry	% save parameters
 	    pop pop pop pop		% clear parameters
+	      } if			% check if name is 'obj'
+            } if			% check if we got 'obj" string
             pop				% remove ref number
           } if				% check if we got ref number
           pop				% remove obj number
         } if				% check if we got object number
       } {
-        pop
+        pop pop
       } ifelse
     } if				% check if got a string from readline
     pop					% remove location

Modified: branches/chrisl-test-gs/Resource/Init/pdf_sec.ps
===================================================================
--- branches/chrisl-test-gs/Resource/Init/pdf_sec.ps	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/Resource/Init/pdf_sec.ps	2010-10-21 09:19:31 UTC (rev 11833)
@@ -595,8 +595,12 @@
 	       if			% If StrF is known
       	     }
 	    ifelse			% Ifelse R < 4
+	  } {
+            dup type /nametype eq {
+              .pdffixname
+            } if
 	  }
-	 if				% If = stringtype
+         ifelse
 	 exch pop
        }
       ifelse

Modified: branches/chrisl-test-gs/base/Makefile.in
===================================================================
--- branches/chrisl-test-gs/base/Makefile.in	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/Makefile.in	2010-10-21 09:19:31 UTC (rev 11833)
@@ -183,7 +183,7 @@
 # Define the directory where the PNG library sources are stored,
 # and the version of the library that is stored there.
 # You may need to change this if the libpng version changes.
-# See libpng.mak for more information.
+# See png.mak for more information.
 
 SHARE_LIBPNG=@SHARE_LIBPNG@
 PNGSRCDIR=@LIBPNGDIR@
@@ -511,7 +511,7 @@
 # These are the specific warnings we have to turn off to compile those
 # specific few files that need this.  We may turn off others in the future.
 CC_NO_WARN=$(CC_)
-CC_SHARED=$(CC_) @DYNAMIC_LDFLAGS@
+CC_SHARED=$(CC_) @DYNAMIC_CFLAGS@
 
 # ---------------- End of platform-specific section ---------------- #
 
@@ -524,10 +524,10 @@
 include $(PSSRCDIR)/int.mak
 include $(GLSRCDIR)/freetype.mak
 include $(GLSRCDIR)/jpeg.mak
-# zlib.mak must precede libpng.mak
+# zlib.mak must precede png.mak
 include $(GLSRCDIR)/zlib.mak
-include $(GLSRCDIR)/libpng.mak
-include $(GLSRCDIR)/libtiff.mak
+include $(GLSRCDIR)/png.mak
+include $(GLSRCDIR)/tiff.mak
 include $(GLSRCDIR)/jbig2.mak
 include $(GLSRCDIR)/jasper.mak
 include $(GLSRCDIR)/ldf_jb2.mak

Deleted: branches/chrisl-test-gs/base/bcwin32.mak
===================================================================
--- branches/chrisl-test-gs/base/bcwin32.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/bcwin32.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1,717 +0,0 @@
-#  Copyright (C) 2001-2007 Artifex Software, Inc.
-#  All Rights Reserved.
-#
-#  This software is provided AS-IS with no warranty, either express or
-#  implied.
-#
-#  This software is distributed under license and may not be copied, modified
-#  or distributed except as expressly authorized under the terms of that
-#  license.  Refer to licensing information at http://www.artifex.com/
-#  or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
-#  San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
-#
-# $Id$
-# makefile for (Windows 95 / Windows NT) +
-#   Borland C++ 4.5 and 5.5 platforms.
-#   Borland C++Builder 3 platform (need BC++ 4.5 for 16-bit code)
-
-# ------------------------------- Options ------------------------------- #
-
-###### This section is the only part of the file you should need to edit.
-
-# ------ Generic options ------ #
-
-# Define the directory for the final executable, and the
-# source, generated intermediate file, and object directories
-# for the graphics library (GL) and the PostScript/PDF interpreter (PS).
-
-!ifndef BINDIR
-BINDIR=.\bin
-!endif
-!ifndef GLSRCDIR
-GLSRCDIR=.\base
-!endif
-!ifndef GLGENDIR
-GLGENDIR=.\obj
-!endif
-!ifndef GLOBJDIR
-GLOBJDIR=.\obj
-!endif
-!ifndef PSSRCDIR
-PSSRCDIR=.\psi
-!endif
-!ifndef PSLIBDIR
-PSLIBDIR=.\lib
-!endif
-!ifndef PSRESDIR
-PSRESDIR=.\Resource
-!endif
-!ifndef PSGENDIR
-PSGENDIR=.\obj
-!endif
-!ifndef PSOBJDIR
-PSOBJDIR=.\obj
-!endif
-
-# Define the root directory for Ghostscript installation.
-
-!ifndef AROOTDIR
-AROOTDIR=c:/gs
-!endif
-!ifndef GSROOTDIR
-GSROOTDIR=$(AROOTDIR)/gs$(GS_DOT_VERSION)
-!endif
-
-# Define the directory that will hold documentation at runtime.
-
-!ifndef GS_DOCDIR
-GS_DOCDIR=$(GSROOTDIR)/doc
-!endif
-
-# Define the default directory/ies for the runtime
-# initialization, resource and font files.  Separate multiple directories with \;.
-# Use / to indicate directories, not a single \.
-
-!ifndef GS_LIB_DEFAULT
-GS_LIB_DEFAULT=$(GSROOTDIR)/Resource/Init\;$(GSROOTDIR)/lib\;$(GSROOTDIR)/Resource/Font\;$(AROOTDIR)/fonts
-!endif
-
-# Define whether or not searching for initialization files should always
-# look in the current directory first.  This leads to well-known security
-# and confusion problems, but may be convenient sometimes.
-
-!ifndef SEARCH_HERE_FIRST
-SEARCH_HERE_FIRST=0
-!endif
-
-# Define the name of the interpreter initialization file.
-# (There is no reason to change this.)
-
-!ifndef GS_INIT
-GS_INIT=gs_init.ps
-!endif
-
-# Choose generic configuration options.
-
-# Setting DEBUG=1 includes debugging features in the build:
-# 1. It defines the C preprocessor symbol DEBUG. The latter includes
-#    tracing and self-validation code fragments into compilation.
-#    Particularly it enables the -Z and -T switches in Ghostscript.
-# Code produced with this option is somewhat larger and runs 
-# somewhat slower.
-
-!ifndef DEBUG
-DEBUG=0
-!endif
-
-# Setting TDEBUG=1 includes symbol table information for the debugger, and
-# also enables stack checking.  The compiled code is substantially slower
-# and larger.
-
-!ifndef TDEBUG
-TDEBUG=0
-!endif
-
-# Define the names of the executable files.
-
-!ifndef GS
-GS=gswin32
-!endif
-!ifndef GSCONSOLE
-GSCONSOLE=gswin32c
-!endif
-!ifndef GSDLL
-GSDLL=gsdll32
-!endif
-
-# To build two small executables and a large DLL use MAKEDLL=1
-# To build two large executables use MAKEDLL=0
-
-!ifndef MAKEDLL
-MAKEDLL=1
-!endif
-
-# Define the directory where the IJG JPEG library sources are stored,
-# and the major version of the library that is stored there.
-# You may need to change this if the IJG library version changes.
-# See jpeg.mak for more information.
-
-!ifndef JSRCDIR
-JSRCDIR=jpeg
-!endif
-
-# Define the directory where the PNG library sources are stored,
-# and the version of the library that is stored there.
-# You may need to change this if the libpng version changes.
-# See libpng.mak for more information.
-
-!ifndef PNGSRCDIR
-PNGSRCDIR=libpng
-!endif
-
-!ifndef TIFFSRCDIR
-TIFFSRCDIR=tiff$(D)
-TIFFCONFIG_SUFFIX=.vc
-TIFFPLATFORM=win32
-!endif
-
-# Define the directory where the zlib sources are stored.
-# See zlib.mak for more information.
-
-!ifndef ZSRCDIR
-ZSRCDIR=zlib
-!endif
-
-# Define which jbig2 library to use
-!ifndef JBIG2_LIB
-JBIG2_LIB=jbig2dec
-!endif
-
-!if "$(JBIG2_LIB)" == "luratech" || "$(JBIG2_LIB)" == "ldf_jb2"
-# Set defaults for using the Luratech JB2 implementation
-!ifndef JBIG2SRCDIR
-# CSDK source code location
-JBIG2SRCDIR=ldf_jb2
-!endif
-!ifndef JBIG2_CFLAGS
-# required compiler flags
-JBIG2_CFLAGS=-DUSE_LDF_JB2 -DWIN32
-!endif
-!else
-# Use jbig2dec by default. See jbig2.mak for more information.
-!ifndef JBIG2SRCDIR
-# location of included jbig2dec library source
-JBIG2SRCDIR=jbig2dec
-!endif
-!endif
-
-# Alternatively, you can build a separate DLL
-# and define SHARE_JBIG2=1 in src/winlib.mak
-
-# Define which jpeg2k library to use
-!ifndef JPX_LIB
-JPX_LIB=jasper
-!endif
-
-!if "$(JPX_LIB)" == "luratech" || "$(JPX_LIB)" == "lwf_jp2"
-# Set defaults for using the Luratech JP2 implementation
-!ifndef JPXSRCDIR
-# CSDK source code location
-JPXSRCDIR=lwf_jp2
-!endif
-!ifndef JPX_CFLAGS
-# required compiler flags
-JPX_CFLAGS=-DUSE_LWF_JP2 -DWIN32
-!endif
-!else
-# Use jasper by default. See jasper.mak for more information.
-!ifndef JPXSRCDIR
-JPXSRCDIR=jasper
-!endif
-!endif
-
-# Alternatively, you can build a separate DLL
-# and define SHARE_JPX=1 in src/winlib.mak
-
-# Define the directory where the lcms source is stored.
-# See lcms.mak for more information
-
-!ifndef LCMSSRCDIR
-LCMSSRCDIR=lcms
-!endif
-
-# Define the directory where the ijs source is stored,
-# and the process forking method to use for the server.
-# See ijs.mak for more information.
-
-!ifndef IJSSRCDIR
-IJSSRCDIR=ijs
-IJSEXECTYPE=win
-!endif
-
-# Define the directory where the imdi library source is stored.
-# See devs.mak for more information
-
-!ifndef IMDISRCDIR
-IMDISRCDIR=imdi
-!endif
-
-# Define any other compilation flags.
-
-!ifndef CFLAGS
-CFLAGS=
-!endif
-
-# Do not edit the next group of lines.
-
-#!include $(COMMONDIR)\bcdefs.mak
-#!include $(COMMONDIR)\pcdefs.mak
-#!include $(COMMONDIR)\generic.mak
-!include $(GLSRCDIR)\version.mak
-# The following is a hack to get around the special treatment of \ at
-# the end of a line.
-NUL=
-DD=$(GLGENDIR)\$(NUL)
-GLD=$(GLGENDIR)\$(NUL)
-PSD=$(PSGENDIR)\$(NUL)
-
-# ------ Platform-specific options ------ #
-
-# Define the drive, directory, and compiler name for the Borland C files.
-# BUILDER_VERSION=0 for BC++4.5, 3 for C++Builder3, 4 for C++Builder4,
-#  5 for C++Builder5.
-# COMPDIR contains the compiler and linker (normally \bc\bin).
-# INCDIR contains the include files (normally \bc\include).
-# LIBDIR contains the library files (normally \bc\lib).
-# COMP is the full C compiler name (bcc32 for Borland C++).
-# COMPCPP is the full C++ compiler path name (bcc32 for Borland C++).
-# COMPAUX is the compiler name for DOS utilities (bcc for Borland C++).
-# RCOMP is the resource compiler name (brcc32 for Borland C++).
-# LINK is the full linker path name (normally \bc\bin\tlink32).
-# Note that these prefixes are always followed by a \,
-#   so if you want to use the current directory, use an explicit '.'.
-
-# Rod Webster (rodw)
-# If C++Builder is later than 4 then you need to 
-# define BUILDER_VERSION explicity uisng BUILDER_VERSION=5 because 
-# C++Builder 4 and above all use Make Version 5.2 so point we can no 
-# longer tell the Compiler version from the __MAKE__ version number.
-
-!ifndef BUILDER_VERSION
-BUILDER_VERSION=5
-!endif
-
-!ifndef BUILDER_VERSION
-!if $(__MAKE__) >= 0x520
-# C++Builder4
-BUILDER_VERSION=4
-!elif $(__MAKE__) >= 0x510
-# C++Builder3
-BUILDER_VERSION=3
-!else
-# BC++4.5
-BUILDER_VERSION=0
-!endif
-!endif
-
-!ifndef COMPBASE
-!if $(BUILDER_VERSION) == 0
-COMPBASE=c:\bc
-COMPBASE16=$(COMPBASE)
-!endif
-!if $(BUILDER_VERSION) == 3
-COMPBASE=c:\Progra~1\Borland\CBuilder3
-COMPBASE16=c:\bc
-!endif
-!if $(BUILDER_VERSION) == 4
-COMPBASE=c:\Progra~1\Borland\CBuilder4
-COMPBASE16=c:\bc
-!endif
-!if $(BUILDER_VERSION) == 5
-COMPBASE=c:\Borland\BCC55
-#COMPBASE16=$(COMPBASE)
-!endif
-!endif
-
-COMPDIR=$(COMPBASE)\bin
-INCDIR=$(COMPBASE)\include
-LIBDIR=$(COMPBASE)\lib
-COMP=$(COMPDIR)\bcc32
-COMPCPP=$(COMP)
-RCOMP=$(COMPDIR)\brcc32
-
-!if $(BUILDER_VERSION) == 0
-COMPAUX=$(COMPDIR)\bcc
-!else
-COMPAUX=$(COMPDIR)\bcc32
-!endif
-
-!if $(BUILDER_VERSION) == 4
-LINK=$(COMPDIR)\ilink32
-!endif
-!if $(BUILDER_VERSION) == 5
-LINK=$(COMPDIR)\ilink32
-!endif
-
-# Define the processor architecture. (always i386)
-
-CPU_FAMILY=i386
-
-# Define the processor (CPU) type.  (386, 486 or 586)
-
-CPU_TYPE=586
-
-# Define the .dev module that implements thread and synchronization
-# primitives for this platform.  Don't change this unless you really know
-# what you're doing.
-
-!ifndef SYNC
-SYNC=winsync
-!endif
-
-# ------ Devices and features ------ #
-
-# Choose the language feature(s) to include.  See gs.mak for details.
-
-!ifndef FEATURE_DEVS
-FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)epsf.dev $(PSD)mshandle.dev $(PSD)msprinter.dev $(PSD)mspoll.dev $(GLD)pipe.dev $(PSD)fapi.dev $(PSD)jbig2.dev $(PSD)jpx.dev
-!endif
-
-# Choose whether to compile the .ps initialization files into the executable.
-# See gs.mak for details.
-
-!ifndef COMPILE_INITS
-COMPILE_INITS=1
-!endif
-
-# Choose whether to store band lists on files or in memory.
-# The choices are 'file' or 'memory'.
-
-!ifndef BAND_LIST_STORAGE
-BAND_LIST_STORAGE=file
-!endif
-
-# Choose which compression method to use when storing band lists in memory.
-# The choices are 'lzw' or 'zlib'.
-
-!ifndef BAND_LIST_COMPRESSOR
-BAND_LIST_COMPRESSOR=zlib
-!endif
-
-# Choose the implementation of file I/O: 'stdio', 'fd', or 'both'.
-# See gs.mak and sfxfd.c for more details.
-
-!ifndef FILE_IMPLEMENTATION
-FILE_IMPLEMENTATION=stdio
-!endif
-
-# Choose the implementation of stdio: '' for file I/O and 'c' for callouts
-# See gs.mak and ziodevs.c/ziodevsc.c for more details.
-
-!ifndef STDIO_IMPLEMENTATION
-STDIO_IMPLEMENTATION=c
-!endif
-
-# Choose the device(s) to include.  See devs.mak for details,
-# devs.mak and contrib.mak for the list of available devices.
-
-!ifndef DEVICE_DEVS
-DEVICE_DEVS=$(DD)display.dev $(DD)mswindll.dev $(DD)mswinpr2.dev
-DEVICE_DEVS2=$(DD)epson.dev $(DD)eps9high.dev $(DD)eps9mid.dev $(DD)epsonc.dev $(DD)ibmpro.dev
-DEVICE_DEVS3=$(DD)deskjet.dev $(DD)djet500.dev $(DD)laserjet.dev $(DD)ljetplus.dev $(DD)ljet2p.dev
-DEVICE_DEVS4=$(DD)cdeskjet.dev $(DD)cdjcolor.dev $(DD)cdjmono.dev $(DD)cdj550.dev
-DEVICE_DEVS5=$(DD)uniprint.dev $(DD)djet500c.dev $(DD)declj250.dev $(DD)lj250.dev $(DD)ijs.dev
-DEVICE_DEVS6=$(DD)st800.dev $(DD)stcolor.dev $(DD)bj10e.dev $(DD)bj200.dev
-DEVICE_DEVS7=$(DD)t4693d2.dev $(DD)t4693d4.dev $(DD)t4693d8.dev $(DD)tek4696.dev
-DEVICE_DEVS8=$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcx24b.dev $(DD)pcxcmyk.dev
-DEVICE_DEVS9=$(DD)pbm.dev $(DD)pbmraw.dev $(DD)pgm.dev $(DD)pgmraw.dev $(DD)pgnm.dev $(DD)pgnmraw.dev $(DD)pkmraw.dev
-DEVICE_DEVS10=$(DD)tiffcrle.dev $(DD)tiffg3.dev $(DD)tiffg32d.dev $(DD)tiffg4.dev $(DD)tifflzw.dev $(DD)tiffpack.dev
-DEVICE_DEVS11=$(DD)bmpmono.dev $(DD)bmpgray.dev $(DD)bmp16.dev $(DD)bmp256.dev $(DD)bmp16m.dev $(DD)tiff12nc.dev $(DD)tiff24nc.dev $(DD)tiffgray.dev $(DD)tiff32nc.dev $(DD)tiffsep.dev $(DD)tiffsep1.dev
-DEVICE_DEVS12=$(DD)psmono.dev $(DD)bit.dev $(DD)bitrgb.dev $(DD)bitcmyk.dev
-DEVICE_DEVS13=$(DD)pngmono.dev $(DD)pnggray.dev $(DD)png16.dev $(DD)png256.dev $(DD)png16m.dev $(DD)pngalpha.dev
-DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev $(DD)jpegcmyk.dev
-DEVICE_DEVS15=$(DD)pdfwrite.dev $(DD)pswrite.dev $(DD)ps2write.dev $(DD)epswrite.dev $(DD)txtwrite.dev $(DD)pxlmono.dev $(DD)pxlcolor.dev
-DEVICE_DEVS16=$(DD)bbox.dev
-# Overflow for DEVS3,4,5,6,9
-DEVICE_DEVS17=$(DD)ljet3.dev $(DD)ljet3d.dev $(DD)ljet4.dev $(DD)ljet4d.dev 
-DEVICE_DEVS18=$(DD)pj.dev $(DD)pjxl.dev $(DD)pjxl300.dev $(DD)jetp3852.dev $(DD)r4081.dev
-DEVICE_DEVS19=$(DD)lbp8.dev $(DD)m8510.dev $(DD)necp6.dev $(DD)bjc600.dev $(DD)bjc800.dev
-DEVICE_DEVS20=$(DD)pnm.dev $(DD)pnmraw.dev $(DD)ppm.dev $(DD)ppmraw.dev $(DD)pamcmyk32.dev
-DEVICE_DEVS21= $(DD)spotcmyk.dev $(DD)devicen.dev $(DD)bmpsep1.dev $(DD)bmpsep8.dev $(DD)bmp16m.dev $(DD)bmp32b.dev $(DD)psdcmyk.dev $(DD)psdrgb.dev
-!endif
-
-# FAPI compilation options :
-UFST_CFLAGS=-DMSVC
-
-# ---------------------------- End of options ---------------------------- #
-
-# Define the name of the makefile -- used in dependencies.
-
-MAKEFILE=$(GLSRCDIR)\bcwin32.mak
-TOP_MAKEFILES=$(MAKEFILE) $(GLSRCDIR)\winlib.mak $(PSSRCDIR)\winint.mak
-
-# Define the current directory prefix and shell invocations.
-
-D=\\
-
-EXP=
-SH=
-
-# Define the arguments for genconf.
-
-CONFILES=-p %s+
-CONFLDTR=-ol
-
-# Define the generic compilation flags.
-
-PLATOPT=
-
-# Make sure we get the right default target for make.
-
-dosdefault: default
-
-# Define the switches for the compilers.
-
-C_=-c
-O_=-o
-RO_=-fo
-
-# Define the compilation flags.
-
-!if $(CPU_TYPE)>500
-CPFLAGS=-DFOR80486 -DFOR80386
-!else if $(CPU_TYPE)>400
-CPFLAGS=-DFOR80486 -DFOR80386
-!else
-CPFLAGS=-DFOR80386
-!endif
-
-FPFLAGS=
-FPLIB=
-
-!if $(DEBUG)!=0
-CD=-DDEBUG
-!else
-CD=
-!endif
-
-!if $(TDEBUG)!=0
-CT=-v
-LCT=-v -m -s
-CO=    # no optimization when debugging
-!else
-CT=
-LCT=
-CO=-Z -O2
-!endif
-
-!if $(DEBUG)!=0 || $(TDEBUG)!=0
-CS=-N
-!else
-CS=
-!endif
-
-CMT=-tWM
-CLIB=cw32mt.lib
-
-# Specify function prolog type
-COMPILE_FOR_DLL=-WDE
-COMPILE_FOR_EXE=-WE
-COMPILE_FOR_CONSOLE_EXE=-WC
-
-# The -tWM is for multi-thread-safe compilation.
-GENOPT=$(CD) $(CT) $(CS) $(CMT)
-
-CCFLAGS0=$(GENOPT) $(PLATOPT) $(CPFLAGS) $(FPFLAGS) $(CFLAGS) $(XCFLAGS)
-CCFLAGS=$(CCFLAGS0)
-CC=$(COMP) @$(GLGENDIR)\ccf32.tr
-CPP=$(COMPCPP) @$(GLGENDIR)\ccf32.tr
-!if $(MAKEDLL)
-WX=$(COMPILE_FOR_DLL)
-!else
-WX=$(COMPILE_FOR_EXE)
-!endif
-CC_WX=$(CC) $(WX)
-CC_=$(CC_WX) $(CO)
-CC_NO_WARN=$(CC_)
-
-# No additional flags are needed for Windows compilation.
-CCWINFLAGS=
-
-# Define the files to be removed by `make clean'.
-# nmake expands macros when encountered, not when used,
-# so this must precede the !include statements.
-
-# ****** HACK ****** *.tr is still created in the current directory.
-BEGINFILES2=*.tr
-
-# Include the generic makefiles. psromfs.mak must precede lib.mak
-
-!include $(PSSRCDIR)\psromfs.mak
-!include $(GLSRCDIR)\winlib.mak
-!include $(PSSRCDIR)\winint.mak
-
-# -------------------------- Auxiliary programs --------------------------- #
-
-# Compiler for auxiliary programs
-
-!if $(BUILDER_VERSION) == 0
-CCAUX=$(COMPAUX) -ml -I$(GLSRCDIR) -I$(INCDIR) -L$(LIBDIR) -n$(AUXGENDIR) -O
-!else
-CCAUX=$(COMPAUX) -I$(GLSRCDIR) -I$(INCDIR) -L$(LIBDIR) -n$(AUXGENDIR) -O
-!endif
-CCAUX_TAIL=
-
-$(GLGENDIR)\ccf32.tr: $(TOP_MAKEFILES)
-	-mkdir $(PSOBJDIR)
-	-mkdir $(PSGENDIR)
-	-mkdir $(GLOBJDIR)
-	-mkdir $(GLGENDIR)
-	-mkdir $(BINDIR)
-	echo -a1 -d -r -w-par -w-stu -G -N -X -I$(INCDIR) > $(GLGENDIR)\ccf32.tr
-	echo $(CCFLAGS0) -DCHECK_INTERRUPTS >> $(GLGENDIR)\ccf32.tr
-
-$(ECHOGS_XE): $(GLSRCDIR)\echogs.c
-	$(CCAUX) $(GLSRCDIR)\echogs.c $(CCAUX_TAIL)
-
-# Since we are running in a Windows environment with a different compiler
-# for the DOS utilities, we have to invoke genarch by hand.
-# For unfathomable reasons, the 'win' program requires /, not \,
-# in the name of the program to be run, and apparently also in any
-# file names passed on the command line (?!).
-$(GENARCH_XE): $(GLSRCDIR)\genarch.c $(GENARCH_DEPS) $(GLGENDIR)\ccf32.tr
-	$(COMP) -I$(GLSRCDIR) -I$(INCDIR) -L$(LIBDIR) -n$(AUXGENDIR) -O $(GLSRCDIR)\genarch.c
-	echo win $(AUXGENDIR)/genarch $(GLGENDIR)/arch.h >_genarch.bat
-	echo ***** Run "_genarch.bat", then continue make. *****
-
-$(GENCONF_XE): $(GLSRCDIR)\genconf.c $(GENCONF_DEPS)
-	$(CCAUX) $(GLSRCDIR)\genconf.c $(CCAUX_TAIL)
-
-$(GENDEV_XE): $(GLSRCDIR)\gendev.c $(GENDEV_DEPS)
-	$(CCAUX) $(GLSRCDIR)\gendev.c $(CCAUX_TAIL)
-
-$(GENHT_XE): $(PSSRCDIR)\genht.c $(GENHT_DEPS)
-	$(CCAUX) $(GENHT_CFLAGS) $(PSSRCDIR)\genht.c $(CCAUX_TAIL)
-
-MKROMFS_OBJS=$(MKROMFS_ZLIB_OBJS) $(winplat_) $(GLOBJ)gpmisc.$(OBJ) $(GLOBJ)gp_getnv.$(OBJ)
-$(MKROMFS_XE): $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS)
-	$(COMPAUX) -I$(GLSRCDIR) -I$(INCDIR) -L$(LIBDIR)  -I$(GLOBJ) -I$(ZSRCDIR) @$(GLGENDIR)\ccf32.tr -e$(MKROMFS_XE) $(GLSRC)mkromfs.c $(MKROMFS_OBJS) $(CCAUX_TAIL)
-
-# ----------------------------- Main program ------------------------------ #
-
-LIBCTR=$(PSGEN)libc32.tr
-GSCONSOLE_XE=$(BINDIR)\$(GSCONSOLE).exe
-GSDLL_DLL=$(BINDIR)\$(GSDLL).dll
-
-$(LIBCTR): $(TOP_MAKEFILES) $(ECHOGS_XE)
-	echo $(LIBDIR)\import32.lib $(LIBDIR)\$(CLIB) >$(LIBCTR)
-
-!if $(BUILDER_VERSION) == 0
-# Borland C++ 4.5 will not compile the setup program,
-# since a later Windows header file is required.
-SETUP_TARGETS=
-!else
-SETUP_TARGETS=$(SETUP_XE) $(UNINSTALL_XE)
-!endif
-
-!if $(MAKEDLL)
-# The graphical small EXE loader
-$(GS_XE): $(GSDLL_DLL)  $(DWOBJ) $(GSCONSOLE_XE)\
- $(GS_OBJ).res $(PSSRCDIR)\dwmain32.def $(SETUP_TARGETS)
-	$(LINK) /L$(LIBDIR) /Tpe /aa $(LCT) @&&!
-$(LIBDIR)\c0w32 +
-$(DWOBJ) +
-,$(GS_XE),$(PSOBJ)$(GS), +
-$(LIBDIR)\import32 +
-$(LIBDIR)\cw32, +
-$(PSSRCDIR)\dwmain32.def, +
-$(GS_OBJ).res
-!
-
-# The console mode small EXE loader
-!if $(BUILDER_VERSION) == 5
-$(GSCONSOLE_XE): $(OBJC) $(GS_OBJ).res $(PSSRCDIR)\dw32c.def
-	$(LINK) /L$(LIBDIR) /Tpe /ap $(LCT) $(DEBUGLINK) @&&!
-$(LIBDIR)\c0x32 +
-$(OBJC) +
-,$(GSCONSOLE_XE),$(PSOBJ)$(GSCONSOLE), +
-$(LIBDIR)\import32 +
-$(LIBDIR)\cw32mt, +
-$(PSSRCDIR)\dw32c.def, +
-$(GS_OBJ).res
-!
-!else
-
-$(GSCONSOLE_XE): $(OBJC) $(GS_OBJ).res $(PSSRCDIR)\dw32c.def
-	$(LINK) /L$(LIBDIR) /Tpe /ap $(LCT) $(DEBUGLINK) @&&!
-$(LIBDIR)\c0w32 +
-$(OBJC) +
-,$(GSCONSOLE_XE),$(PSOBJ)$(GSCONSOLE), +
-$(LIBDIR)\import32 +
-$(LIBDIR)\cw32, +
-$(PSSRCDIR)\dw32c.def, +
-$(GS_OBJ).res
-!
-!endif
-
-# The big DLL
-$(GSDLL_DLL): $(GS_ALL) $(DEVS_ALL) $(PSOBJ)gsdll.$(OBJ)\
- $(GSDLL_OBJ).res $(PSSRCDIR)\gsdll32.def $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ)
-	-del $(PSGEN)gswin32.tr
-	copy $(ld_tr) $(PSGEN)gswin32.tr
-	echo  $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ) + >> $(PSGEN)gswin32.tr
-	echo $(LIBDIR)\c0d32 $(PSOBJ)gsdll + >> $(PSGEN)gswin32.tr
-	$(LINK) /L$(LIBDIR) $(LCT) /Tpd /aa @$(PSGEN)gswin32.tr ,$(GSDLL_DLL),$(PSOBJ)$(GSDLL),@$(LIBCTR),$(PSSRCDIR)\gsdll32.def,$(GSDLL_OBJ).res
-
-# Probably no need to build the def - hence commented out for the time being.
-$(BINDIR)\$(GSDLL).lib : $(GSDLL_DLL) $(PSSRCDIR)\gsdll32.def
-	#impdef $(PSSRCDIR)\gsdll32.def $(GSDLL_DLL)
-	implib $(BINDIR)\$(GSDLL).lib $(PSSRCDIR)\gsdll32.def
-
-!else
-# The big graphical EXE
-$(GS_XE):   $(GSCONSOLE_XE) $(GS_ALL) $(DEVS_ALL)\
- $(PSOBJ)gsdll.$(OBJ) $(DWOBJNO) $(GS_OBJ).res $(PSSRCDIR)\dwmain32.def $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ)
-	-del $(PSGEN)gswin32.tr
-	copy $(ld_tr) $(PSGEN)gswin32.tr
-	echo  $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ) + >> $(PSGEN)gswin32.tr
-	echo $(LIBDIR)\c0w32 $(PSOBJ)gsdll + >> $(PSGEN)gswin32.tr
-	echo $(DWOBJNO) >> $(PSGEN)gswin32.tr
-	$(LINK) /L$(LIBDIR) $(LCT) /Tpe /aa @$(PSGEN)gswin32.tr ,$(GS_XE),$(PSOBJ)$(GS) @$(LIBCTR),$(PSSRCDIR)\dwmain32.def,$(GS_OBJ).res
-
-# The big console mode EXE
-$(GSCONSOLE_XE):  $(GS_ALL) $(DEVS_ALL)\
- $(PSOBJ)gsdll.$(OBJ) $(OBJCNO) $(GS_OBJ).res $(PSSRCDIR)\dw32c.def $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ)
-	-del $(PSGEN)gswin32.tr
-	copy $(ld_tr) $(PSGEN)gswin32.tr
-	echo  $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ) + >> $(PSGEN)gswin32.tr
-	echo $(LIBDIR)\c0w32 $(PSOBJ)gsdll + >> $(PSGEN)gswin32.tr
-	echo $(OBJCNO) >> $(PSGEN)gswin32.tr
-	$(LINK) /L$(LIBDIR) $(LCT) /Tpe /ap @$(PSGEN)gswin32.tr ,$(GSCONSOLE_XE),$(PSOBJ)$(GSCONSOLE) @$(LIBCTR),$(PSSRCDIR)\dw32c.def,$(GS_OBJ).res
-!endif
-
-
-# ---------------------- Setup and uninstall programs ---------------------- #
-
-$(MAKE_FILELIST_XE): $(PSSRC)mkfilelt.cpp
-	$(COMPAUX) -I$(GLSRCDIR) -I$(INCDIR) -L$(LIBDIR) -L$(LIBDIR)\PSDK -W -O -e$(MAKE_FILELIST_XE) $(PSSRC)mkfilelt.cpp $(CCAUX_TAIL)
-
-!if $(MAKEDLL)
-
-$(SETUP_XE): $(PSOBJ)dwsetup.obj $(PSOBJ)dwinst.obj $(PSOBJ)dwsetup.res $(PSSRC)dwsetup.def
-	$(LINK) /Tpe /aa $(LCT) $(DEBUGLINK) -L$(LIBDIR) @&&!
-$(LIBDIR)\c0w32 +
-$(PSOBJ)dwsetup.obj $(PSOBJ)dwinst.obj +
-,$(SETUP_XE),$(PSOBJ)dwsetup, +
-$(LIBDIR)\import32 +
-$(LIBDIR)\ole2w32 +
-$(LIBDIR)\cw32, +
-$(PSSRCDIR)\dwsetup.def, +
-$(PSOBJ)dwsetup.res
-!
-
-$(UNINSTALL_XE): $(PSOBJ)dwuninst.obj $(PSOBJ)dwuninst.res $(PSSRC)dwuninst.def
-	$(LINK) /Tpe /aa $(LCT) $(DEBUGLINK) -L$(LIBDIR) @&&!
-$(LIBDIR)\c0w32 +
-$(PSOBJ)dwuninst.obj +
-,$(UNINSTALL_XE),$(PSOBJ)dwuninst, +
-$(LIBDIR)\import32 +
-$(LIBDIR)\ole2w32 +
-$(LIBDIR)\cw32, +
-$(PSSRCDIR)\dwuninst.def, +
-$(PSOBJ)dwuninst.res
-!
-
-
-!endif
-
-DEBUGDEFS=BINDIR=.\debugbin GLGENDIR=.\debugobj GLOBJDIR=.\debugobj PSLIBDIR=.\lib PSGENDIR=.\debugobj PSOBJDIR=.\debugobj DEBUG=1 TDEBUG=1
-OTHERDEFS=COMPBASE="$(COMPBASE)" AROOTDIR="$(AROOTDIR)" GSROOTDIR="$(GSROOTDIR)" CFLAGS="$(CFLAGS)"
-
-debug:
-	make -f $(MAKEFILE) $(DEBUGDEFS) $(OTHERDEFS)
-
-debugclean:
-	make -f $(MAKEFILE) $(DEBUGDEFS) clean
-
-# end of makefile

Modified: branches/chrisl-test-gs/base/configure.ac
===================================================================
--- branches/chrisl-test-gs/base/configure.ac	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/configure.ac	2010-10-21 09:19:31 UTC (rev 11833)
@@ -78,7 +78,7 @@
 dnl See if it is GNU sed or else.
 dnl - need more work to tell SED features.
 SED_EXTENDED_REGEX_OPT=-nre
-sed_variant=`sed --version`
+sed_variant=`sed --version 2>&1`
 sed_variant=`echo $sed_variant|sed -e 's/ .*//'`
 if test "$sed_variant" != GNU ; then
 SED_EXTENDED_REGEX_OPT=-nEe
@@ -345,7 +345,7 @@
 FONTCONFIG_CFLAGS=""
 FONTCONFIG_LIBS=""
 AC_ARG_ENABLE([fontconfig], AC_HELP_STRING([--disable-fontconfig],
-    [Don't use fontconfig to list system fonts (also implies disable cairo)]))
+    [Don't use fontconfig to list system fonts]))
 if test "$enable_fontconfig" != "no"; then
 	# We MUST NOT use PKG_CHECK_MODULES since it is a) not a standard
 	# autoconf macro and b) requires pkg-config on the system, which is
@@ -485,7 +485,7 @@
 
 AC_MSG_CHECKING([for local zlib source])
 dnl zlib is needed for language level 3, and libpng
-# we must define ZLIBDIR regardless because libpng.mak does a -I$(ZLIBDIR)
+# we must define ZLIBDIR regardless because png.mak does a -I$(ZLIBDIR)
 # this seems a harmless default
 ZLIBDIR=src
 if test -d zlib; then
@@ -541,30 +541,24 @@
 					     [Force using the systems libtiff]),
 	    [], [with_system_libtiff=check])
 TIFFDEVS=''
-TIFFDEVS_ALL='$(DD)tiffs $(DD)tiff12nc $(DD)tiff24nc $(DD)tiff48nc $(DD)tiff32nc $(DD)tiff64nc $(DD)tiffcrle $(DD)tifflzw $(DD)tiffpack $(DD)tiffgray $(DD)tiffsep'
+TIFFDEVS_ALL='$(DD)tiffs $(DD)tiff12nc $(DD)tiff24nc $(DD)tiff48nc $(DD)tiff32nc $(DD)tiff64nc $(DD)tiffcrle $(DD)tifflzw $(DD)tiffpack $(DD)tiffgray $(DD)tiffsep $(DD)tiffscaled'
 case "x$with_system_libtiff" in
     xcheck)
 	if test -d tiff; then
 	    LIBTIFFDIR=tiff
-	    LOCAL_LIBTIFF_VERSION=`sed -n '/TIFFLIB_VERSION[[^_]]/s/[[^0-9]]*\([[0-9]]*\).*/\1/p' $LIBTIFFDIR/libtiff/tiffvers.h`
+	    HAVE_LOCAL_LIBTIFF=1
 	    SHARE_LIBTIFF=0
-	fi
+	else
 	AC_CHECK_LIB(tiff, TIFFOpen,
 		     [AC_CHECK_HEADERS(tiff.h, [HAVE_SYSTEM_LIBTIFF=1;SHARE_LIBTIFF=1])],
 		     [], [-ljpeg])
-	if test -z $LOCAL_LIBTIFF_VERSION && test "x$HAVE_SYSTEM_LIBTIFF" == x; then
+	fi
+	if test "x$HAVE_LOCAL_LIBTIFF" = x && test "x$HAVE_SYSTEM_LIBTIFF" = x; then
 	    AC_MSG_NOTICE([Could not find a copy of libtiff on your system.
 Disabling tiff output devices.])
 	else
 	    TIFFDEVS="$TIFFDEVS_ALL"
 	fi
-	if test ! -z $LOCAL_LIBTIFF_VERSION && test "x$HAVE_SYSTEM_LIBTIFF" != x; then
-	    AC_TRY_COMPILE([#include <tiffvers.h>
-			    #if TIFFLIB_VERSION < $LOCAL_LIBTIFF_VERSION
-			    #error system libtiff is older
-			    #endif], [],
-			    [SHARE_LIBTIFF=1], [SHARE_LIBTIFF=0])
-	fi
 	;;
     xyes)
 	AC_CHECK_LIB(tiff, TIFFOpen,
@@ -725,7 +719,7 @@
   fi
 fi
 if test x$with_jbig2dec != xno; then
-  if test x$ac_cv_header_stdint_h != xyes; then
+  if test x$ac_cv_header_stdint_h != xyes && test x$ac_cv_header_inttypes_h != xyes; then
     AC_MSG_WARN([JBIG2 support requires stdint types which do not seem to be available.])
   else
     JBIG2DEVS='$(PSD)jbig2.dev'
@@ -844,42 +838,13 @@
 AC_SUBST(SOC_LIBS)
 AC_SUBST(SOC_LOADER)
 
-dnl enable the cairo device if the library is available
-AC_ARG_ENABLE([cairo], AC_HELP_STRING([--disable-cairo],
-    [Don't include the cairo output device]))
-CAIRO_DEVS=""
-CAIRO_CFLAGS=""
-CAIRO_LIBS=""
-# Disable cairo if fontconfig is disabled, since cairo depends on fontconfig
-if test -z "$HAVE_FONTCONFIG"; then
-enable_cairo=no
-fi
-
-if test "x$enable_cairo" != xno; then
-  AC_PATH_PROG(PKGCONFIG, pkg-config)
-  if test "x$PKGCONFIG" != x; then
-    AC_MSG_CHECKING([for cairo])
-    if $PKGCONFIG --exists 'cairo >= 1.2.0'; then
-      CAIRO_CFLAGS=`$PKGCONFIG --cflags cairo`
-      CAIRO_LIBS=`$PKGCONFIG --libs cairo`
-      CAIRO_DEVS="cairo"
-      AC_MSG_RESULT([yes])
-    else
-      AC_MSG_RESULT([no])
-    fi
-  fi
-fi
-
-AC_SUBST(CAIRO_CFLAGS)
-AC_SUBST(CAIRO_LIBS)
-
 dnl look for omni implementation
 AC_ARG_WITH([omni], AC_HELP_STRING([--with-omni],
 	[enable the omni driver]))
 dnl set safe defaults
 OMNIDEVS=''
 INCLUDEOMNI=no
-if ( ! test -z "$CONTRIBINCLUDE" ) && ( test x$with_omni == xyes ); then
+if ( ! test -z "$CONTRIBINCLUDE" ) && ( test x$with_omni = xyes ); then
 	INCLUDEOMNI=yes
         OMNIDEVS='$(DD)omni.dev'
 
@@ -986,7 +951,6 @@
 			  PNG      = Output to PNG
                           PS       = Output to PostScript/PDF
                           TIFF     = Output to TIFF
-                          CAIRO    = Output using libcairo
 			  WTS      = WTS Halftoning devices
 			  ETS      = ETS Halftoning devices
                           You can mix both variants, e.g.
@@ -1029,11 +993,10 @@
 FAX_DEVS="cfax dfaxlow dfaxhigh fax tfax tiffg3 tiffg32d tiffg4 faxg3 faxg32d faxg4"
 JPEG_DEVS="jpeg jpeggray jpegcmyk"
 PNG_DEVS="png16 png16m png256 pngalpha pnggray pngmono"
-TIFF_DEVS="tiffs tiff12nc tiff24nc tiff48nc tiff32nc tiff64nc tiffcrle tifflzw tiffpack tiffgray tiffsep tiffsep1"
+TIFF_DEVS="tiffs tiff12nc tiff24nc tiff48nc tiff32nc tiff64nc tiffcrle tifflzw tiffpack tiffgray tiffsep tiffsep1 tiffscaled"
 PCX_DEVS="pcxmono pcxgray pcx16 pcx256 pcx24b pcxcmyk pcx2up"
 PBM_DEVS="pbm pbmraw pgm pgmraw pgnm pgnmraw pnm pnmraw ppm ppmraw pkm pkmraw pksm pksmraw pam"
 PS_DEVS="psdf psdcmyk psdrgb pdfwrite pswrite ps2write epswrite psgray psmono psrgb bbox"
-# CAIRO_DEVS is defined conditionally above
 WTS_HALFTONING_DEVS="imdi simdi wtsimdi wtscmyk"
 MISC_FDEVS="ccr cgm24 cgm8 cgmmono cif inferno mag16 mag256 mgr4 mgr8 mgrgray2 mgrgray4 mgrgray8 mgrmono miff24 plan9bm sgirgb sunhmono bit bitrgb bitrgbtags bitcmyk devicen spotcmyk xcf"
 
@@ -1058,7 +1021,7 @@
 		P_DEVS="$P_DEVS $CANON_DEVS $EPSON_DEVS $HP_DEVS $LEXMARK_DEVS $BROTHER_DEVS $APPLE_DEVS $IBM_DEVS $OKI_DEVS $JAPAN_DEVS $MISC_PDEVS $ETS_HALFTONING_DEVS $OPVP_DEVS"
 		;;
 	FILES)
-		F_DEVS="$F_DEVS $BMP_DEVS $FAX_DEVS $JPEG_DEVS $PNG_DEVS $TIFF_DEVS $PCX_DEVS $PBM_DEVS $PS_DEVS $CAIRO_DEVS $WTS_HALFTONING_DEVS $MISC_FDEVS"
+		F_DEVS="$F_DEVS $BMP_DEVS $FAX_DEVS $JPEG_DEVS $PNG_DEVS $TIFF_DEVS $PCX_DEVS $PBM_DEVS $PS_DEVS $WTS_HALFTONING_DEVS $MISC_FDEVS"
 		;;
 	APPLE)
 		# All Apple printers
@@ -1132,10 +1095,6 @@
 		# PostScript/PDF writing
 		F_DEVS="$F_DEVS $PS_DEVS"
 		;;
-	CAIRO)
-		$ cairo output device
-		F_DEVS="$F_DEVS $CAIRO_DEVS"
-		;;
 	WTS)
 		# WTS Halftoning devices
 		F_DEVS="$F_DEVS $WTS_HALFTONING_DEVS"

Modified: branches/chrisl-test-gs/base/devs.mak
===================================================================
--- branches/chrisl-test-gs/base/devs.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/devs.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -183,6 +183,7 @@
 #	tiffsep1  Creates halftoned tiff 1-bit per pixel for each colorant
 #	tifflzw  TIFF LZW (tag = 5) (monochrome)
 #	tiffpack  TIFF PackBits (tag = 32773) (monochrome)
+#	tiffscaled  TIFF (monochrome output, integer downsampled and dithered from grayscale rendering)
 
 # Note that MS Windows-specific drivers are defined in pcwin.mak, not here,
 # because they have special compilation requirements that require defining
@@ -438,8 +439,7 @@
 
 # See the main makefile for the definition of XLIBDIRS and XLIBS.
 x11_=$(GLOBJ)gdevx.$(OBJ) $(GLOBJ)gdevxcmp.$(OBJ) $(GLOBJ)gdevxini.$(OBJ)\
- $(GLOBJ)gdevxres.$(OBJ) $(GLOBJ)gdevxxf.$(OBJ)\
- $(GLOBJ)gdevemap.$(OBJ) $(GLOBJ)gsparamx.$(OBJ)
+ $(GLOBJ)gdevxres.$(OBJ) $(GLOBJ)gdevxxf.$(OBJ)
 $(DD)x11_.dev : $(DEVS_MAK) $(x11_) $(GLD)bboxutil.dev
 	$(SETMOD) $(DD)x11_ $(x11_)
 	$(ADDMOD) $(DD)x11_ -link $(XLIBDIRS)
@@ -457,7 +457,7 @@
 	$(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevx.$(OBJ) $(C_) $(GLSRC)gdevx.c
 
 $(GLOBJ)gdevxcmp.$(OBJ) : $(GLSRC)gdevxcmp.c $(GDEVX) $(math__h)
-	$(GLCC) $(XINCLUDE) $(GLO_)gdevxcmp.$(OBJ) $(C_) $(GLSRC)gdevxcmp.c
+	$(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxcmp.$(OBJ) $(C_) $(GLSRC)gdevxcmp.c
 
 $(GLOBJ)gdevxini.$(OBJ) : $(GLSRC)gdevxini.c $(GDEVX) $(memory__h)\
  $(gserrors_h) $(gsparamx_h) $(gxdevmem_h) $(gdevbbox_h)
@@ -744,7 +744,7 @@
  $(scfx_h) $(slzwx_h) $(spngpx_h)\
  $(strimpl_h) $(szlibx_h)\
  $(gdevpsdf_h) $(gdevpsds_h) $(gxdevmem_h) $(gxcspace_h) $(gxparamx_h)\
- $(sjbig2_luratech_h) $(sjpx_luratech_h)
+ $(sjbig2_luratech_h) $(sjpx_luratech_h) $(gsicc_manage_h)
 	$(GDEVLWFJB2JPXCC) $(GLO_)gdevpsdi.$(OBJ) $(C_) $(GLSRC)gdevpsdi.c
 
 $(GLOBJ)gdevpsdp.$(OBJ) : $(GLSRC)gdevpsdp.c $(GDEVH)\
@@ -866,7 +866,8 @@
 $(GLOBJ)gdevpdfb.$(OBJ) : $(GLSRC)gdevpdfb.c\
  $(string__h) $(gx_h)\
  $(gdevpdfg_h) $(gdevpdfo_h) $(gdevpdfx_h)\
- $(gserrors_h) $(gxcspace_h) $(gxdcolor_h) $(gxpcolor_h) $(gxhldevc_h)
+ $(gserrors_h) $(gxcspace_h) $(gxdcolor_h) $(gxpcolor_h) $(gxhldevc_h)\
+ $(gsptype1_h)
 	$(GLCC) $(GLO_)gdevpdfb.$(OBJ) $(C_) $(GLSRC)gdevpdfb.c
 
 $(GLOBJ)gdevpdfc.$(OBJ) : $(GLSRC)gdevpdfc.c $(GXERR) $(math__h) $(memory__h)\
@@ -981,6 +982,7 @@
 gdevpdtt_h=$(GLSRC)gdevpdtt.h
 gdevpdtv_h=$(GLSRC)gdevpdtv.h
 gdevpdtw_h=$(GLSRC)gdevpdtw.h
+whitelst_h=$(GLSRC)whitelst.h
 
 # We reserve space for all of a..z, just in case.
 pdxtext_ab=$(GLOBJ)gdevpdt.$(OBJ) $(GLOBJ)gdevpdtb.$(OBJ)
@@ -990,7 +992,7 @@
 pdxtext_lmn=
 pdxtext_opq=
 pdxtext_rst=$(GLOBJ)gdevpdts.$(OBJ) $(GLOBJ)gdevpdtt.$(OBJ)
-pdxtext_uvw=$(GLOBJ)gdevpdtv.$(OBJ) $(GLOBJ)gdevpdtw.$(OBJ)
+pdxtext_uvw=$(GLOBJ)gdevpdtv.$(OBJ) $(GLOBJ)gdevpdtw.$(OBJ) $(GLOBJ)whitelst.$(OBJ)
 pdxtext_xyz=
 pdxtext_=$(pdxtext_ab) $(pdxtext_cde) $(pdxtext_fgh) $(pdxtext_ijk)\
  $(pdxtext_lmn) $(pdxtext_opq) $(pdxtext_rst) $(pdxtext_uvw) $(pdxtext_xyz)\
@@ -1073,6 +1075,9 @@
  $(gdevpdtd_h) $(gdevpdtf_h) $(gdevpdti_h) $(gdevpdtw_h) $(gdevpdtv_h) $(sarc4_h)
 	$(GLCC) $(GLO_)gdevpdtw.$(OBJ) $(C_) $(GLSRC)gdevpdtw.c
 
+$(GLOBJ)whitelst.$(OBJ) : $(GLSRC)whitelst.c $(whitelst_h)
+	$(GLCC) $(GLO_)whitelst.$(OBJ) $(C_) $(GLSRC)whitelst.c
+
 ################ END PDF WRITER ################
 
 # High-level PCL XL writer
@@ -1104,17 +1109,6 @@
 $(GLOBJ)gdevsvg.$(OBJ) : $(GLSRC)gdevsvg.c $(gx_h) $(gdevvec_h)
 	$(GLCC) $(GLO_)gdevsvg.$(OBJ) $(C_) $(GLSRC)gdevsvg.c
 
-# cairo output device
-
-cairo_=$(GLOBJ)gdevcairo.$(OBJ)
-$(DD)cairo.dev : $(DEVS_MAK) $(cairo_) $(GDEV) $(GLD)vector.dev
-	$(SETDEV2) $(DD)cairo $(cairo_)
-	$(ADDMOD) $(DD)cairo -include $(GLD)vector
-	$(ADDMOD) $(DD)cairo -lib cairo
-
-$(GLOBJ)gdevcairo.$(OBJ) : $(GLSRC)gdevcairo.c $(gx_h) $(gdevvec_h)
-	$(GLCC) $(GLO_)gdevcairo.$(OBJ) $(C_) $(GLSRC)gdevcairo.c $(CAIRO_CFLAGS) $(CAIRO_LIBS)
-
 ###### --------------------- Raster file formats --------------------- ######
 
 ### --------------------- The "plain bits" devices ---------------------- ###
@@ -1490,7 +1484,7 @@
 
 ### --------------- Portable Network Graphics file format --------------- ###
 ### Requires libpng 0.81 and zlib 0.95 (or more recent versions).         ###
-### See libpng.mak and zlib.mak for more details.                         ###
+### See png.mak and zlib.mak for more details.                         ###
 
 png__h=$(GLSRC)png_.h $(MAKEFILE)
 
@@ -1698,7 +1692,7 @@
 
 # TIFF Gray, no compression
 
-tiffgray_=$(GLOBJ)gdevtsep.$(OBJ)
+tiffgray_=$(GLOBJ)gdevtsep.$(OBJ) $(GLOBJ)gsequivc.$(OBJ)
 
 $(DD)tiffgray.dev : $(DEVS_MAK) $(libtiff_dev) $(tiffgray_) $(DD)tiffs.dev
 	$(SETPDEV2) $(DD)tiffgray $(tiffgray_)
@@ -1708,6 +1702,14 @@
 	$(gdevdevn_h) $(gsequivc_h) $(stdio__h) $(ctype__h)
 	$(GLCC) $(I_)$(TI_)$(_I) $(GLO_)gdevtsep.$(OBJ) $(C_) $(GLSRC)gdevtsep.c
 
+# TIFF Scaled (downscaled gray -> mono), configurable compression
+
+tiffscaled_=$(tiffgray_) $(GLOBJ)gdevtsep.$(OBJ)
+
+$(DD)tiffscaled.dev : $(DEVS_MAK) $(libtiff_dev) $(tiffscaled_) $(DD)tiffs.dev
+	$(SETPDEV2) $(DD)tiffscaled $(tiffscaled_)
+	$(ADDMOD) $(DD)tiffscaled -include $(DD)tiffs $(tiff_i_)
+
 # TIFF RGB, no compression
 
 tiffrgb_=$(GLOBJ)gdevtfnx.$(OBJ)

Modified: branches/chrisl-test-gs/base/gdevbbox.c
===================================================================
--- branches/chrisl-test-gs/base/gdevbbox.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevbbox.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -146,7 +146,8 @@
      NULL,			/* ret_devn_params */
      bbox_fillpage,		/* fillpage */
      NULL,                      /* push_transparency_state */
-     NULL                       /* pop_transparency_state */
+     NULL,                      /* pop_transparency_state */
+     NULL                       /* put_image */
     },
     0,				/* target */
     1,				/*true *//* free_standing */
@@ -1172,7 +1173,7 @@
 static int
 bbox_create_compositor(gx_device * dev,
 		       gx_device ** pcdev, const gs_composite_t * pcte,
-		       gs_imager_state * pis, gs_memory_t * memory, gx_device *cdev)
+		       gs_imager_state * pis, gs_memory_t * memory, gx_device *cindev)
 {
     gx_device_bbox *const bdev = (gx_device_bbox *) dev;
     gx_device *target = bdev->target;
@@ -1191,13 +1192,13 @@
      * box in the same place.
      */
     {
-	gx_device *cdev;
+	gx_device *temp_cdev;
 	gx_device_bbox *bbcdev;
 	int code = (*dev_proc(target, create_compositor))
-	    (target, &cdev, pcte, pis, memory, cdev);
+	    (target, &temp_cdev, pcte, pis, memory, cindev);
 
 	/* If the target did not create a new compositor then we are done. */
-	if (code < 0 || target == cdev) {
+	if (code < 0 || target == temp_cdev) {
 	    *pcdev = dev;
 	    return code;
 	}
@@ -1205,11 +1206,11 @@
 					   &st_device_bbox,
 					   "bbox_create_compositor");
 	if (bbcdev == 0) {
-	    (*dev_proc(cdev, close_device)) (cdev);
+	    (*dev_proc(temp_cdev, close_device)) (temp_cdev);
 	    return_error(gs_error_VMerror);
 	}
 	gx_device_bbox_init(bbcdev, target, memory);
-	gx_device_set_target((gx_device_forward *)bbcdev, cdev);
+	gx_device_set_target((gx_device_forward *)bbcdev, temp_cdev);
 	bbcdev->box_procs = box_procs_forward;
 	bbcdev->box_proc_data = bdev;
 	*pcdev = (gx_device *) bbcdev;

Modified: branches/chrisl-test-gs/base/gdevbit.c
===================================================================
--- branches/chrisl-test-gs/base/gdevbit.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevbit.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -46,6 +46,8 @@
 static dev_proc_get_params(bit_get_params);
 static dev_proc_put_params(bit_put_params);
 static dev_proc_print_page(bit_print_page);
+static dev_proc_print_page(bittags_print_page);
+static dev_proc_put_image(bit_put_image);
 
 #define bit_procs(encode_color)\
 {	gdev_prn_open,\
@@ -204,7 +206,19 @@
         bittag_get_color_mapping_procs,      /* get_color_mapping_procs */
         ((void *)0),                       /* get_color_comp_index */
         bittag_rgb_map_rgb_color,            /* encode_color */
-        bittag_map_color_rgb                 /* decode_color */
+        bittag_map_color_rgb,               /* decode_color */
+        ((void *)0),                        /* pattern_manage */ 
+        ((void *)0),                        /* fill_rectangle_hl_color */ 
+        ((void *)0),                        /* include_color_space */ 
+        ((void *)0),                        /* fill_linear_color_scanline */ 
+        ((void *)0),                        /* fill_linear_color_trapezoid */ 
+        ((void *)0),                        /* fill_linear_color_triangle */ 
+        ((void *)0),                        /* update_spot_equivalent_colors */ 
+        ((void *)0),                        /* ret_devn_params */ 
+        ((void *)0),                        /* fillpage */ 
+        ((void *)0),                        /* push_transparency_state */ 
+        ((void *)0),                        /* pop_transparency_state */ 
+        bit_put_image                        /* put_image */ 
     };
 
 const gx_device_bit gs_bitrgbtags_device =
@@ -221,8 +235,8 @@
         0 ,                             /* is open */
         0,                              /* max_fill_band */
         {                               /* color infor */
-            4,                          /* max_components */
-            4,                          /* num_components */
+            3,                          /* max_components */
+            3,                          /* num_components */
             GX_CINFO_POLARITY_ADDITIVE, /* polarity */
             32,                         /* depth */                        
             GX_CINFO_COMP_NO_INDEX,     /* gray index */
@@ -232,10 +246,10 @@
             256 ,                         /* dither colors */
             { 1, 1 } ,                  /* antialiasing */
             GX_CINFO_UNKNOWN_SEP_LIN,   /* sep and linear */
-            { 0 } ,                     /* comp shift */
-            { 0 } ,                     /* comp bits */
-            { 0 } ,                     /* comp mask */
-            ( "DeviceRGB" ),            /* color model name */
+	    { 16, 8, 0, 0 } ,                    /* comp shift */
+	    { 8, 8, 8, 8 } ,                     /* comp bits */
+	    { 0xFF0000, 0x00FF00, 0x0000FF } ,     /* comp mask */
+            ( "DeviceRGBT" ),            /* color model name */
             GX_CINFO_OPMODE_UNKNOWN ,   /* overprint mode */
             0                           /* process comps */
         },
@@ -274,6 +288,8 @@
 	0,
 	0,
 	{false},
+	0,
+	0,
         { 
             gx_default_install,
             gx_default_begin_page,
@@ -281,7 +297,7 @@
         },
         { 0 },
         { 0 },
-        { bit_print_page,
+        { bittags_print_page,
           gx_default_print_page_copies,
           { gx_default_create_buf_device,
             gx_default_size_buf_device,
@@ -297,7 +313,7 @@
             PRN_BUFFER_SPACE,
             { 0, 0, 0 },
             0 ,
-            BandingAlways },
+            BandingAuto },
         { 0 },
         0 ,
         0 ,
@@ -321,7 +337,7 @@
 cmyk_cs_to_rgb_cm(gx_device * dev, frac c, frac m, frac y, frac k, frac out[])
 {
     color_cmyk_to_rgb(c, m, y, k, NULL, out, dev->memory);
-};
+}
 
 static void
 private_rgb_cs_to_rgb_cm(gx_device * dev, const gs_imager_state *pis,
@@ -690,3 +706,78 @@
     gs_free_object(pdev->memory, in, "bit_print_page(in)");
     return 0;
 }
+
+/* For tags device go ahead and add in the size so that we can strip and create
+   proper ppm outputs for various dimensions and not be restricted to 72dpi when
+   using the tag viewer */
+static int
+bittags_print_page(gx_device_printer * pdev, FILE * prn_stream)
+{				/* Just dump the bits on the file. */
+    /* If the file is 'nul', don't even do the writes. */
+    int line_size = gdev_mem_bytes_per_scan_line((gx_device *) pdev);
+    byte *in = gs_alloc_bytes(pdev->memory, line_size, "bit_print_page(in)");
+    byte *data;
+    int nul = !strcmp(pdev->fname, "nul") || !strcmp(pdev->fname, "/dev/null");
+    int lnum = ((gx_device_bit *)pdev)->FirstLine >= pdev->height ?  pdev->height - 1 :
+		 ((gx_device_bit *)pdev)->FirstLine;
+    int bottom = ((gx_device_bit *)pdev)->LastLine >= pdev->height ?  pdev->height - 1 :
+		 ((gx_device_bit *)pdev)->LastLine;
+    int line_count = any_abs(bottom - lnum);
+    int i, step = lnum > bottom ? -1 : 1;
+
+    if (in == 0)
+	return_error(gs_error_VMerror);
+
+    fprintf(prn_stream, "P6\n%d %d\n255\n", pdev->width, pdev->height);
+    if ((lnum == 0) && (bottom == 0))
+	line_count = pdev->height - 1;		/* default when LastLine == 0, FirstLine == 0 */
+    for (i = 0; i <= line_count; i++, lnum += step) {
+	gdev_prn_get_bits(pdev, lnum, in, &data);
+	if (!nul)
+	    fwrite(data, 1, line_size, prn_stream);
+    }
+    gs_free_object(pdev->memory, in, "bit_print_page(in)");
+    return 0;
+}
+
+static int
+bit_put_image(gx_device *pdev, const byte *buffer, int num_chan, int xstart, 
+              int ystart, int width, int height, int row_stride, 
+              int plane_stride, int alpha_plane_index, int tag_plane_index)
+{
+    gx_device_memory *pmemdev = (gx_device_memory *)pdev;
+    byte *buffer_prn;
+    int yend = ystart + height;
+    int xend = xstart + width;
+    int x, y, k;
+    int src_position, des_position;
+
+    if (alpha_plane_index != 0)
+        return 0;                /* we don't want alpha, return 0 to ask for the    */
+                                 /* pdf14 device to do the alpha composition        */
+    /* Eventually, the pdf14 device might be chunky pixels, punt for now */
+    if (plane_stride == 0)
+        return 0;
+    if (num_chan != 3 || tag_plane_index <= 0)
+            return_error(gs_error_unknownerror);        /* can't handle these cases */
+    /* Drill down to get the appropriate memory buffer pointer */
+    buffer_prn = pmemdev->base;
+    /* Now go ahead and fill */
+    for ( y = ystart; y < yend; y++ ) {
+        src_position = (y - ystart) * row_stride;
+        des_position = y * pmemdev->raster + xstart * 4;
+        for ( x = xstart; x < xend; x++ ) {
+            /* Tag data first, then RGB */
+            buffer_prn[des_position] = 
+                buffer[src_position + tag_plane_index * plane_stride];
+                des_position += 1;
+            for ( k = 0; k < 3; k++) {
+                buffer_prn[des_position] = 
+                    buffer[src_position + k * plane_stride];
+                    des_position += 1;
+            }
+            src_position += 1;
+        }
+    }
+    return height;        /* we used all of the data */
+}

Deleted: branches/chrisl-test-gs/base/gdevcairo.c
===================================================================
--- branches/chrisl-test-gs/base/gdevcairo.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevcairo.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1,753 +0,0 @@
-/* Copyright (C) 2007-2008 Artifex Software, Inc.
-   All Rights Reserved.
-
-   This software is provided AS-IS with no warranty, either express or
-   implied.
-
-   This software is distributed under license and may not be copied, modified
-   or distributed except as expressly authorized under the terms of that
-   license.  Refer to licensing information at http://www.artifex.com/
-   or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
-   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
-*/
-
-/* $Id$ */
-/* cairo output device - contributed by Behdad Esfahbod */
-
-#include <cairo.h>
-
-#include "gx.h"
-#include "gserrors.h"
-#include "gdevvec.h"
-#include "gsutil.h"
-#include "memory_.h"
-#include "stream.h"
-#include "string_.h"
-#include "stdlib.h"
-
-/* default resolution. */
-#ifndef X_DPI
-#  define X_DPI 300
-#endif
-#ifndef Y_DPI
-#  define Y_DPI 300
-#endif
-
-/* ---------------- Device definition ---------------- */
-
-#define OUTPUT_PARAM_NAME  "CairoOptions"
-#define CONTEXT_PARAM_NAME "CairoContext"
-
-typedef struct gx_device_cairo_s {
-    /* superclass state */
-    gx_device_vector_common;
-    /* local state */
-    cairo_t *cr;
-    cairo_pattern_t *stroke_pattern;
-    cairo_pattern_t *fill_pattern;
-
-    char *output_param;
-    char *context_param;
-
-    cairo_bool_t should_close_file;
-    cairo_bool_t should_write_png;
-} gx_device_cairo;
-
-#define devcairo_device_body(dname, depth)\
-  std_device_dci_type_body(gx_device_cairo, 0, dname, &st_device_cairo, \
-			   DEFAULT_WIDTH_10THS * X_DPI / 10, \
-			   DEFAULT_HEIGHT_10THS * Y_DPI / 10, \
-			   X_DPI, Y_DPI, \
-			   (depth > 8 ? 3 : 1), depth, \
-			   (depth > 1 ? 255 : 1), (depth > 8 ? 255 : 0), \
-			   (depth > 1 ? 256 : 2), (depth > 8 ? 256 : 1))
-
-static dev_proc_open_device(devcairo_open_device);
-static dev_proc_sync_output(devcairo_sync_output);
-static dev_proc_output_page(devcairo_output_page);
-static dev_proc_close_device(devcairo_close_device);
-
-static dev_proc_get_params(devcairo_get_params);
-static dev_proc_put_params(devcairo_put_params);
-
-#define devcairo_device_procs \
-{ \
-	devcairo_open_device, \
-        NULL,                   /* get_initial_matrix */\
-        devcairo_sync_output,\
-        devcairo_output_page,\
-        devcairo_close_device,\
-        gx_default_rgb_map_rgb_color,\
-        gx_default_rgb_map_color_rgb,\
-        gdev_vector_fill_rectangle,\
-        NULL,                   /* tile_rectangle */\
-        NULL,			/* copy_mono */\
-        NULL,			/* copy_color */\
-        NULL,                   /* draw_line */\
-        NULL,                   /* get_bits */\
-        devcairo_get_params,\
-        devcairo_put_params,\
-        NULL,                   /* map_cmyk_color */\
-        NULL,                   /* get_xfont_procs */\
-        NULL,                   /* get_xfont_device */\
-        NULL,                   /* map_rgb_alpha_color */\
-        gx_page_device_get_page_device,\
-        NULL,                   /* get_alpha_bits */\
-        NULL,                   /* copy_alpha */\
-        NULL,                   /* get_band */\
-        NULL,                   /* copy_rop */\
-        gdev_vector_fill_path,\
-        gdev_vector_stroke_path,\
-        NULL,			/* fill_mask */\
-        gdev_vector_fill_trapezoid,\
-        gdev_vector_fill_parallelogram,\
-        gdev_vector_fill_triangle,\
-        NULL,			/* draw_thin_line */\
-        NULL,			/* begin_image */\
-        NULL,                   /* image_data */\
-        NULL,                   /* end_image */\
-        NULL,                   /* strip_tile_rectangle */\
-        NULL			/* strip_copy_rop */\
-}
-
-gs_public_st_suffix_add0_final(st_device_cairo, gx_device_cairo,
-                               "gx_device_cairo",
-                               device_cairo_enum_ptrs, 
-			       device_cairo_reloc_ptrs,
-                               gx_device_finalize,
-			       st_device_vector);
-
-const gx_device_cairo gs_cairo_device = {
-    devcairo_device_body("cairo", 24),
-    devcairo_device_procs
-};
-
-/* Vector device procedures */
-
-static int
-devcairo_beginpage(gx_device_vector *vdev);
-static int
-devcairo_setlinewidth(gx_device_vector *vdev, floatp width);
-static int
-devcairo_setlinecap(gx_device_vector *vdev, gs_line_cap cap);
-static int
-devcairo_setlinejoin(gx_device_vector *vdev, gs_line_join join);
-static int
-devcairo_setmiterlimit(gx_device_vector *vdev, floatp limit);
-static int
-devcairo_setdash(gx_device_vector *vdev, const float *pattern,
-	    uint count, floatp offset);
-static int
-devcairo_setlogop(gx_device_vector *vdev, gs_logical_operation_t lop,
-	     gs_logical_operation_t diff);
-
-static int
-devcairo_can_handle_hl_color(gx_device_vector *vdev, const gs_imager_state *pis,
-			const gx_drawing_color * pdc);
-static int
-devcairo_setfillcolor(gx_device_vector *vdev, const gs_imager_state *pis,
-                 const gx_drawing_color *pdc);
-static int
-devcairo_setstrokecolor(gx_device_vector *vdev, const gs_imager_state *pis,
-		   const gx_drawing_color *pdc);
-
-static int
-devcairo_beginpath(gx_device_vector *vdev, gx_path_type_t type);
-
-static int
-devcairo_moveto(gx_device_vector *vdev, floatp x0, floatp y0,
-	   floatp x, floatp y, gx_path_type_t type);
-static int
-devcairo_lineto(gx_device_vector *vdev, floatp x0, floatp y0,
-	   floatp x, floatp y, gx_path_type_t type);
-static int
-devcairo_curveto(gx_device_vector *vdev, floatp x0, floatp y0,
-	    floatp x1, floatp y1, floatp x2, floatp y2,
-	    floatp x3, floatp y3, gx_path_type_t type);
-static int
-devcairo_closepath(gx_device_vector *vdev, floatp x, floatp y,
-	      floatp x_start, floatp y_start, gx_path_type_t type);
-static int
-devcairo_endpath(gx_device_vector *vdev, gx_path_type_t type);
-
-/* Vector device function table */
-
-static const gx_device_vector_procs devcairo_vector_procs = {
-        /* Page management */
-    devcairo_beginpage,
-        /* Imager state */
-    devcairo_setlinewidth,
-    devcairo_setlinecap,
-    devcairo_setlinejoin,
-    devcairo_setmiterlimit,
-    devcairo_setdash,
-    gdev_vector_setflat,
-    devcairo_setlogop,
-        /* Other state */
-    devcairo_can_handle_hl_color,
-    devcairo_setfillcolor,
-    devcairo_setstrokecolor,
-        /* Paths */
-    gdev_vector_dopath,
-    gdev_vector_dorect,
-    devcairo_beginpath,
-    devcairo_moveto,
-    devcairo_lineto,
-    devcairo_curveto,
-    devcairo_closepath,
-    devcairo_endpath
-};
-
-/* local utility prototypes */
-
-/* Driver procedure implementation */
-
-static cairo_status_t
-devcairo_write_func (void                *closure,
-		     const unsigned char *data,
-		     unsigned int         length)
-{
-    gx_device_cairo *const devcairo = (gx_device_cairo*)closure;
-    gx_device_vector *const vdev = (gx_device_vector*)devcairo;
-
-    stream *s = gdev_vector_stream(vdev);
-    uint used;
-
-    sputs(s, (const byte *)data, length, &used);
-
-    return (length == used) ? CAIRO_STATUS_SUCCESS : CAIRO_STATUS_WRITE_ERROR;
-}
-
-#ifdef CAIRO_HAS_SVG_SURFACE
-#    include <cairo-svg.h>
-#endif
-#ifdef CAIRO_HAS_PDF_SURFACE
-#    include <cairo-pdf.h>
-#endif
-#ifdef CAIRO_HAS_PS_SURFACE
-#    include <cairo-ps.h>
-#  if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,6,0)
-#    define HAS_EPS 1
-#  else
-#    undef HAS_EPS
-#  endif
-#endif
-
-/* Open the device */
-static int
-devcairo_open_device(gx_device *dev)
-{
-    gx_device_vector *const vdev = (gx_device_vector*)dev;
-    gx_device_cairo *const devcairo = (gx_device_cairo*)dev;
-    int code = 0;
-
-    cairo_t *cr = NULL;
-
-    cairo_bool_t scale_to_points = false;
-
-    vdev->v_memory = dev->memory;
-    vdev->vec_procs = &devcairo_vector_procs;
-    gdev_vector_init(vdev);
-
-    if (!!vdev->fname[0] == !!devcairo->context_param) {
-        return gs_throw(gs_error_undefinedfilename, "Either "CONTEXT_PARAM_NAME" or OutputFile should be set, and not both.\nTo render to a file, set OutputFile, and if needed "OUTPUT_PARAM_NAME".\nTo render to a cairo_t, set "CONTEXT_PARAM_NAME" to a hex printout of the pointer, prefixed by '0x'.");
-    }
-
-    devcairo->should_close_file = false;
-    devcairo->should_write_png = false;
-
-    if (vdev->fname[0]) {
-	const char *extension;
-	cairo_surface_t *surface;
-
-	code = gdev_vector_open_file_options(vdev, 512, VECTOR_OPEN_FILE_SEQUENTIAL);
-	if (code < 0) return code;
-
-	devcairo->should_close_file = true;
-
-	if (devcairo->output_param)
-	    extension = devcairo->output_param;
-	else {
-	    extension = strrchr (vdev->fname, '.');
-	    if (extension)
-		extension++; /* skip the dot */
-	}
-
-	if (0)
-	  ;
-	#ifdef CAIRO_HAS_PNG_FUNCTIONS
-	    else if (extension && 0 == strcasecmp (extension, "png")) {
-	        surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, dev->width, dev->height);
-		devcairo->should_write_png = true;
-	    }
-	#endif
-	#ifdef CAIRO_HAS_SVG_SURFACE
-	    else if (extension && 0 == strcasecmp (extension, "svg")) {
-		surface = cairo_svg_surface_create_for_stream (devcairo_write_func, dev, dev->MediaSize[0], dev->MediaSize[1]);
-		scale_to_points = true;
-	    }
-	#endif
-	#ifdef CAIRO_HAS_PDF_SURFACE
-	    else if (extension && 0 == strcasecmp (extension, "pdf")) {
-		surface = cairo_pdf_surface_create_for_stream (devcairo_write_func, dev, dev->MediaSize[0], dev->MediaSize[1]);
-		scale_to_points = true;
-	    }
-	#endif
-	#ifdef CAIRO_HAS_PS_SURFACE
-	    else if (extension && 0 == strcasecmp (extension, "ps")) {
-		surface = cairo_ps_surface_create_for_stream (devcairo_write_func, dev, dev->MediaSize[0], dev->MediaSize[1]);
-		scale_to_points = true;
-	    }
-	  #ifdef HAS_EPS
-	    else if (extension && 0 == strcasecmp (extension, "eps")) {
-		surface = cairo_ps_surface_create_for_stream (devcairo_write_func, dev, dev->MediaSize[0], dev->MediaSize[1]);
-		cairo_ps_surface_set_eps (surface, true);
-		scale_to_points = true;
-	    }
-	  #endif
-	#endif
-	else {
-	    const char *s1, *s2;
-	    s1 = devcairo->output_param ?
-		 OUTPUT_PARAM_NAME " value '%s' is not a recognized output format.\n%s" :
-		 "OutputFile has %s extension.\nThat is not a recognized output format.\nSet "OUTPUT_PARAM_NAME" to select output format.\n%s";
-	    s2 = "It should be one of"
-	    #ifdef CAIRO_HAS_PNG_FUNCTIONS
-	        " png"
-	    #endif
-	    #ifdef CAIRO_HAS_SVG_SURFACE
-		", svg"
-	    #endif
-	    #ifdef CAIRO_HAS_PDF_SURFACE
-		", pdf"
-	    #endif
-	    #ifdef CAIRO_HAS_PS_SURFACE
-		", ps"
-	      #ifdef HAS_EPS
-		", eps"
-	      #endif
-	    #endif
-		".";
-
-	    return gs_throw2(gs_error_invalidfileaccess, s1, extension ? extension : "no", s2);
-	}
-
-	cairo_surface_set_fallback_resolution (surface, dev->HWResolution[0], dev->HWResolution[1]);
-
-	cr = cairo_create (surface);
-	cairo_surface_destroy (surface);
-
-    } else {
-	int len = -1;
-
-        if (sscanf (devcairo->context_param, "0x%p%n", &cr, &len) < 1 || len != strlen (devcairo->context_param) || !cr)
-	 {
-	    return gs_throw1(gs_error_undefined, "Failed to understand "CONTEXT_PARAM_NAME" value '%s'.\nSet "CONTEXT_PARAM_NAME" to a hex printout of the cairo_t pointer, prefixed by '0x'.", devcairo->context_param);
-	 }
-
-	if (cairo_status (cr) != CAIRO_STATUS_SUCCESS)
-	    return gs_throw1(gs_error_unknownerror, "The cairo_t at '%s' passed as "CONTEXT_PARAM_NAME" is already in error status.", devcairo->context_param);
-
-	cairo_reference (cr);
-    }
-
-    devcairo->cr = cr;
-
-    cairo_save (cr);
-    cairo_set_source_rgb (cr, 0., 0., 0.);
-    devcairo->fill_pattern = cairo_pattern_reference (cairo_get_source (cr));
-    devcairo->stroke_pattern = cairo_pattern_reference (cairo_get_source (cr));
-
-    if (scale_to_points)
-	cairo_scale (devcairo->cr,
-		     72. / dev->HWResolution[0],
-		     72. / dev->HWResolution[1]);
-
-    return code;
-}
-
-static int
-devcairo_check_status (gx_device_cairo *devcairo)
-{
-    /* little trick to check both surface and context status */
-    switch (cairo_surface_status (cairo_get_target (devcairo->cr))) {
-    case CAIRO_STATUS_SUCCESS:		return 0;
-    case CAIRO_STATUS_WRITE_ERROR:	return gs_error_ioerror;
-    case CAIRO_STATUS_NO_MEMORY:	return gs_error_VMerror;
-    case CAIRO_STATUS_NO_CURRENT_POINT:	return gs_error_nocurrentpoint;
-    default:				return gs_error_unknownerror;
-    }
-}
-
-int
-devcairo_sync_output(gx_device * dev)
-{
-    gx_device_cairo *const devcairo = (gx_device_cairo*)dev;
-    int code = 0;
-
-    cairo_surface_flush (cairo_get_target (devcairo->cr));
-
-    code = devcairo_check_status (devcairo);
-    if (code < 0) return_error (code);
-
-    return 0;
-}
-
-/* Complete a page */
-static int
-devcairo_output_page(gx_device *dev, int num_copies, int flush)
-{
-    gx_device_cairo *const devcairo = (gx_device_cairo*)dev;
-    int code = 0;
-    int i;
-
-    for (i = num_copies - 1; i > 0; i++)
-	cairo_copy_page (devcairo->cr);
-
-    if (flush)
-	cairo_show_page (devcairo->cr);
-    else
-	cairo_copy_page (devcairo->cr);
-
-    code = devcairo_check_status (devcairo);
-    if (code < 0) return_error (code);
-
-    return gx_finish_output_page(dev, num_copies, flush);
-}
-
-/* Close the device */
-static int
-devcairo_close_device(gx_device *dev)
-{
-    gx_device_cairo *const devcairo = (gx_device_cairo*)dev;
-    int code = 0, ecode;
-
-    if (devcairo->should_close_file) {
-	cairo_surface_t *surface = cairo_get_target (devcairo->cr);
-
-#ifdef CAIRO_HAS_PNG_FUNCTIONS
-	if (devcairo->should_write_png) {
-	    cairo_surface_write_to_png_stream (surface, devcairo_write_func, devcairo);
-	    devcairo->should_write_png = false;
-	}
-#endif
-
-	cairo_surface_finish (surface);
-
-	code = gdev_vector_close_file((gx_device_vector*)dev);
-	devcairo->should_close_file = false;
-    }
-
-    ecode = devcairo_check_status (devcairo);
-    if (ecode < 0) {
-	gs_note_error (ecode);
-	if (code >= 0) code = ecode;
-    }
-
-    cairo_restore (devcairo->cr);
-    cairo_destroy (devcairo->cr);
-
-    return code;
-}
-
-/* Respond to a device parameter query from the client */
-static int
-devcairo_get_params(gx_device *dev, gs_param_list *plist)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo *)dev;
-    int code = gdev_vector_get_params(dev, plist);
-
-    if (code < 0) return code;
-
-#define write_string_param(param, ParamName) \
-    do {	\
-	gs_param_string ofns;	\
-	ofns.data = (const byte *)(param ? param : "");	\
-	ofns.size = param ? strlen(param) : 0;	\
-	ofns.persistent = false;	\
-	if ((code = param_write_string(plist, ParamName, &ofns)) < 0)	\
-	    return code;	\
-    } while (0)
-
-    write_string_param (devcairo->output_param, OUTPUT_PARAM_NAME);
-    write_string_param (devcairo->context_param, CONTEXT_PARAM_NAME);
-
-    return code;
-}
-
-/* Read the device parameters passed to us by the client */
-static int
-devcairo_put_params(gx_device *dev, gs_param_list *plist)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo *)dev;
-    int code = 0;
-
-    if (code < 0) return code;
-
-#define read_string_param(param,ParamName) \
-    do {	\
-	gs_param_name param_name;	\
-	gs_param_string ofns;	\
-	switch (code = param_read_string(plist, (param_name = ParamName), &ofns)) {	\
-	    case 0:	\
-		if (param && !bytes_compare(ofns.data, ofns.size,	\
-					   (const byte *)param,	\
-					    strlen(param))	\
-		   )	\
-		    /* The new param is the same as the old param.  Do nothing. */	\
-		    ofns.data = 0;	\
-		break;	\
-	    default:	\
-		param_signal_error(plist, param_name, code);	\
-		break;	\
-	    case 1:	\
-		ofns.data = 0;	\
-		code = 0;	\
-		break;	\
-	}	\
-	if (code < 0) return code;	\
-	    \
-	if (ofns.data != 0) {	\
-	    if (param) {	\
-		free (param);	\
-	        param = NULL;	\
-	    }	\
-	    if (ofns.data[0]) {	\
-		param = malloc (ofns.size + 1);	\
-		memcpy(param, ofns.data, ofns.size);	\
-		param[ofns.size] = 0;	\
-	    }	\
-	} \
-    } while (0)
-
-    read_string_param (devcairo->output_param, OUTPUT_PARAM_NAME);
-    read_string_param (devcairo->context_param, CONTEXT_PARAM_NAME);
-
-    code = gdev_vector_put_params(dev, plist);
-
-    return code;
-}
-
-static cairo_pattern_t *
-devcairo_make_pattern(gx_device_cairo *devcairo, gx_drawing_color *pdc)
-{
-    cairo_pattern_t *pattern;
-
-    if (gx_dc_is_pure(pdc)) {
-      gx_color_index color = gx_dc_pure_color(pdc);
-      pattern = cairo_pattern_create_rgb (((color >> 16) & 0xff) / 255.,
-					  ((color >>  8) & 0xff) / 255.,
-					  ((color      ) & 0xff) / 255.);
-    } else if (gx_dc_is_null(pdc)) {
-      pattern = cairo_pattern_create_rgb (1., 1., 1.); /* just use black */
-    } else {
-      pattern = cairo_pattern_create_rgb (1., 0., 0.); /* XXX red... */
-      gs_note_error(gs_error_rangecheck);
-      return pattern;
-    }
-
-    return pattern;
-}
-
-/* vector device implementation */
-
-        /* Page management */
-static int
-devcairo_beginpage(gx_device_vector *vdev)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo *)vdev;
-
-    return 0;
-}
-
-/* Imager state */
-static int
-devcairo_setlinewidth(gx_device_vector *vdev, floatp width)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo *)vdev;
-
-    cairo_set_line_width (devcairo->cr, width);
-
-    return 0;
-}
-static int
-devcairo_setlinecap(gx_device_vector *vdev, gs_line_cap cap)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo *)vdev;
-    cairo_line_cap_t cairo_cap;
-
-    switch (cap) {
-    case gs_cap_butt:   cairo_cap = CAIRO_LINE_CAP_BUTT;   break;
-    case gs_cap_square: cairo_cap = CAIRO_LINE_CAP_SQUARE; break;
-    case gs_cap_round:  cairo_cap = CAIRO_LINE_CAP_ROUND;  break;
-    default:
-	gs_note_error(gs_error_rangecheck);
-	return 1;
-    }
-
-    cairo_set_line_cap (devcairo->cr, cairo_cap);
-
-    return 0;
-}
-static int
-devcairo_setlinejoin(gx_device_vector *vdev, gs_line_join join)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo *)vdev;
-    cairo_line_join_t cairo_join;
-
-    switch (join) {
-    case gs_join_miter: cairo_join = CAIRO_LINE_JOIN_MITER; break;
-    case gs_join_round: cairo_join = CAIRO_LINE_JOIN_ROUND; break;
-    case gs_join_bevel: cairo_join = CAIRO_LINE_JOIN_BEVEL; break;
-    default:
-	gs_note_error(gs_error_rangecheck);
-	return 1;
-    }
-
-    cairo_set_line_join (devcairo->cr, cairo_join);
-
-    return 0;
-}
-static int
-devcairo_setmiterlimit(gx_device_vector *vdev, floatp limit)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo *)vdev;
-
-    cairo_set_miter_limit (devcairo->cr, limit);
-
-    return 0;
-}
-static int
-devcairo_setdash(gx_device_vector *vdev, const float *pattern,
-	    uint count, floatp offset)
-{
-    dprintf("XXX devcairo_setdash\n");
-    return 0;
-}
-static int
-devcairo_setlogop(gx_device_vector *vdev, gs_logical_operation_t lop,
-	     gs_logical_operation_t diff)
-{
-/*    dprintf("XXX devcairo_setlogop\n"); */
-    return 0;
-}
-
-        /* Other state */
-
-static int
-devcairo_can_handle_hl_color(gx_device_vector *vdev, const gs_imager_state *pis,
-			  const gx_drawing_color * pdc)
-{
-/*    dprintf("XXX devcairo_can_handle_hl_color\n"); */
-    return 0;
-}
-
-static int
-devcairo_setfillcolor(gx_device_vector *vdev, const gs_imager_state *pis,
-		 const gx_drawing_color *pdc)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo*)vdev;
-
-    cairo_pattern_destroy (devcairo->fill_pattern);
-    devcairo->fill_pattern = devcairo_make_pattern (devcairo, pdc);
-
-    return 0;
-}
-
-static int
-devcairo_setstrokecolor(gx_device_vector *vdev, const gs_imager_state *pis,
-		   const gx_drawing_color *pdc)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo*)vdev;
-
-    cairo_pattern_destroy (devcairo->stroke_pattern);
-    devcairo->stroke_pattern = devcairo_make_pattern (devcairo, pdc);
-
-    return 0;
-}
-
-	/* Paths */
-/*    gdev_vector_dopath */
-
-static int
-devcairo_beginpath(gx_device_vector *vdev, gx_path_type_t type)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo *)vdev;
-
-    cairo_new_path (devcairo->cr);
-
-    return 0;
-}
-
-static int
-devcairo_moveto(gx_device_vector *vdev, floatp x0, floatp y0,
-	   floatp x, floatp y, gx_path_type_t type)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo *)vdev;
-
-    cairo_move_to (devcairo->cr, x,y);
-
-    return 0;
-}
-
-static int
-devcairo_lineto(gx_device_vector *vdev, floatp x0, floatp y0,
-	   floatp x, floatp y, gx_path_type_t type)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo *)vdev;
-
-    cairo_line_to (devcairo->cr, x,y);
-
-    return 0;
-}
-
-static int
-devcairo_curveto(gx_device_vector *vdev, floatp x0, floatp y0,
-	    floatp x1, floatp y1, floatp x2, floatp y2,
-	    floatp x3, floatp y3, gx_path_type_t type)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo *)vdev;
-
-    cairo_curve_to (devcairo->cr, x1,y1, x2,y2, x3,y3);
-
-    return 0;
-}
-
-static int
-devcairo_closepath(gx_device_vector *vdev, floatp x, floatp y,
-	      floatp x_start, floatp y_start, gx_path_type_t type)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo *)vdev;
-
-    cairo_close_path (devcairo->cr);
-
-    return 0;
-}
-
-static int
-devcairo_endpath(gx_device_vector *vdev, gx_path_type_t type)
-{
-    gx_device_cairo *devcairo = (gx_device_cairo *)vdev;
-    cairo_t *cr = devcairo->cr;
-
-    cairo_set_fill_rule (cr,
-			 (type & gx_path_type_even_odd) ? 
-			 CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
-
-    if (type & gx_path_type_fill) {
-	cairo_set_source (cr, devcairo->fill_pattern);
-        cairo_fill_preserve (cr);
-    }
-
-    if (type & gx_path_type_stroke) {
-	cairo_set_source (cr, devcairo->stroke_pattern);
-        cairo_stroke_preserve (cr);
-    }
-
-    if (type & gx_path_type_clip)
-        cairo_clip_preserve (cr);
-
-    cairo_new_path (devcairo->cr);
-
-    return 0;
-}

Modified: branches/chrisl-test-gs/base/gdevdbit.c
===================================================================
--- branches/chrisl-test-gs/base/gdevdbit.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevdbit.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -289,7 +289,7 @@
 		}
 		LINE_ACCUM(composite, bpp);
 	    }
-	    LINE_ACCUM_COPY(dev, lout, bpp, x, rx, raster, ry);
+	    LINE_ACCUM_COPY(dev, lout, bpp, x, rx, out_size, ry);
 	}
       out:gs_free_object(mem, lout, "copy_alpha(lout)");
 	gs_free_object(mem, lin, "copy_alpha(lin)");

Modified: branches/chrisl-test-gs/base/gdevddrw.c
===================================================================
--- branches/chrisl-test-gs/base/gdevddrw.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevddrw.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -987,6 +987,9 @@
     const gs_image_t *ptim;
     int code;
 
+    /* Processing an image object operation */
+    gs_set_object_tag(pis, GS_IMAGE_TAG);
+
     set_dev_proc(dev, begin_image, gx_no_begin_image);
     if (pim->format == format)
 	ptim = pim;
@@ -1008,8 +1011,12 @@
 		   const gs_image_common_t * pic, const gs_int_rect * prect,
 	      const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
 		      gs_memory_t * memory, gx_image_enum_common_t ** pinfo)
-{	/*
-	 * If this is an ImageType 1 image using the imager's CTM,
+{   
+    /* Processing an image object operation */
+    if (pis != NULL)   /* Null can happen when generating image3 mask */
+        gs_set_object_tag(pis, GS_IMAGE_TAG);
+
+    /* If this is an ImageType 1 image using the imager's CTM,
 	 * defer to begin_image.
 	 */
     if (pic->type->begin_typed_image == gx_begin_image1) {

Modified: branches/chrisl-test-gs/base/gdevimgn.c
===================================================================
--- branches/chrisl-test-gs/base/gdevimgn.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevimgn.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -67,6 +67,7 @@
  
 /* -------------------------------------------------------- */ 
 #include "gdevprn.h" 
+#include "gxobj.h" 
 /* #include <stdio.h> should not be used in drivers */
 #include <stdlib.h>
  
@@ -350,9 +351,9 @@
 imagen_print_page(gx_device_printer *pdev, FILE *prn_stream) 
 { 
   int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev); 
+  const int align_size = obj_align_round((line_size/BIGSIZE)+1);
   /* input buffer: one line of bytes rasterized by gs */
-  byte *in = (byte *)gs_malloc(pdev->memory, BIGSIZE, line_size / BIGSIZE + 1,
-	"imagen_print_page(in)"); 
+  byte *in = (byte *)gs_malloc(pdev->memory, BIGSIZE, align_size, "imagen_print_page(in)"); 
   /* output buffer: 32 lines, interleaved into imPress swatches */
   byte *out; 
   /* working pointer into output buffer */	
@@ -440,8 +441,9 @@
     /* ------------------------------------------------------- */
     /* get 32 lines and interleave into a row of swatches */ 
     for (swatchLine = 0 ; swatchLine <= lastLine; swatchLine++) { 
+
       /* blank out end of buffer for BIGSIZE overlap */
-      for (temp = in + line_size; temp < in + line_size + BIGSIZE;temp++){
+      for (temp = in + line_size; temp < in + align_size*BIGSIZE; temp++){
 	*temp = 0;
       } /* for temp */
 
@@ -549,10 +551,10 @@
  
   fflush(prn_stream); 
  
+  gs_free(pdev->memory, (char *)out, TotalBytesPerSw, swatchCount+1, "imagen_print_page(out)"); 
   gs_free(pdev->memory, (char *)swatchMap, BIGSIZE, swatchCount / BIGSIZE + 1,
 	"imagen_print_page(swatchMap)" );
-  gs_free(pdev->memory, (char *)out, TotalBytesPerSw, swatchCount+1, "imagen_print_page(out)"); 
-  gs_free(pdev->memory, (char *)in, BIGSIZE, line_size / BIGSIZE + 1, "imagen_print_page(in)"); 
+  gs_free(pdev->memory, (char *)in, BIGSIZE, align_size, "imagen_print_page(in)");
   /* ----------------------------------------- */
 
   DebugMsg(1,"Debug: Grey: %d \n",totalGreySwatches);

Modified: branches/chrisl-test-gs/base/gdevmem.c
===================================================================
--- branches/chrisl-test-gs/base/gdevmem.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevmem.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -167,6 +167,10 @@
 	gx_device_forward_color_procs((gx_device_forward *) dev);
 	gx_device_copy_color_procs((gx_device *)dev, target);
 	dev->cached_colors = target->cached_colors;
+        /* Do a copy of put_image since it needs the source buffer */
+#define COPY_PROC(p) set_dev_proc(dev, p, target->procs.p)
+        COPY_PROC(put_image);
+#undef COPY_PROC
     }
     if (dev->color_info.depth == 1) {
 	gx_color_value cv[3];

Modified: branches/chrisl-test-gs/base/gdevnfwd.c
===================================================================
--- branches/chrisl-test-gs/base/gdevnfwd.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevnfwd.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -40,6 +40,12 @@
      */
     if (target && !fdev->finalize)
 	fdev->finalize = gx_device_forward_finalize;
+    /* Assign the profile of the target device to the forward device.
+       if it has not already been done with a parameter copy */
+    if (target && fdev->device_icc_profile != target->device_icc_profile) {
+        fdev->device_icc_profile = target->device_icc_profile;
+        rc_increment(fdev->device_icc_profile);
+    }
     rc_assign(fdev->target, target, "gx_device_set_target");
 }
 

Modified: branches/chrisl-test-gs/base/gdevp14.c
===================================================================
--- branches/chrisl-test-gs/base/gdevp14.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevp14.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -52,6 +52,9 @@
 #include "gsicc_manage.h"
 #include "gsicc_cache.h"
 #include "gxclist.h"
+#include "gxiclass.h"
+#include "gximage.h"
+#include "gsmatrix.h"
 
 #if RAW_DUMP
 unsigned int global_index = 0;
@@ -67,7 +70,10 @@
 		 const gx_device_color * pdevc, const gx_clip_path * pcpath);
 static pdf14_mask_t *pdf14_mask_element_new(gs_memory_t *memory);
 static void pdf14_free_smask_color(pdf14_device * pdev); 
+static	int compute_group_device_int_rect(pdf14_device *pdev, gs_int_rect *rect, 
+                              const gs_rect *pbbox, gs_imager_state *pis);
 
+
 /* Functions for dealing with soft mask color */
 static int pdf14_decrement_smask_color(gs_imager_state * pis, gx_device * dev);
 static int pdf14_increment_smask_color(gs_imager_state * pis, gx_device * dev);
@@ -105,9 +111,8 @@
 		    pdf14_ctx_enum_ptrs, pdf14_ctx_reloc_ptrs,
 		    stack, maskbuf);
 
-gs_private_st_ptrs2(st_pdf14_clr, pdf14_parent_color_t, "pdf14_clr",
-		    pdf14_clr_enum_ptrs, pdf14_clr_reloc_ptrs,
-		    icc_profile, previous);
+gs_private_st_ptrs1(st_pdf14_clr, pdf14_parent_color_t, "pdf14_clr",
+		    pdf14_clr_enum_ptrs, pdf14_clr_reloc_ptrs, previous);
 
 gs_private_st_ptrs2(st_pdf14_mask, pdf14_mask_t, "pdf_mask",
                     pdf14_mask_enum_ptrs, pdf14_mask_reloc_ptrs,
@@ -137,6 +142,7 @@
 static	dev_proc_get_color_comp_index(pdf14_cmykspot_get_color_comp_index);
 static	dev_proc_get_color_mapping_procs(pdf14_cmykspot_get_color_mapping_procs);
 dev_proc_encode_color(pdf14_encode_color);
+dev_proc_encode_color(pdf14_encode_color_tag);
 dev_proc_encode_color(pdf14_compressed_encode_color);
 dev_proc_decode_color(pdf14_decode_color);
 dev_proc_decode_color(pdf14_compressed_decode_color);
@@ -145,6 +151,7 @@
 static	dev_proc_fill_rectangle(pdf14_mark_fill_rectangle_ko_simple);
 static	dev_proc_fill_path(pdf14_fill_path);
 static  dev_proc_copy_mono(pdf14_copy_mono);
+static	dev_proc_fill_mask(pdf14_fill_mask);
 static	dev_proc_stroke_path(pdf14_stroke_path);
 static	dev_proc_begin_typed_image(pdf14_begin_typed_image);
 static	dev_proc_text_begin(pdf14_text_begin);
@@ -197,7 +204,7 @@
 	NULL,				/* copy_rop */\
 	pdf14_fill_path,		/* fill_path */\
 	pdf14_stroke_path,		/* stroke_path */\
-	NULL,				/* fill_mask */\
+	pdf14_fill_mask,		/* fill_mask */\
 	NULL,				/* fill_trapezoid */\
 	NULL,				/* fill_parallelogram */\
 	NULL,				/* fill_triangle */\
@@ -482,9 +489,8 @@
  * Return value: Newly allocated buffer, or NULL on failure.
  **/
 static	pdf14_buf *
-pdf14_buf_new(gs_int_rect *rect, bool has_alpha_g, bool	has_shape, bool idle,
-	       int n_chan,
-	       gs_memory_t *memory)
+pdf14_buf_new(gs_int_rect *rect, bool has_tags, bool has_alpha_g, 
+              bool has_shape, bool idle, int n_chan, gs_memory_t *memory)
 {
 
 	/* Note that alpha_g is the alpha for the GROUP */
@@ -496,7 +502,8 @@
     pdf14_parent_color_t *new_parent_color;
     int rowstride = (rect->q.x - rect->p.x + 3) & -4;
     int height = (rect->q.y - rect->p.y);
-    int n_planes = n_chan + (has_shape ? 1 : 0) + (has_alpha_g ? 1 : 0);
+    int n_planes = n_chan + (has_shape ? 1 : 0) + (has_alpha_g ? 1 : 0) +
+                   (has_tags ? 1 : 0);
     int planestride;
     double dsize = (((double) rowstride) * height) * n_planes;
 
@@ -513,6 +520,7 @@
     result->knockout = false;
     result->has_alpha_g = has_alpha_g;
     result->has_shape = has_shape;
+    result->has_tags = has_tags;
     result->rect = *rect;
     result->n_chan = n_chan;
     result->n_planes = n_planes;
@@ -546,7 +554,12 @@
 	    int alpha_g_plane = n_chan + (has_shape ? 1 : 0);
 	    memset (result->data + alpha_g_plane * planestride, 0, planestride);
 	}
+        if (has_tags) {
+            int tags_plane = n_chan + (has_shape ? 1 : 0) + (has_alpha_g ? 1 : 0);
+            memset (result->data + tags_plane * planestride, 
+                    GS_UNTOUCHED_TAG, planestride);
     }
+    }
     /* Initialize bbox with the reversed rectangle for further accumulation : */
     result->bbox.p.x = rect->q.x;
     result->bbox.p.y = rect->q.y;
@@ -598,21 +611,29 @@
 {
     pdf14_ctx *result;
     pdf14_buf *buf;
+    bool has_tags;
 
+    has_tags = (memory->gs_lib_ctx->BITTAG != GS_DEVICE_DOESNT_SUPPORT_TAGS);
+
     result = gs_alloc_struct(memory, pdf14_ctx, &st_pdf14_ctx,
 			     "pdf14_ctx_new");
     if (result == NULL)
 	return result;
 	/* Note:  buffer creation expects alpha to be in number of channels */
-    buf = pdf14_buf_new(rect, false, false, false, n_chan+1, memory);
+    buf = pdf14_buf_new(rect, has_tags, false, false, false, n_chan+1, memory);
     if (buf == NULL) {
 	gs_free_object(memory, result, "pdf14_ctx_new");
 	return NULL;
     }
-    if_debug3('v', "[v]base buf: %d x %d, %d channels\n",
-	      buf->rect.q.x, buf->rect.q.y, buf->n_chan);
-    if (buf->data != NULL)
+    if_debug4('v', "[v]base buf: %d x %d, %d color channels, %d planes \n",
+	      buf->rect.q.x, buf->rect.q.y, buf->n_chan, buf->n_planes);
+    if (buf->data != NULL) {
+        if (buf->has_tags) {
+	    memset(buf->data, 0, buf->planestride * (buf->n_planes-1));
+        } else {
 	memset(buf->data, 0, buf->planestride * buf->n_planes);
+        }
+    }
     buf->saved = NULL;
     result->stack = buf;
     result->maskbuf = pdf14_mask_element_new(memory);
@@ -670,7 +691,7 @@
 {
     pdf14_buf *tos = ctx->stack;
     pdf14_buf *buf, *backdrop;
-    bool has_shape;
+    bool has_shape, has_tags;
 
     if_debug1('v', "[v]pdf14_push_transparency_group, idle = %d\n", idle);
     /* todo: fix this hack, which makes all knockout groups isolated.
@@ -681,6 +702,7 @@
     if (knockout) 
 	isolated = true;
     has_shape = tos->has_shape || tos->knockout;
+    has_tags = tos->has_tags;
     /* We need to create this based upon the size of
     the color space + an alpha channel. NOT the device size
     or the previous ctx size. */
@@ -689,9 +711,10 @@
        buffer will be added.  If it is isolated, then the buffer will not be added.
        I question the redundancy here of the alpha and the group alpha channel, 
        but that will need to be looked at later. */
-    buf = pdf14_buf_new(rect, !isolated, has_shape, idle, numcomps+1, ctx->memory);
-    if_debug3('v', "[v]push buf: %d x %d, %d channels\n", 
-        buf->rect.q.x - buf->rect.p.x, buf->rect.q.y - buf->rect.p.y, buf->n_chan);
+    buf = pdf14_buf_new(rect, has_tags, !isolated, has_shape, idle, 
+                        numcomps+1, ctx->memory);
+    if_debug4('v', "[v]base buf: %d x %d, %d color channels, %d planes \n",
+	      buf->rect.q.x, buf->rect.q.y, buf->n_chan, buf->n_planes);
     if (buf == NULL)
 	return_error(gs_error_VMerror);
     buf->isolated = isolated;
@@ -733,7 +756,7 @@
 static	int
 pdf14_pop_transparency_group(gs_imager_state *pis, pdf14_ctx *ctx,
     const pdf14_nonseparable_blending_procs_t * pblend_procs, 
-    int curr_num_color_comp, cmm_profile_t *curr_icc_profile)
+    int curr_num_color_comp, cmm_profile_t *curr_icc_profile, gx_device *dev)
 {
     pdf14_buf *tos = ctx->stack;
     pdf14_buf *nos = tos->saved;
@@ -829,7 +852,11 @@
                 rendering_params.object_type = GS_IMAGE_TAG;
                 rendering_params.rendering_intent = gsPERCEPTUAL;
                 /* Request the ICC link for the transform that we will need to use */
-                icc_link = gsicc_get_link_profile(pis, curr_icc_profile, 
+                /* Note that if pis is NULL we assume the same color space.  This
+                   is due to a call to pop the group from fill_mask when filling
+                   with a mask with transparency.  In that case, the parent
+                   and the child will have the same color space anyway */
+                icc_link = gsicc_get_link_profile(pis, dev, curr_icc_profile, 
                     nos->parent_color_info_procs->icc_profile,
                     &rendering_params, pis->memory, false);
                 /* If the link is the identity, then we don't need to do 
@@ -970,7 +997,9 @@
        a bit tricky.  We need to create this based upon the size of
        the color space + an alpha channel. NOT the device size
        or the previous ctx size */
-    buf = pdf14_buf_new(rect, false, false, idle, numcomps+1, ctx->memory);
+    /* A mask doesnt worry about tags */
+    buf = pdf14_buf_new(rect, false, false, false, idle, numcomps+1, 
+                        ctx->memory);
     if (buf == NULL)
 	return_error(gs_error_VMerror);
     buf->alpha = bg_alpha;
@@ -1031,13 +1060,13 @@
 }
 
 static	int
-pdf14_pop_transparency_mask(pdf14_ctx *ctx, gs_imager_state *pis)
+pdf14_pop_transparency_mask(pdf14_ctx *ctx, gs_imager_state *pis, gx_device *dev)
 {
     pdf14_buf *tos = ctx->stack;
     byte *new_data_buf;
     int icc_match;
     cmm_profile_t *des_profile = tos->parent_color_info_procs->icc_profile; /* If set, this should be a gray profile */
-    cmm_profile_t *src_profile = pis->icc_manager->device_profile;    
+    cmm_profile_t *src_profile = dev->device_icc_profile;    
     gsicc_rendering_param_t rendering_params;
     gsicc_link_t *icc_link;
 
@@ -1124,7 +1153,7 @@
                     rendering_params.black_point_comp = BP_OFF;
                     rendering_params.object_type = GS_IMAGE_TAG;
                     rendering_params.rendering_intent = gsPERCEPTUAL;
-                    icc_link = gsicc_get_link_profile(pis, des_profile, 
+                    icc_link = gsicc_get_link_profile(pis, dev, des_profile, 
                         src_profile, &rendering_params, pis->memory, false);
                     smask_icc(tos->rect.q.y - tos->rect.p.y ,
                                         tos->rect.q.x - tos->rect.p.x,tos->n_chan, 
@@ -1312,6 +1341,8 @@
     const byte bg = pdev->ctx->additive ? 255 : 0;
     int x1, y1, width, height;
     byte *buf_ptr;
+    bool data_blended = false;
+    int num_rows_left;
 
     if_debug0('v', "[v]pdf14_put_image\n");
     rect_intersect(rect, buf->bbox);
@@ -1325,6 +1356,63 @@
     if (width <= 0 || height <= 0 || buf->data == NULL)
 	return 0;
     buf_ptr = buf->data + rect.p.y * buf->rowstride + rect.p.x;
+    /* See if the target device has a put_image command.  If
+       yes then see if it can handle the image data directly.
+       If it cannot, then we will need to use the begin_typed_image
+       interface, which cannot pass along tag nor alpha data to 
+       the target device */
+    if (target->procs.put_image != NULL) {
+        /* See if the target device can handle the data in its current 
+           form with the alpha component */
+        int alpha_offset = num_comp;
+        int tag_offset = buf->has_tags ? num_comp+1 : 0;
+        code = dev_proc(target, put_image) (target, buf_ptr, num_comp,
+                                            rect.p.x, rect.p.y, width, height,
+                                            buf->rowstride, buf->planestride,
+                                            num_comp,tag_offset);
+        if (code == 0) {
+            /* Device could not handle the alpha data.  Go ahead and 
+               preblend now. Note that if we do this, and we end up in the
+               default below, we only need to repack in chunky not blend */
+#if RAW_DUMP
+            /* Dump before and after the blend to make sure we are doing that ok */
+            dump_raw_buffer(height, width, buf->n_planes,
+                        pdev->ctx->stack->planestride, pdev->ctx->stack->rowstride, 
+                        "pre_final_blend",buf_ptr);
+            global_index++;
+#endif
+            gx_blend_image_buffer(buf_ptr, width, height, buf->rowstride,
+                                  buf->planestride, num_comp, bg);
+#if RAW_DUMP
+            /* Dump before and after the blend to make sure we are doing that ok */
+            dump_raw_buffer(height, width, buf->n_planes,
+                        pdev->ctx->stack->planestride, pdev->ctx->stack->rowstride, 
+                        "post_final_blend",buf_ptr);
+            global_index++;
+            clist_band_count++;
+#endif
+            data_blended = true;
+            /* Try again now */
+            alpha_offset = 0;
+            code = dev_proc(target, put_image) (target, buf_ptr, num_comp,
+                                                rect.p.x, rect.p.y, width, height,
+                                                buf->rowstride, buf->planestride,
+                                                alpha_offset, tag_offset);
+        }
+        if (code > 0) {
+            /* We processed some or all of the rows.  Continue until we are done */
+            num_rows_left = height - code;
+            while (num_rows_left > 0) {
+                code = dev_proc(target, put_image) (target, buf_ptr, buf->n_planes,
+                                                    rect.p.x, rect.p.y+code, width, 
+                                                    num_rows_left, buf->rowstride, 
+                                                    buf->planestride,
+                                                    alpha_offset, tag_offset);
+                num_rows_left = num_rows_left - code;
+            }
+            return 0;
+        }
+    }
 #if 0
     /* Set graphics state device to target, so that image can set up
        the color mapping properly. */
@@ -1353,8 +1441,8 @@
 	return_error(gs_error_VMerror);
     /* Need to set this to avoid color management during the 
        image color render operation */
-    pcs->cmm_icc_profile_data = pis->icc_manager->device_profile;
-    rc_increment(pis->icc_manager->device_profile);
+    pcs->cmm_icc_profile_data = dev->device_icc_profile;
+    rc_increment(dev->device_icc_profile);
     gs_image_t_init_adjust(&image, pcs, false);
     image.ImageMatrix.xx = (float)width;
     image.ImageMatrix.yy = (float)height;
@@ -1387,14 +1475,25 @@
                 pdev->ctx->stack->planestride, pdev->ctx->stack->rowstride, 
                 "PDF14_PUTIMAGE_SMALL",buf_ptr);
     global_index++;
+    if (!data_blended) {
     clist_band_count++;
+    }
 #endif
     linebuf = gs_alloc_bytes(pdev->memory, width * num_comp, "pdf14_put_image");
     for (y = 0; y < height; y++) {
 	gx_image_plane_t planes;
-	int rows_used;
+	int rows_used,k,x;
 
-	gx_build_blended_image_row(buf_ptr, y, buf->planestride, width, num_comp, bg, linebuf);
+        if (data_blended) {
+            for (x = 0; x < width; x++) {
+	        for (k = 0; k < num_comp; k++) {
+		    linebuf[x * num_comp + k] = buf_ptr[x + buf->planestride * k];
+	        }
+            }
+        } else {
+	    gx_build_blended_image_row(buf_ptr, y, buf->planestride, width, 
+                                       num_comp, bg, linebuf);
+        }
 	planes.data = linebuf;
 	planes.data_x = 0;
 	planes.raster = width * num_comp;
@@ -1548,6 +1647,12 @@
 	COPY_ARRAY_PARAM(Margins);
 	COPY_ARRAY_PARAM(HWMargins);
 	COPY_PARAM(PageCount);
+	COPY_PARAM(MaxPatternBitmap);
+        /* Don't let put params blow away a group color space */
+        if (dev->device_icc_profile == NULL) {
+            COPY_PARAM(device_icc_profile);
+            rc_increment(dev->device_icc_profile);
+        }
 #undef COPY_ARRAY_PARAM
 #undef COPY_PARAM
 }
@@ -1639,6 +1744,22 @@
 	      pdev->opacity, pdev->shape, pis->blend_mode);
 }
 
+static  void
+update_lop_for_pdf14(gs_imager_state *pis)
+{
+    if ((pis->alpha != 0xFFFF) ||
+        (pis->blend_mode != BLEND_MODE_Normal) ||
+        (pis->opacity.alpha != 1.0) ||
+        (pis->shape.alpha != 1.0))
+    {
+        /*
+         * The blend operations are not idempotent.  Force non-idempotent
+         * filling and stroking operations.
+         */
+        pis->log_op |= lop_pdf14;
+    }
+}
+
 static	int
 pdf14_fill_path(gx_device *dev,	const gs_imager_state *pis,
 			   gx_path *ppath, const gx_fill_params *params,
@@ -1691,11 +1812,7 @@
               by the pdf14 clist writer device.  */
            pinst->saved->trans_device = dev;
     }
-    /*
-     * The blend operations are not idempotent.  Force non-idempotent
-     * filling and stroking operations.
-     */
-    new_is.log_op |= lop_pdf14;
+    update_lop_for_pdf14(&new_is);
     pdf14_set_marking_params(dev, pis);
     new_is.trans_device = dev;
     new_is.has_transparency = true;
@@ -1716,17 +1833,104 @@
 {
     gs_imager_state new_is = *pis;
 
-    /*
-     * The blend operations are not idempotent.  Force non-idempotent
-     * filling and stroking operations.
-     */
-    new_is.log_op |= lop_pdf14;
+    update_lop_for_pdf14(&new_is);
     pdf14_set_marking_params(dev, pis);
     return gx_default_stroke_path(dev, &new_is, ppath, params, pdcolor,
 				  pcpath);
 }
 
+static	int
+pdf14_fill_mask(gx_device * orig_dev,
+		     const byte * data, int dx, int raster, gx_bitmap_id id,
+		     int x, int y, int w, int h,
+		     const gx_drawing_color * pdcolor, int depth,
+		     gs_logical_operation_t lop, const gx_clip_path * pcpath)
+{
+    gx_device *dev;
+    pdf14_device *p14dev = (pdf14_device *)orig_dev;
+    gx_device_clip cdev;
+    gx_color_tile *ptile = NULL;
+    int code = 0;
+    gs_int_rect group_rect;
+    gx_pattern_trans_t *fill_trans_buffer = NULL;
+    bool has_pattern_trans = false;
 
+    /* If we are doing a fill with a pattern that has a transparency then
+       go ahead and do a push and a pop of the transparency group */
+    if (pdcolor != NULL && gx_dc_is_pattern1_color(pdcolor)) {
+        if( gx_pattern1_get_transptr(pdcolor) != NULL) {
+            ptile = pdcolor->colors.pattern.p_tile;
+            /* Set up things in the ptile so that we get the proper 
+               blending etc */
+            /* Set the blending procs and the is_additive setting based 
+               upon the number of channels */
+            if (ptile->ttrans->n_chan-1 < 4) {
+                ptile->ttrans->blending_procs = &rgb_blending_procs;
+                ptile->ttrans->is_additive = true;
+            } else {
+                ptile->ttrans->blending_procs = &cmyk_blending_procs;
+                ptile->ttrans->is_additive = false;
+            }
+            /* Set the procs so that we use the proper filling method. */
+            gx_set_pattern_procs_trans((gx_device_color*) pdcolor);
+            /* Based upon if the tiles overlap pick the type of rect
+               fill that we will want to use */
+            if (ptile->has_overlap) {
+                /* This one does blending since there is tile overlap */
+                ptile->ttrans->pat_trans_fill = &tile_rect_trans_blend;
+            } else {
+                /* This one does no blending since there is no tile overlap */
+                ptile->ttrans->pat_trans_fill = &tile_rect_trans_simple;
+            }
+            /* Push the group */
+            group_rect.p.x = x;
+            group_rect.p.y = max(0,y);
+            group_rect.q.x = x + w;
+            group_rect.q.y = y + h;
+            if (!(w <= 0 || h <= 0)) {
+                code = pdf14_push_transparency_group(p14dev->ctx, &group_rect,
+	             1, 0, 255,255, ptile->ttrans->blending_mode, 0, 0, ptile->ttrans->n_chan-1);
+                /* Fix the reversed bbox. Not clear on why the push group does that */
+                p14dev->ctx->stack->bbox.p.x = p14dev->ctx->rect.p.x;
+                p14dev->ctx->stack->bbox.p.y = p14dev->ctx->rect.p.y;
+                p14dev->ctx->stack->bbox.q.x = p14dev->ctx->rect.q.x;
+                p14dev->ctx->stack->bbox.q.y = p14dev->ctx->rect.q.y;
+                /* Set up the output buffer information now that we have
+                   pushed the group */
+                fill_trans_buffer = new_pattern_trans_buff(p14dev->memory);
+                pdf14_get_buffer_information((gx_device *) p14dev, fill_trans_buffer);
+                /* Store this in the appropriate place in pdcolor.  This
+                   is released later after the mask fill */
+                ptile->ttrans->fill_trans_buffer = fill_trans_buffer;
+                has_pattern_trans = true;
+            }
+        }
+    }
+    if (pcpath != 0) {
+	gx_make_clip_device_on_stack(&cdev, pcpath, orig_dev);
+	dev = (gx_device *) & cdev;
+    } else
+	dev = orig_dev;
+    if (depth > 1) {
+	/****** CAN'T DO ROP OR HALFTONE WITH ALPHA ******/
+        code = (*dev_proc(dev, copy_alpha))
+	    (dev, data, dx, raster, id, x, y, w, h,
+	     gx_dc_pure_color(pdcolor), depth);
+    } else {
+        code = pdcolor->type->fill_masked(pdcolor, data, dx, raster, id,
+				          x, y, w, h, dev, lop, false);
+    }
+    if (has_pattern_trans) {
+            code = pdf14_pop_transparency_group(NULL, p14dev->ctx, p14dev->blend_procs, 
+                                p14dev->color_info.num_components, 
+                                p14dev->device_icc_profile, orig_dev);
+            gs_free_object(p14dev->memory, ptile->ttrans->fill_trans_buffer, 
+                           "pdf14_fill_mask");
+            ptile->ttrans->fill_trans_buffer = NULL;  /* Avoid GC issues */
+    }
+    return code;
+}
+
 /* Used for filling rects when we are doing a fill with a pattern that
    has transparency */
 static	int
@@ -1841,14 +2045,145 @@
         }
         /* free our buffer object */
         gs_free_object(pis->memory, fill_trans_buffer, "pdf14_tile_pattern_fill");
+        ptile->ttrans->fill_trans_buffer = NULL;  /* Avoid GC issues */
         /* pop our transparency group which will force the blending */
         code = pdf14_pop_transparency_group(pis, p14dev->ctx, p14dev->blend_procs, 
-                            p14dev->color_info.num_components, pis->icc_manager->device_profile);
+                            p14dev->color_info.num_components, 
+                            p14dev->device_icc_profile, pdev);
     }
     return(code);
 }
 
+/* Imager render for pattern transparency filling.  This is just here to catch
+   the final flush, at which time we will pop the group and reset a few items */
 static	int
+pdf14_pattern_trans_render(gx_image_enum * penum, const byte * buffer, int data_x,
+		    uint w, int h, gx_device * dev)
+{
+    int code;
+    pdf14_device * p14dev = (pdf14_device *)dev;
+    const gs_imager_state * pis = penum->pis;
+    gx_device_color * pdcolor = (penum->icolor1);
+    gx_color_tile *ptile = pdcolor->colors.pattern.p_tile;
+
+    /* Pass along to the original renderer */
+    code = (ptile->ttrans->image_render)(penum, buffer, data_x, w, h, dev);
+    /* On our final time through here, go ahead and pop the transparency 
+       group and reset the procs in the device color. And free the fill
+       trans buffer object */
+    if ( h == 0 && ptile->trans_group_popped == false) {
+        if (pis->is_gstate) {
+            /* Used if we are on clist writing phase.  Would only
+               occur if we somehow failed in high level clist 
+               image writing */
+            code = gs_end_transparency_group((gs_state *) pis);
+        } else {
+            /* Used if we are on clist reading phase.  If we had high level
+               image in clist */
+            code = pdf14_pop_transparency_group(NULL, p14dev->ctx, p14dev->blend_procs, 
+                    p14dev->color_info.num_components, 
+                    p14dev->device_icc_profile, (gx_device *) p14dev);
+        }
+        pdcolor->colors.pattern.p_tile->trans_group_popped = true;
+        gs_free_object(pis->memory, ptile->ttrans->fill_trans_buffer, 
+                       "pdf14_pattern_trans_render");
+        ptile->ttrans->fill_trans_buffer = NULL;  /* Avoid GC issues */
+    }
+    return(code);
+}
+
+/* This function is used to get things in place for filling a mask image
+   with a pattern that has transparency.  It is used by pdf14_begin_type_image
+   and pdf14_clist_begin_type_image */
+static int
+pdf14_patt_trans_image_fill(gx_device * dev, const gs_imager_state * pis,
+			   const gs_matrix *pmat, const gs_image_common_t *pic,
+			   const gs_int_rect * prect,
+			   const gx_drawing_color * pdcolor,
+			   const gx_clip_path * pcpath, gs_memory_t * mem,
+			   gx_image_enum_common_t ** pinfo)
+{
+    const gs_image_t *pim = (const gs_image_t *)pic;
+    pdf14_device * p14dev = (pdf14_device *)dev;
+    gx_color_tile *ptile;
+    int code = 0;
+    gs_int_rect group_rect;
+    gx_image_enum *penum;
+    gs_rect bbox_in, bbox_out;
+    gx_pattern_trans_t *fill_trans_buffer;
+
+    ptile = pdcolor->colors.pattern.p_tile;
+    /* Set up things in the ptile so that we get the proper 
+       blending etc */
+    /* Set the blending procs and the is_additive setting based 
+       upon the number of channels */
+    if (ptile->ttrans->n_chan-1 < 4) {
+        ptile->ttrans->blending_procs = &rgb_blending_procs;
+        ptile->ttrans->is_additive = true;
+    } else {
+        ptile->ttrans->blending_procs = &cmyk_blending_procs;
+        ptile->ttrans->is_additive = false;
+    }
+    /* Set the blending mode in the ptile based upon the current 
+       setting in the imager state */
+    ptile->ttrans->blending_mode = pis->blend_mode;
+    /* Based upon if the tiles overlap pick the type of rect
+       fill that we will want to use */
+    if (ptile->has_overlap) {
+        /* This one does blending since there is tile overlap */
+        ptile->ttrans->pat_trans_fill = &tile_rect_trans_blend;
+    } else {
+        /* This one does no blending since there is no tile overlap */
+        ptile->ttrans->pat_trans_fill = &tile_rect_trans_simple;
+    }
+    /* Set the procs so that we use the proper filling method. */
+    gx_set_pattern_procs_trans((gx_device_color*) pdcolor);
+    /* Let the imaging stuff get set up */
+    code = gx_default_begin_typed_image(dev, pis, pmat, pic, 
+                            prect, pdcolor,pcpath, mem, pinfo);
+    /* Now Push the group */
+    /* First apply the inverse of the image matrix to our 
+       image size to get our bounding box. */
+    bbox_in.p.x = 0;
+    bbox_in.p.y = 0;
+    bbox_in.q.x = pim->Width;
+    bbox_in.q.y = pim->Height;
+    code = gs_bbox_transform_inverse(&bbox_in, &(pim->ImageMatrix), 
+                                &bbox_out);
+    if (code < 0) return code;
+    /* That in turn will get hit by the matrix in the imager state */
+    code = compute_group_device_int_rect(p14dev, &group_rect, 
+                                            &bbox_out, pis);
+    if (!(pim->Width == 0 || pim->Height == 0)) {
+        code = pdf14_push_transparency_group(p14dev->ctx, &group_rect,
+	     1, 0, 255,255,
+	     pis->blend_mode, 0,
+	     0, ptile->ttrans->n_chan-1);
+        /* Fix the reversed bbox. Not clear on why the push group does that */
+        p14dev->ctx->stack->bbox.p.x = p14dev->ctx->rect.p.x;
+        p14dev->ctx->stack->bbox.p.y = p14dev->ctx->rect.p.y;
+        p14dev->ctx->stack->bbox.q.x = p14dev->ctx->rect.q.x;
+        p14dev->ctx->stack->bbox.q.y = p14dev->ctx->rect.q.y;
+        /* Set up the output buffer information now that we have
+           pushed the group */
+        fill_trans_buffer = new_pattern_trans_buff(pis->memory);
+        pdf14_get_buffer_information(dev, fill_trans_buffer);
+        /* Store this in the appropriate place in pdcolor.  This
+           is released later in pdf14_pattern_trans_render when
+           we are all done with the mask fill */
+        ptile->ttrans->fill_trans_buffer = fill_trans_buffer;
+        /* Change the renderer to handle this case so we can catch the
+           end.  We will then pop the group and reset the pdcolor proc.
+           Keep the base renderer also. */
+        penum = (gx_image_enum *) *pinfo;
+        ptile->ttrans->image_render = penum->render;
+        penum->render = &pdf14_pattern_trans_render;
+        ptile->trans_group_popped = false;
+    }
+    return code;
+}
+                
+static	int
 pdf14_begin_typed_image(gx_device * dev, const gs_imager_state * pis,
 			   const gs_matrix *pmat, const gs_image_common_t *pic,
 			   const gs_int_rect * prect,
@@ -1856,6 +2191,32 @@
 			   const gx_clip_path * pcpath, gs_memory_t * mem,
 			   gx_image_enum_common_t ** pinfo)
 {
+    const gs_image_t *pim = (const gs_image_t *)pic;
+    int code;
+
+    /* If we are filling an image mask with a pattern that has a transparency
+       then we need to do some special handling */
+    if (pim->ImageMask) {
+        if (pdcolor != NULL && gx_dc_is_pattern1_color(pdcolor)) {
+            if( gx_pattern1_get_transptr(pdcolor) != NULL){
+                /* If we are in a final run through here for this case then
+                   go ahead and push the transparency group.   Also, update 
+                   the proc for the pattern color so that we used the
+                   appropriate fill operation.  Note that the group
+                   is popped and the proc will be reset when we flush the 
+                   image data.  This is handled in a special pdf14 image 
+                   renderer which will end up installed for this case.
+                   Detect setting of begin_image to gx_no_begin_image.
+                   (final recursive call) */
+                if (dev->procs.begin_image != gx_default_begin_image) {
+                    code = pdf14_patt_trans_image_fill(dev, pis, pmat, pic,
+                                                prect, pdcolor, pcpath, mem,
+			                        pinfo);
+                    return code;
+                }
+            }
+        }
+    }
     pdf14_set_marking_params(dev, pis);
     return gx_default_begin_typed_image(dev, pis, pmat, pic, prect, pdcolor,
 					pcpath, mem, pinfo);
@@ -1965,7 +2326,10 @@
 static	pdf14_default_colorspace_t
 pdf14_determine_default_blend_cs(gx_device * pdev)
 {
-    if (pdev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
+    /* If num components is one, just go ahead and use gray.  This avoids
+       issues with additive/subtractive mono color devices  */
+    if (pdev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE || 
+        pdev->color_info.num_components == 1)
 	/*
 	 * Note:  We do not allow the SeparationOrder device parameter for
 	 * additive devices.  Thus we always have 1 colorant for DeviceGray
@@ -2509,7 +2873,7 @@
            group push. */
         if (group_color_numcomps < 5 ) {
             group_color = ICC;
-            curr_profile = pis->icc_manager->device_profile;
+            curr_profile = dev->device_icc_profile;
         } else {
                 /* We can end up here if we are in
                    a deviceN color space and 
@@ -2528,7 +2892,7 @@
         if (curr_profile != NULL) {
             /* If the cs is different then force isolation */
             if ( curr_profile->hashcode == 
-                pis->icc_manager->device_profile->hashcode) {
+                dev->device_icc_profile->hashcode) {
                     /* cs same.  use parameter setting */
                     isolated = ptgp->Isolated;
             } else {
@@ -2573,7 +2937,7 @@
     pdf14_device *pdev = (pdf14_device *)dev;
     int code;
     pdf14_parent_color_t *parent_color;
-    cmm_profile_t *curr_device_profile = pis->icc_manager->device_profile;
+    cmm_profile_t *icc_profile = dev->device_icc_profile;
 
     if_debug0('v', "[v]pdf14_end_transparency_group\n");
     vd_get_dc('c');
@@ -2581,7 +2945,9 @@
     vd_set_scale(0.01);
     vd_set_origin(0, 0);
     vd_erase(RGB(192, 192, 192));
-    code = pdf14_pop_transparency_group(pis, pdev->ctx, pdev->blend_procs,pdev->color_info.num_components, curr_device_profile);
+    code = pdf14_pop_transparency_group(pis, pdev->ctx, pdev->blend_procs,
+                                pdev->color_info.num_components, icc_profile,
+                                (gx_device *) pdev);
    /* May need to reset some color stuff related
      * to a mismatch between the parents color space
      * and the group blending space */
@@ -2608,7 +2974,7 @@
 	    parent_color->parent_color_comp_index = NULL;
 	    parent_color->parent_color_mapping_procs = NULL;
         if (parent_color->icc_profile != NULL) {
-            pis->icc_manager->device_profile = parent_color->icc_profile;
+            dev->device_icc_profile = parent_color->icc_profile;
             rc_decrement(parent_color->icc_profile,"pdf14_end_transparency_group");
             parent_color->icc_profile = NULL;
 	}
@@ -2634,6 +3000,8 @@
     byte comp_bits[] = {0,0,0,0};
     byte comp_shift[] = {0,0,0,0};
     int k;
+    bool has_tags = (dev->memory->gs_lib_ctx->BITTAG != 
+                        GS_DEVICE_DOESNT_SUPPORT_TAGS);
 
     if (pdev->ctx->stack != NULL){
         parent_color_info = pdev->ctx->stack->parent_color_info_procs;
@@ -2776,7 +3144,7 @@
         /* Don't increment the space since we are going to remove it from the 
            ICC manager anyway.  */
         if (group_color == ICC && iccprofile != NULL) {
-            parent_color_info->icc_profile = pis->icc_manager->device_profile;
+            parent_color_info->icc_profile = dev->device_icc_profile;
         }
 
         /* Set new information */
@@ -2791,6 +3159,9 @@
         pdev->color_info.num_components = new_num_comps;
         pdev->ctx->additive = new_additive; 
         pdev->pdf14_procs = new_14procs;
+        if (has_tags) {
+            new_depth += 8;
+        }
         pdev->color_info.depth = new_depth;
         memset(&(pdev->color_info.comp_bits),0,GX_DEVICE_COLOR_MAX_COMPONENTS);
         memset(&(pdev->color_info.comp_shift),0,GX_DEVICE_COLOR_MAX_COMPONENTS);
@@ -2802,7 +3173,7 @@
            in the ICC manager, since that is the profile that is used for the
            PDF14 device */
         if (group_color == ICC && iccprofile != NULL) {
-            pis->icc_manager->device_profile = iccprofile;
+            dev->device_icc_profile = iccprofile;
             rc_increment(parent_color_info->icc_profile);
         }
         return(1);  /* Lets us detect that we did do an update */
@@ -2827,6 +3198,8 @@
     byte comp_bits[] = {0,0,0,0};
     byte comp_shift[] = {0,0,0,0};
     int k;
+    bool has_tags = (dev->memory->gs_lib_ctx->BITTAG != 
+                        GS_DEVICE_DOESNT_SUPPORT_TAGS);
 
     if (group_color == ICC && icc_profile == NULL) {
         return gs_rethrow(gs_error_undefinedresult, 
@@ -2901,7 +3274,7 @@
                 break;
             case ICC:
                 /* Check if the profile is different. */
-                if (pis->icc_manager->device_profile->hashcode != 
+                if (dev->device_icc_profile->hashcode != 
                                         icc_profile->hashcode) {
                     update_color_info = true;
                     new_num_comps = icc_profile->num_comps;
@@ -2946,6 +3319,9 @@
 	        break;
          }    
          if (update_color_info){
+             if (has_tags) {
+                 new_depth += 8;
+             }
             if_debug2('v', "[v]pdf14_update_device_color_procs_push_c,num_components_old = %d num_components_new = %d\n", 
                 pdev->color_info.num_components,new_num_comps);
             /* Set new information in the device */
@@ -2975,7 +3351,7 @@
                device in the ICC manager.  We already stored in in pdf14_parent_color_t.
                That will be stored in the clist and restored during the reading phase. */
            if (group_color == ICC) {
-                pis->icc_manager->device_profile = icc_profile;
+                dev->device_icc_profile = icc_profile;
             }
             if (pdev->ctx) {
                pdev->ctx->additive = new_additive; 
@@ -3034,7 +3410,7 @@
           A match with pdf14_update_device_color_procs_push_c.  There functions
           are closely integrated with pdf14_pop_parent_color and pdf14_push_parent color.
           All four are used only on the clist writer side of the transparency code */
-         pis->icc_manager->device_profile = parent_color->icc_profile;
+         dev->device_icc_profile = parent_color->icc_profile;
          if_debug0('v', "[v]procs updated\n");
     } else {
         if_debug0('v', "[v]pdf14_update_device_color_procs_pop_c ERROR \n");
@@ -3081,8 +3457,8 @@
     memcpy(&(new_parent_color->comp_shift),&(pdev->color_info.comp_shift),
                         GX_DEVICE_COLOR_MAX_COMPONENTS);
     /* The ICC manager has the ICC profile for the device */
-    new_parent_color->icc_profile = pis->icc_manager->device_profile;
-    rc_increment(pis->icc_manager->device_profile);
+    new_parent_color->icc_profile = dev->device_icc_profile;
+    rc_increment(dev->device_icc_profile);
     /* isadditive is only used in ctx */
     if (pdev->ctx) {
         new_parent_color->isadditive = pdev->ctx->additive;
@@ -3194,7 +3570,7 @@
     int ok;
 
     if_debug0('v', "pdf14_end_transparency_mask\n");
-    ok = pdf14_pop_transparency_mask(pdev->ctx, pis);
+    ok = pdf14_pop_transparency_mask(pdev->ctx, pis, dev);
     /* May need to reset some color stuff related
      * to a mismatch between the Smask color space
      * and the Smask blending space */
@@ -3223,7 +3599,7 @@
                                 GX_DEVICE_COLOR_MAX_COMPONENTS);
             /* Take care of the ICC profile */
             if (parent_color->icc_profile != NULL) {
-                pis->icc_manager->device_profile = parent_color->icc_profile;
+                dev->device_icc_profile = parent_color->icc_profile;
                 rc_decrement(parent_color->icc_profile,"pdf14_end_transparency_mask");
                 parent_color->icc_profile = NULL;
         }
@@ -3246,12 +3622,15 @@
     bool additive = pdev->ctx->additive;
     int rowstride = buf->rowstride;
     int planestride = buf->planestride;
+    gs_object_tag_type_t curr_tag;
     bool has_alpha_g = buf->has_alpha_g;
     bool has_shape = buf->has_shape;
+    bool has_tags = buf->has_tags;
     int num_chan = buf->n_chan;
     int num_comp = num_chan - 1;
     int shape_off = num_chan * planestride;
     int alpha_g_off = shape_off + (has_shape ? planestride : 0);
+    int tag_off = alpha_g_off + (has_alpha_g ? planestride : 0);
     bool overprint = pdev->overprint;
     gx_color_index drawn_comps = pdev->drawn_comps;
     gx_color_index comps;
@@ -3275,6 +3654,9 @@
      * Unpack the gx_color_index values.  Complement the components for subtractive
      * color spaces.
      */
+    if (has_tags) {
+        curr_tag = (color >> (num_comp*8)) & 0xff; 
+    }
     pdev->pdf14_procs->unpack_color(num_comp, color, pdev, src);
     src_alpha = src[num_comp] = (byte)floor (255 * pdev->alpha + 0.5);
     if (has_shape)
@@ -3336,6 +3718,14 @@
 		int tmp = (255 - dst_ptr[shape_off]) * (255 - shape) + 0x80;
 		dst_ptr[shape_off] = 255 - ((tmp + (tmp >> 8)) >> 8);
 	    }
+            if (has_tags) {
+                /* If alpha is 100% then set to pure path, else or */
+                if (dst[num_comp] == 255) { 
+                    dst_ptr[tag_off] = curr_tag;
+                } else {
+                    dst_ptr[tag_off] = ( dst_ptr[tag_off] |curr_tag ) & ~GS_UNTOUCHED_TAG;
+                }
+            }
 	    ++dst_ptr;
 	}
 	line += rowstride;
@@ -3372,7 +3762,12 @@
     int num_comp = num_chan - 1;
     int shape_off = num_chan * planestride;
     bool has_shape = buf->has_shape;
+    bool has_alpha_g = buf->has_alpha_g;
+    int tag_off = shape_off + (has_alpha_g ? planestride : 0) +
+                  (has_shape ? planestride : 0);
+    bool has_tags = buf->has_tags;
     bool additive = pdev->ctx->additive;
+    gs_object_tag_type_t curr_tag;
 
     if (buf->data == NULL)
 	return 0;
@@ -3390,6 +3785,9 @@
      * Unpack the gx_color_index values.  Complement the components for subtractive
      * color spaces.
      */
+    if (has_tags) {
+        curr_tag = (color >> (num_comp*8)) & 0xff; 
+    }
     pdev->pdf14_procs->unpack_color(num_comp, color, pdev, src);
     src[num_comp] = (byte)floor (255 * pdev->alpha + 0.5);
     if (x < buf->rect.p.x) {
@@ -3424,7 +3822,9 @@
 		dst[num_comp] = dst_ptr[num_comp * planestride];
 	    }
 	    art_pdf_composite_knockout_simple_8(dst,
-		has_shape ? dst_ptr + shape_off : NULL, src, num_comp, 255);
+		has_shape ? dst_ptr + shape_off : NULL, 
+                has_tags ? dst_ptr + tag_off : NULL,     
+                src, curr_tag, num_comp, 255);
             /* ToDo:  Review use of shape and opacity above.   */ 
 	    /* Complement the results for subtractive color spaces */
 	    if (additive) {
@@ -3614,7 +4014,7 @@
    if (ncomps == 1 ){
 	cv[0] = frac2cv(gray);
         /* encode as a color index */
-        color = pdf14_encode_smask_color(trans_device,cv,1);
+        color = dev_proc(trans_device, encode_color)(trans_device, cv);
         /* check if the encoding was successful; we presume failure is rare */
          if (color != gx_no_color_index)
 	    color_set_pure(pdc, color);
@@ -3660,7 +4060,7 @@
         cv[1] = frac2cv(g);
         cv[2] = frac2cv(b);
         /* encode as a color index */
-        color = pdf14_encode_smask_color(trans_device,cv,3);
+        color = dev_proc(trans_device, encode_color)(trans_device, cv);
        /* check if the encoding was successful; we presume failure is rare */
          if (color != gx_no_color_index)
         color_set_pure(pdc, color);    
@@ -3718,7 +4118,7 @@
         cv[2] = frac2cv(y);
         cv[3] = frac2cv(k);
          /* encode as a color index */
-        color = pdf14_encode_smask_color(trans_device,cv,4);
+        color = dev_proc(trans_device, encode_color)(trans_device, cv);
         /* check if the encoding was successful; we presume failure is rare */
         if (color != gx_no_color_index)
 	    color_set_pure(pdc, color); 
@@ -3904,6 +4304,7 @@
     pdf14_device * dev_proto;
     pdf14_device * p14dev, temp_dev_proto;
     int code;
+    bool has_tags = (mem->gs_lib_ctx->BITTAG != GS_DEVICE_DOESNT_SUPPORT_TAGS);
 
     if_debug0('v', "[v]gs_pdf14_device_push\n");
     code = get_pdf14_device_proto(target, &dev_proto,
@@ -3916,6 +4317,17 @@
 	return code;
     gs_pdf14_device_copy_params((gx_device *)p14dev, target);
     rc_assign(p14dev->target, target, "gs_pdf14_device_push");
+    /* If we have a tag device then go ahead and do a special encoder
+       decoder for the pdf14 device to make sure we maintain this
+       information in the encoded color information.  We could use
+       the target device's methods but the PDF14 device has to maintain
+       8 bit color always and we could run into other issues if the number
+       of colorants became large.  If we need to do compressed color with
+       tags that will be a special project at that time */
+    if (has_tags) {
+        p14dev->procs.encode_color = pdf14_encode_color_tag;
+        p14dev->color_info.depth += 8;
+    }
     check_device_separable((gx_device *)p14dev);
     gx_device_fill_in_procs((gx_device *)p14dev);
     p14dev->save_get_cmap_procs = pis->get_cmap_procs;
@@ -4922,6 +5334,7 @@
     pdf14_clist_device * dev_proto;
     pdf14_clist_device * pdev, temp_dev_proto;
     int code;
+    bool has_tags = (mem->gs_lib_ctx->BITTAG != GS_DEVICE_DOESNT_SUPPORT_TAGS);
 
     if_debug0('v', "[v]pdf14_create_clist_device\n");
     code = get_pdf14_clist_device_proto(target, &dev_proto,
@@ -4932,12 +5345,24 @@
 			 (const gx_device *) dev_proto, mem);
     if (code < 0)
 	return code;
+    /* If we have a tag device then go ahead and do a special encoder
+       decoder for the pdf14 device to make sure we maintain this
+       information in the encoded color information.  We could use
+       the target device's methods but the PDF14 device has to maintain
+       8 bit color always and we could run into other issues if the number
+       of colorants became large.  If we need to do compressed color with
+       tags that will be a special project at that time */
+    if (has_tags) {
+        pdev->procs.encode_color = pdf14_encode_color_tag;
+        pdev->color_info.depth += 8;
+    }
     check_device_separable((gx_device *)pdev);
     gx_device_fill_in_procs((gx_device *)pdev);
     gs_pdf14_device_copy_params((gx_device *)pdev, target);
     rc_assign(pdev->target, target, "pdf14_create_clist_device");
     code = dev_proc((gx_device *) pdev, open_device) ((gx_device *) pdev);
     pdev->pclist_device = target;
+
     pdev->my_encode_color = pdev->procs.encode_color;
     pdev->my_decode_color = pdev->procs.decode_color;
     pdev->my_get_color_mapping_procs = pdev->procs.get_color_mapping_procs;
@@ -5679,11 +6104,7 @@
               by the pdf14 clist writer device.  */
            pinst->saved->trans_device = dev;
     }
-    /*
-     * The blend operations are not idempotent.  Force non-idempotent
-     * filling and stroking operations.
-     */
-    new_is.log_op |= lop_pdf14;
+    update_lop_for_pdf14(&new_is);
     new_is.trans_device = dev;
     new_is.has_transparency = true;
     code = gx_forward_fill_path(dev, &new_is, ppath, params, pdcolor, pcpath);
@@ -5733,11 +6154,7 @@
            pinst->saved->trans_device = dev;
     }
 
-    /*
-     * The blend operations are not idempotent.  Force non-idempotent
-     * filling and stroking operations.
-     */
-    new_is.log_op |= lop_pdf14;
+    update_lop_for_pdf14(&new_is);
     new_is.trans_device = dev;
     new_is.has_transparency = true;
     code = gx_forward_stroke_path(dev, &new_is, ppath, params, pdcolor, pcpath);
@@ -5821,16 +6238,19 @@
 			   gx_image_enum_common_t ** pinfo)
 {
     pdf14_clist_device * pdev = (pdf14_clist_device *)dev;
-    int code;
+    int code = 0;
     gs_imager_state * pis_noconst = (gs_imager_state *)pis; /* Break 'const'. */
-
+    const gs_image_t *pim = (const gs_image_t *)pic;
+    gx_image_enum *penum;
+    gx_color_tile *ptile;
+    gs_rect bbox_in, bbox_out;
+    gs_transparency_group_params_t tgp;
     /*
      * Ensure that that the PDF 1.4 reading compositor will have the current
      * blending parameters.  This is needed since the fill_rectangle routines
      * do not have access to the imager state.  Thus we have to pass any
      * changes explictly.
      */
-
     code = pdf14_clist_update_params(pdev, pis);
     if (code < 0)
 	return code;
@@ -5842,6 +6262,68 @@
        more elegant. */
     pis_noconst->has_transparency = true;
     pis_noconst->trans_device = dev;
+
+    /* If we are filling an image mask with a pattern that has a transparency
+       then we need to do some special handling */
+    if (pim->ImageMask) {
+        if (pdcolor != NULL && gx_dc_is_pattern1_color(pdcolor)) {
+            if( gx_pattern1_get_transptr(pdcolor) != NULL){
+                 if (dev->procs.begin_image != pdf14_clist_begin_image) {
+                    ptile = pdcolor->colors.pattern.p_tile;
+                    /* Set up things in the ptile so that we get the proper 
+                       blending etc */
+                    /* Set the blending procs and the is_additive setting based 
+                       upon the number of channels */
+                    if (ptile->ttrans->n_chan-1 < 4) {
+                        ptile->ttrans->blending_procs = &rgb_blending_procs;
+                        ptile->ttrans->is_additive = true;
+                    } else {
+                        ptile->ttrans->blending_procs = &cmyk_blending_procs;
+                        ptile->ttrans->is_additive = false;
+                    }
+                    /* Set the blending mode in the ptile based upon the current 
+                       setting in the imager state */
+                    ptile->ttrans->blending_mode = pis->blend_mode;
+                    /* Set the procs so that we use the proper filling method. */
+                    /* Let the imaging stuff get set up */
+                    code = gx_default_begin_typed_image(dev, pis, pmat, pic, 
+                                            prect, pdcolor,pcpath, mem, pinfo);
+                    penum = (gx_image_enum *) *pinfo;
+                    /* Apply inverse of the image matrix to our 
+                       image size to get our bounding box. */
+                    bbox_in.p.x = 0;
+                    bbox_in.p.y = 0;
+                    bbox_in.q.x = pim->Width;
+                    bbox_in.q.y = pim->Height;
+                    code = gs_bbox_transform_inverse(&bbox_in, &(pim->ImageMatrix), 
+                                                &bbox_out);
+                    if (code < 0) return code;
+                    /* Set up a compositor action for pushing the group */
+                    if_debug0('v', "[v]Pushing special trans group for image\n");
+                    tgp.Isolated = true;
+                    tgp.Knockout = false;
+                    tgp.mask_id = 0;
+                    tgp.image_with_SMask = false;
+                    tgp.idle = false;
+                    tgp.iccprofile = NULL;
+                    tgp.icc_hashcode = 0;
+                    tgp.group_color_numcomps = ptile->ttrans->n_chan-1;
+                    tgp.ColorSpace = NULL;
+                    /* This will handle the compositor command */
+                    gs_begin_transparency_group((gs_state *) pis_noconst, &tgp, 
+                                                &bbox_out);
+                    ptile->ttrans->image_render = penum->render;
+                    penum->render = &pdf14_pattern_trans_render;
+                    ptile->trans_group_popped = false;
+                    pis_noconst->has_transparency = false;
+                    pis_noconst->trans_device = NULL;
+                    return code;
+                }
+            }
+        }
+    }
+    /* This basically tries high level images for clist. If that fails
+       then we do the default */
     code = gx_forward_begin_typed_image(dev, pis, pmat,
 			    pic, prect, pdcolor, pcpath, mem, pinfo);  
     if (code < 0){
@@ -5899,9 +6381,12 @@
 	     */
 	    p14dev = (pdf14_clist_device *)(*pcdev);
             if (cdev->clist_color_info.num_components * 8 != cdev->clist_color_info.depth &&
-			p14dev->my_encode_color != pdf14_compressed_encode_color)
-                cdev->clist_color_info.depth = cdev->clist_color_info.num_components * 8;
+		p14dev->my_encode_color != pdf14_compressed_encode_color) {
+                    int i = (cdev->clist_color_info.num_components);
 
+		    i += mem->gs_lib_ctx->BITTAG == GS_DEVICE_DOESNT_SUPPORT_TAGS ? 0 : 1;
+		    cdev->clist_color_info.depth = 8 * i;
+	    }
 	    p14dev->saved_target_color_info = dev->color_info;
 	    dev->color_info = (*pcdev)->color_info;
 	    p14dev->saved_target_encode_color = dev->procs.encode_color;

Modified: branches/chrisl-test-gs/base/gdevp14.h
===================================================================
--- branches/chrisl-test-gs/base/gdevp14.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevp14.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -118,7 +118,7 @@
     int (*parent_color_comp_index)(gx_device *, const char *, int, int); 
     const pdf14_procs_t * unpack_procs;
     const pdf14_nonseparable_blending_procs_t * parent_blending_procs;
-    cmm_profile_t *icc_profile;
+    cmm_profile_t *icc_profile;  /* Opaque to GC.  Allocated in non-gc memory */
     pdf14_parent_color_t *previous;
  
 };
@@ -136,6 +136,7 @@
 
     bool has_alpha_g;
     bool has_shape;
+    bool has_tags;
 
     gs_int_rect rect;
     /* Note: the traditional GS name for rowstride is "raster" */

Modified: branches/chrisl-test-gs/base/gdevpdf.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdf.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdf.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1060,7 +1060,7 @@
 	    gx_finish_output_page(dev, num_copies, flush));
 }
 
-int find_end_xref_section (gx_device_pdf *pdev, FILE *tfile, int start, int resource_pos)
+static int find_end_xref_section (gx_device_pdf *pdev, FILE *tfile, int start, int resource_pos)
 {
     int start_offset = (start - pdev->FirstObjectNumber) * sizeof(ulong);
 
@@ -1070,9 +1070,10 @@
 
 	for (i = start; i < pdev->next_id; ++i) {
 	    ulong pos;
-	    char str[21];
 
 	    r = fread(&pos, sizeof(pos), 1, tfile);
+	    if (r != 1)
+		return(gs_note_error(gs_error_ioerror));
 	    if (pos & ASIDES_BASE_POSITION)
 		pos += resource_pos - ASIDES_BASE_POSITION;
 	    pos -= pdev->OPDFRead_procset_length;
@@ -1084,7 +1085,7 @@
     return pdev->next_id;
 }
 
-write_xref_section(gx_device_pdf *pdev, FILE *tfile, int start, int end, int resource_pos)
+static int write_xref_section(gx_device_pdf *pdev, FILE *tfile, int start, int end, int resource_pos)
 {
     int start_offset = (start - pdev->FirstObjectNumber) * sizeof(ulong);
 
@@ -1097,6 +1098,8 @@
 	    char str[21];
 
 	    r = fread(&pos, sizeof(pos), 1, tfile);
+	    if (r != 1)
+		return(gs_note_error(gs_error_ioerror));
 	    if (pos & ASIDES_BASE_POSITION)
 	        pos += resource_pos - ASIDES_BASE_POSITION;
 	    pos -= pdev->OPDFRead_procset_length;
@@ -1104,6 +1107,7 @@
 	    stream_puts(pdev->strm, str);
 	}
     }
+    return 0;
 }
 
 /* Close the device. */

Modified: branches/chrisl-test-gs/base/gdevpdfb.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfb.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfb.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -26,6 +26,7 @@
 #include "gxchar.h"
 #include "gdevpdtf.h"		/* Required to include gdevpdti.h */
 #include "gdevpdti.h"		/* For pdf_charproc_x_offset */
+#include "gsptype1.h"
 
 /* We need this color space type for constructing temporary color spaces. */
 extern const gs_color_space_type gs_color_space_type_Indexed;
@@ -170,7 +171,6 @@
 		y -= y_offset;
 		y -= h;
 		pdf_make_bitmap_image(&image, x, y, w, h);
-		y+= h;
 		/*
 		 * The Y axis of the text matrix is inverted,
 		 * so we need to negate the Y offset appropriately.
@@ -202,7 +202,6 @@
 	    y -= pdf_charproc_y_offset(pcp);
 	    y -= h;
 	    pdf_make_bitmap_image(&image, x, y, w, h);
-	    y += h;
 	    goto rx;
 	}
 	set_image_color(pdev, one);
@@ -487,7 +486,7 @@
 
     if (width <= 0 || height <= 0)
 	return 0;
-    if (depth > 1 || (!gx_dc_is_pure(pdcolor) != 0 && pdcolor->type != &gx_dc_pattern))
+    if (depth > 1 || (!gx_dc_is_pure(pdcolor) != 0 && !(gx_dc_is_pattern1_color(pdcolor))))
 	return gx_default_fill_mask(dev, data, data_x, raster, id,
 				    x, y, width, height, pdcolor, depth, lop,
 				    pcpath);

Modified: branches/chrisl-test-gs/base/gdevpdfb.h
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfb.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfb.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -125,6 +125,7 @@
  0 /*false*/,			/* ResourcesBeforeUsage */
  1 /*true*/,			/* HavePDFWidths */
  0 /*false*/,			/* HaveStrokeColor */
+ 0 /*true*/,			/* ProduceDSC */
  1 /*true*/,			/* HaveTransparency */
  0 /*false*/,			/* PatternImagemask */
  0 /*false*/,			/* PDFX */

Modified: branches/chrisl-test-gs/base/gdevpdfc.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfc.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfc.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -545,20 +545,28 @@
     byte *serialized = NULL, serialized0[100];
     pdf_resource_t *pres = NULL;
     int code;
+#if 0
     bool islab = false;
+#endif
 
     /* If color space is CIE based and we have compatibility then go ahead and use the ICC alternative */
     if ((pdev->CompatibilityLevel < 1.3) || !gs_color_space_is_PSCIE(pcs_in) ) {
         pcs = pcs_in;
     } else {
+        pcs = pcs_in;
+        /* The snippet below creates an ICC equivalent profile for the PS
+           color space.  This is disabled until I add the capability to
+           specify the profile version to ensure compatability with
+           the PDF versions */
+#if 0
         if (pcs_in->icc_equivalent != NULL) {
             pcs = pcs_in->icc_equivalent;
         } else {
             /* Need to create the equivalent object */
-            
             gs_colorspace_set_icc_equivalent((gs_color_space *)pcs_in, &islab, pdev->memory);
             pcs = pcs_in->icc_equivalent;
         }
+#endif
     }
     csi = gs_color_space_get_index(pcs);
     /* Note that if csi is ICC, check to see if this was one of 

Modified: branches/chrisl-test-gs/base/gdevpdfd.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfd.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfd.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -985,6 +985,7 @@
     cvd->m = *m;
     if (write_on_close) {
 	cvd->mdev.is_open = true;
+	if (mask)
 	mask->is_open = true;
 	dev_proc(&cvd->mdev, close_device) = lcvd_close_device_with_writing;
     }
@@ -1391,8 +1392,8 @@
 	    psmat = &smat;
 	}
 	pprintg4(pdev->strm, "%g %g %g %g re f\n",
-		fixed2float(box1.p.x) * scale, fixed2float(box1.p.y) * scale,
-		fixed2float(box1.q.x - box1.p.x) * scale, fixed2float(box1.q.y - box1.p.y) * scale);
+		fixed2float(box1.p.x) / scale, fixed2float(box1.p.y) / scale,
+		fixed2float(box1.q.x - box1.p.x) / scale, fixed2float(box1.q.y - box1.p.y) / scale);
 	if (psmat)
 	    stream_puts(pdev->strm, "Q\n");
 	return 0;

Modified: branches/chrisl-test-gs/base/gdevpdfe.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfe.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfe.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -292,12 +292,14 @@
 	return 0; /* Must_not_happen, because the string is PS encoded. */
     c = data[*index];
     switch (c) {
-	case '(': (*index)++; return '(';
-	case ')': (*index)++; return ')';
-	case '\\': (*index)++; return '\\';
-	case 'n': (*index)++; return '\n';
-	case 'r': (*index)++; return '\r';
-	case 't': (*index)++; return '\t';
+	case '(': return '(';
+	case ')': return ')';
+	case '\\': return '\\';
+	case 'n': return '\n';
+	case 'r': return '\r';
+	case 't': return '\t';
+	case 'b': return '\b';
+	case 'f': return '\f';
 	default:
 	    break;
     }
@@ -368,7 +370,7 @@
 	    }
 	    buf0b = (UTF16 *)(buf0 + 2);
 	    switch (ConvertUTF16toUTF8((const UTF16**)&buf0b, (UTF16 *)(buf0 + j),
-			     &buf1b, buf1 + j, strictConversion)) {
+			     &buf1b, buf1 + (data_length * sizeof(unsigned char)), strictConversion)) {
 		case conversionOK:
 		    write(s, buf1, buf1b - buf1);
 		    gs_free_object(pdev->memory, buf1, "pdf_xmp_write_translated");

Modified: branches/chrisl-test-gs/base/gdevpdfg.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfg.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfg.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -886,7 +886,7 @@
     char trs[17 + MAX_FN_CHARS + 1];
     int code = pdf_write_transfer(pdev, porder->transfer, "/TransferFunction",
 				  trs);
-    long id, spot_id;
+    long spot_id;
     stream *s;
     int i = countof(ht_functions);
     gs_memory_t *mem = pdev->pdf_memory;
@@ -935,7 +935,7 @@
 	if (code < 0) 
 	    return code;
     }	
-    *pid = id = pdf_begin_separate(pdev);
+    *pid = pdf_begin_separate(pdev);
     s = pdev->strm;
     /* Use the original, requested frequency and angle. */
     pprintg2(s, "<</Type/Halftone/HalftoneType 1/Frequency %g/Angle %g",
@@ -1002,7 +1002,6 @@
 			     const gx_ht_order *porder, long *pid)
 {
     char trs[17 + MAX_FN_CHARS + 1];
-    stream *s;
     pdf_data_writer_t writer;
     int code = pdf_write_transfer(pdev, porder->transfer, "",
 				  trs);
@@ -1010,7 +1009,6 @@
     if (code < 0)
 	return code;
     CHECK(pdf_begin_data(pdev, &writer)); 
-    s = pdev->strm;
     *pid = writer.pres->object->id;
     CHECK(cos_dict_put_c_strings((cos_dict_t *)writer.pres->object,
 	"/Type", "/Halftone"));
@@ -1040,7 +1038,6 @@
     if (code < 0)
 	return code;
     CHECK(pdf_begin_data(pdev, &writer)); 
-    s = pdev->strm;
     *pid = writer.pres->object->id;
     CHECK(cos_dict_put_c_strings((cos_dict_t *)writer.pres->object,
 	"/Type", "/Halftone"));

Modified: branches/chrisl-test-gs/base/gdevpdfi.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfi.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfi.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -363,7 +363,7 @@
 	is_mask = pim1->ImageMask;
 	if (is_mask) {
 	    /* If parameters are invalid, use the default implementation. */
-	    if (pdcolor->type != &gx_dc_pattern)
+	    if (!(gx_dc_is_pattern1_color(pdcolor)))
 		if (pim1->BitsPerComponent != 1 ||
 		    !((pim1->Decode[0] == 0.0 && pim1->Decode[1] == 1.0) ||
 		      (pim1->Decode[0] == 1.0 && pim1->Decode[1] == 0.0))
@@ -664,7 +664,10 @@
 	        convert_to_process_colors = true;
         }
     }
-    if (image[0].pixel.ColorSpace != NULL) { /* Not an imagemask. */
+    if (image[0].pixel.ColorSpace != NULL && !(context == PDF_IMAGE_TYPE3_MASK)) { 
+	/* Not an imagemask. Also not a SMask, we carefully made a Gray space
+	 * for SMasks above, do not destroy it now!
+	 */
 	if ((pdev->params.ColorConversionStrategy == ccs_Gray &&
 	     !check_image_color_space(&image[0].pixel, gs_color_space_index_DeviceGray)) ||
 	    (pdev->params.ColorConversionStrategy == ccs_sRGB &&
@@ -710,7 +713,21 @@
 	image[0].pixel.ColorSpace = pcs_device;
     }
     pdev->ParamCompatibilityLevel = pdev->CompatibilityLevel;
-    if ((code = pdf_begin_write_image(pdev, &pie->writer, gs_no_id, width,
+    
+    /* This is rather hacky. the gs_image_pixel_t union has copies of the image
+     * information, including the ColorSpace, but it does not increment the
+     * reference counts of the counted objects (teh ColorSpace) when it makes
+     * copies. However, if psdf_setup_image_filters() should change the colour
+     * space into DeviceCMYK because it converts the image, it will decrement
+     * the reference count of the original space. There is at least one place
+     * where it is called with the original space, so we can't simply remove
+     * the decrement. Handling this properly would entail incrementing the
+     * reference count when we make the copy, and correctly decrementing it
+     * in all the error conditions. Its easier to isolate the changes to
+     * this piece of code.
+     */
+    rc_increment_cs(image[0].pixel.ColorSpace);
+    if ((pdf_begin_write_image(pdev, &pie->writer, gs_no_id, width,
 		    height, pnamed, in_line)) < 0 ||
 	/*
 	 * Some regrettable PostScript code (such as LanguageLevel 1 output
@@ -721,15 +738,21 @@
 	 * filters if the transfer function(s) is/are other than the
 	 * identity.
 	 */
-	(code = (pie->writer.alt_writer_count == 1 ?
+	((pie->writer.alt_writer_count == 1 ?
 		 psdf_setup_lossless_filters((gx_device_psdf *) pdev,
 					     &pie->writer.binary[0],
 					     &image[0].pixel, in_line) :
 		 psdf_setup_image_filters((gx_device_psdf *) pdev,
 					  &pie->writer.binary[0], &image[0].pixel,
 					  pmat, pis, true, in_line))) < 0
-	)
+	) {
+	if (image[0].pixel.ColorSpace == pim->ColorSpace)
+	    rc_decrement_only_cs(pim->ColorSpace, "psdf_setup_image_filters");
 	goto fail;
+    }
+    if (image[0].pixel.ColorSpace == pim->ColorSpace)
+        rc_decrement_only_cs(pim->ColorSpace, "psdf_setup_image_filters");
+
     if (convert_to_process_colors) {
 	image[0].pixel.ColorSpace = pcs_orig;
 	code = psdf_setup_image_colors_filter(&pie->writer.binary[0], 
@@ -738,6 +761,9 @@
   	    goto fail;
 	image[0].pixel.ColorSpace = pcs_device;
     }
+
+    /* See the comment above about reference counting of the colour space */
+    rc_increment_cs(image[1].pixel.ColorSpace);
     if (pie->writer.alt_writer_count > 1) {
         code = pdf_make_alt_stream(pdev, &pie->writer.binary[1]);
         if (code)
@@ -752,17 +778,26 @@
 	    pie->writer.alt_writer_count = 1;
 	    memset(pie->writer.binary + 1, 0, sizeof(pie->writer.binary[1]));
 	    memset(pie->writer.binary + 2, 0, sizeof(pie->writer.binary[1]));
-	} else if (code)
+	} else if (code) {
+	    if (image[1].pixel.ColorSpace == pim->ColorSpace)
+		rc_decrement_only_cs(pim->ColorSpace, "psdf_setup_image_filters");
 	    goto fail;
+	}
 	else if (convert_to_process_colors) {
 	    image[1].pixel.ColorSpace = pcs_orig;
 	    code = psdf_setup_image_colors_filter(&pie->writer.binary[1], 
 		    (gx_device_psdf *)pdev, &image[1].pixel, pis);
-	    if (code < 0)
+	    if (code < 0) {
+		if (image[1].pixel.ColorSpace == pim->ColorSpace)
+		    rc_decrement_only_cs(pim->ColorSpace, "psdf_setup_image_filters");
   		goto fail;
+	    }
 	    image[1].pixel.ColorSpace = pcs_device;
 	}
     }
+    if (image[1].pixel.ColorSpace == pim->ColorSpace)
+        rc_decrement_only_cs(pim->ColorSpace, "psdf_setup_image_filters");
+
     for (i = 0; i < pie->writer.alt_writer_count; i++) {
 	code = pdf_begin_image_data_decoded(pdev, num_components, pranges, i,
 			     &image[i].pixel, &cs_value, pie);
@@ -1242,6 +1277,8 @@
 	code = gx_default_begin_typed_image
 	    ((gx_device *)&cvd->mdev, pis, pmat, pic, prect, pdcolor, NULL, mem,
 	    pinfo);
+	if (code < 0)
+	    return code;
     } else {
 	code = pdf_make_mxd(pmcdev, midev, mem);
 	if (code < 0)
@@ -1249,6 +1286,8 @@
 	code = pdf_begin_typed_image
 	    ((gx_device_pdf *)dev, pis, pmat, pic, prect, pdcolor, pcpath, mem,
 	    pinfo, PDF_IMAGE_TYPE3_DATA);
+	if (code < 0)
+	    return code;
     }
     /* Due to equal image merging, we delay the adding of the "Mask" entry into 
        a type 3 image dictionary until the mask is completed. 
@@ -1286,8 +1325,6 @@
 {
     int code;
     pdf_image_enum *pmie;
-    pdf_image_enum *pmce;
-    cos_stream_t *pmcs;
     int i;
     const gs_image3x_mask_t *pixm;
 
@@ -1314,8 +1351,6 @@
 	return_error(gs_error_rangecheck);
     }
     pmie = (pdf_image_enum *)pminfo[i];
-    pmce = (pdf_image_enum *)(*pinfo);
-    pmcs = (cos_stream_t *)pmce->writer.pres->object;
     /*
      * Add the SMask entry to the image dictionary, and, if needed,
      * the Matte entry to the mask dictionary.

Modified: branches/chrisl-test-gs/base/gdevpdfj.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfj.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfj.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -419,14 +419,14 @@
 	    int lines_left = piw->height - data_h;
 	    byte buf[256];
 	    const uint lb = sizeof(buf);
-	    int i, l, status;
+	    int i, l;
 	    uint ignore;
 
 	    memset(buf, 128, lb);
 	    for (; lines_left; lines_left--) 
 		for (i = 0; i < piw->alt_writer_count; i++) {
 		    for (l = bytes_per_line; l > 0; l -= lb)
-			if ((status = sputs(piw->binary[i].strm, buf, min(l, lb), 
+			if ((sputs(piw->binary[i].strm, buf, min(l, lb), 
 					    &ignore)) < 0)
 			    return_error(gs_error_ioerror);
 		}

Modified: branches/chrisl-test-gs/base/gdevpdfk.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfk.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfk.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -60,19 +60,69 @@
 /* Transform a CIEBased color to XYZ. */
 static int
 cie_to_xyz(const double *in, double out[3], const gs_color_space *pcs,
-	   const gs_imager_state *pis)
+	   const gs_imager_state *pis, const gs_cie_common *pciec)
 {
     gs_client_color cc;
     frac xyz[3];
     int ncomp = gs_color_space_num_components(pcs);
     int i;
+    gx_device dev;
+    gs_color_space_index cs_index;
+    const gs_vector3 *const pWhitePoint = &pciec->points.WhitePoint;
+    double xyz_float[3];
 
+    cs_index = gs_color_space_get_index(pcs);
+    /* Need a device profile */
+    dev.device_icc_profile = pcs->cmm_icc_profile_data;
+
     for (i = 0; i < ncomp; ++i)
 	cc.paint.values[i] = in[i];
-    cs_concretize_color(&cc, pcs, xyz, pis);
-    out[0] = frac2float(xyz[0]);
-    out[1] = frac2float(xyz[1]);
-    out[2] = frac2float(xyz[2]);
+
+    /* The standard concretization makes use of the equivalent ICC profile
+       to ensure that all color management is handled by the CMM. 
+       Unfortunately, we can't do that here since we have no access to the
+       icc manager.  Also the PDF write outputs have restrictions on the
+       ICC profiles that can be embedded so we must use this older form.
+       Need to add an ICC version number into the icc creator to enable
+       creation to and from various versions */
+
+    switch (cs_index) {
+        case gs_color_space_index_CIEA:
+            gx_psconcretize_CIEA(&cc, pcs, xyz, pis);
+            break;
+        case gs_color_space_index_CIEABC:
+            gx_psconcretize_CIEABC(&cc, pcs, xyz, pis);
+            break;
+        case gs_color_space_index_CIEDEF:
+            gx_psconcretize_CIEDEF(&cc, pcs, xyz, pis);
+            break;
+        case gs_color_space_index_CIEDEFG:
+           gx_psconcretize_CIEDEFG(&cc, pcs, xyz, pis);
+           break;
+        default:
+            break;
+    }
+    if (cs_index == gs_color_space_index_CIEA) {
+        /* AR forces this case to always be achromatic.  We will
+        do the same even though it does not match the PS
+        specification */
+        /* Use the resulting Y value to scale the wp Illumination.
+        note that we scale to the whitepoint here.  Matrix out
+        handles mapping to CIE D50.  This forces an achromatic result */
+        xyz_float[1] = frac2float(xyz[1]);
+        xyz_float[0] = pWhitePoint->u * xyz_float[1];
+        xyz_float[2] = pWhitePoint->w * xyz_float[1];
+    } else {
+        xyz_float[0] = frac2float(xyz[0]);
+        xyz_float[1] = frac2float(xyz[1]);
+        xyz_float[2] = frac2float(xyz[2]);
+    }
+
+    /* Do wp mapping to D50 in XYZ for now.  We should do bradford correction.
+       Will add that in next release */
+    out[0] = xyz_float[0]*0.9642/pWhitePoint->u;
+    out[1] = xyz_float[1];
+    out[2] = xyz_float[2]*0.8249/pWhitePoint->w;
     return 0;
 }
 
@@ -132,7 +182,7 @@
 
 	for (j = 0; j < ncomp; ++j)
 	    in[j] = (i & (1 << j) ? ranges[j].rmax : ranges[j].rmin);
-	if (cie_to_xyz(in, xyz, pcs, pis) >= 0) {
+	if (cie_to_xyz(in, xyz, pcs, pis, pciec) >= 0) {
 	    double lab[3];
 
 	    xyz_to_lab(xyz, lab, pciec);
@@ -205,7 +255,27 @@
     int code;
     cos_stream_t * pcstrm = 0;
     cos_array_t * prngca = 0;
+    bool std_ranges = true;
+    bool scale_inputs = false;
+    int i;
 
+    /* Check the ranges. */
+    if (pprange)
+	*pprange = 0;
+    for (i = 0; i < ncomps; ++i) {
+	double rmin = prange[i].rmin, rmax = prange[i].rmax;
+
+	if (rmin < 0.0 || rmax > 1.0) {
+	    /* We'll have to scale the inputs.  :-( */
+	    if (pprange == 0)
+		return_error(gs_error_rangecheck); /* scaling not allowed */
+	    *pprange = prange;
+	    scale_inputs = true;
+	}
+	else if (rmin > 0.0 || rmax < 1.0)
+	    std_ranges = false;
+    }
+
     /* Range values are a bit tricky to check.
        For example, CIELAB ICC profiles have
        a unique range.  I am not convinced
@@ -229,10 +299,12 @@
     if (code < 0)
 	goto fail;
 
-    /* Always add the range */
+    /* Indicate the range, if needed. */
+    if (!std_ranges && !scale_inputs) {
 	code = pdf_cie_add_ranges(cos_stream_dict(pcstrm), prange, ncomps, true);
 	if (code < 0)
 	    goto fail;
+    }
 
     /* In the new design there may not be a specified alternate color space */
     if (pcs_alt != NULL){
@@ -293,7 +365,8 @@
     const byte *data;
     uint length;
     uint data_length;		/* may be < length if write != 0 */
-    int (*write)(cos_stream_t *, const profile_table_t *, gs_memory_t *);
+    int (*write)(cos_stream_t *, const profile_table_t *, gs_memory_t *, 
+                 const gs_cie_common *pciec);
     const void *write_data;
     const gs_range_t *ranges;
 };
@@ -346,8 +419,8 @@
     p[1] = (byte)value;
 }
 /* Create and write a TRC curve table. */
-static int write_trc_abc(cos_stream_t *, const profile_table_t *, gs_memory_t *);
-static int write_trc_lmn(cos_stream_t *, const profile_table_t *, gs_memory_t *);
+static int write_trc_abc(cos_stream_t *, const profile_table_t *, gs_memory_t *, const gs_cie_common *);
+static int write_trc_lmn(cos_stream_t *, const profile_table_t *, gs_memory_t *, const gs_cie_common *);
 static profile_table_t *
 add_trc(profile_table_t **ppnt, const char *tag, byte bytes[12],
 	const gs_cie_common *pciec, cie_cache_one_step_t one_step)
@@ -386,7 +459,7 @@
 
 static int
 write_trc_abc(cos_stream_t *pcstrm, const profile_table_t *pnt,
-	      gs_memory_t *ignore_mem)
+	      gs_memory_t *ignore_mem, const gs_cie_common *unused)
 {
     /* Write the curve table from DecodeABC. */
     const gs_cie_abc *pabc = pnt->write_data;
@@ -403,7 +476,7 @@
 }
 static int
 write_trc_lmn(cos_stream_t *pcstrm, const profile_table_t *pnt,
-	      gs_memory_t *ignore_mem)
+	      gs_memory_t *ignore_mem, const gs_cie_common *unused)
 {
     const gs_cie_common *pciec = pnt->write_data;
     int ci = rgb_to_index(pnt);
@@ -428,7 +501,8 @@
     int num_points;		/* on each axis of LUT */
     int count;			/* total # of entries in LUT */
 } icc_a2b0_t;
-static int write_a2b0(cos_stream_t *, const profile_table_t *, gs_memory_t *);
+static int write_a2b0(cos_stream_t *, const profile_table_t *, gs_memory_t *,
+                      const gs_cie_common *pciec);
 static profile_table_t *
 add_a2b0(profile_table_t **ppnt, icc_a2b0_t *pa2b, int ncomps,
 	 const gs_color_space *pcs)
@@ -469,7 +543,7 @@
 }
 static int
 write_a2b0(cos_stream_t *pcstrm, const profile_table_t *pnt,
-	   gs_memory_t *mem)
+	   gs_memory_t *mem, const gs_cie_common *pciec)
 {
     const icc_a2b0_t *pa2b = pnt->write_data;
     const gs_color_space *pcs = pa2b->pcs;
@@ -503,7 +577,7 @@
 	for (n = i, j = ncomps - 1; j >= 0; --j, n /= num_points)
 	    in[j] = cache_arg(n % num_points, num_points - 1,
 			      (pnt->ranges ? pnt->ranges + j : NULL));
-	cie_to_xyz(in, xyz, pcs, pis);
+	cie_to_xyz(in, xyz, pcs, pis, pciec);
 	/*
 	 * NOTE: Due to an obscure provision of the ICC Profile
 	 * specification, values in a2b0 lookup tables do *not* represent
@@ -526,6 +600,17 @@
 
     return cos_stream_add_bytes(pcstrm, v01, 3 * 4);
 }
+
+/* XYZ wp mapping for now.  Will replace later with Bradford or other */
+static void
+adjust_wp(const gs_vector3 *color_in, const gs_vector3 *wp_in, 
+          gs_vector3 *color_out, const gs_vector3 *wp_out)
+{
+    color_out->u = color_in->u * wp_out->u / wp_in->u;
+    color_out->v = color_in->v * wp_out->v / wp_in->v;
+    color_out->w = color_in->w * wp_out->w / wp_in->w;
+}
+
 static int
 pdf_convert_cie_to_iccbased(gx_device_pdf *pdev, cos_array_t *pca,
 			    const gs_color_space *pcs, const char *dcsname,
@@ -544,7 +629,8 @@
     int ncomps = gs_color_space_num_components(pcs);
     gs_color_space *alt_space;
     cos_stream_t *pcstrm;
-
+    gs_vector3 white_d50;
+    gs_vector3 temp_xyz;
     /*
      * Even though Ghostscript includes icclib, icclib is unusable here,
      * because it requires random access to the output stream.
@@ -600,6 +686,11 @@
     profile_table_t tables[MAX_NUM_TABLES];
     profile_table_t *next_table = tables;
 
+    /* White point must be D50 */
+    white_d50.u = 0.9642f;
+    white_d50.v = 1.0f;
+    white_d50.w = 0.8249f;
+
     pdf_cspace_init_Device(pdev->memory, &alt_space, ncomps);	/* can't fail */
     code = pdf_make_iccbased(pdev, pca, ncomps, prange, alt_space,
 			     &pcstrm, pprange);
@@ -620,8 +711,8 @@
     memcpy(desc, desc_data, sizeof(desc_data));
     DISCARD(add_table(&next_table, "desc", desc, sizeof(desc)));
 
-    /* wtpt */
-    add_table_xyz3(&next_table, "wtpt", wtpt, &pciec->points.WhitePoint);
+    /* wtpt. must be D50 */
+    add_table_xyz3(&next_table, "wtpt", wtpt, &white_d50);
     memcpy(header + 68, wtpt + 8, 12); /* illuminant = white point */
 
     /* cprt */
@@ -643,9 +734,15 @@
 	    tg->ranges = *pprange + 1;
 	    tb->ranges = *pprange + 2;
 	}
-	add_table_xyz3(&next_table, "rXYZ", rXYZ, &pmat->cu);
-	add_table_xyz3(&next_table, "gXYZ", gXYZ, &pmat->cv);
-	add_table_xyz3(&next_table, "bXYZ", bXYZ, &pmat->cw);
+        /* These values need to be adjusted to D50.  Again
+           use XYZ wp mapping for now.  Later we will add in
+           the bradford stuff */
+        adjust_wp(&(pmat->cu), &(pciec->points.WhitePoint), &temp_xyz, &white_d50);
+	add_table_xyz3(&next_table, "rXYZ", rXYZ, &temp_xyz);
+        adjust_wp(&(pmat->cv), &(pciec->points.WhitePoint), &temp_xyz, &white_d50);
+	add_table_xyz3(&next_table, "gXYZ", gXYZ, &temp_xyz);
+        adjust_wp(&(pmat->cw), &(pciec->points.WhitePoint), &temp_xyz, &white_d50);
+	add_table_xyz3(&next_table, "bXYZ", bXYZ, &temp_xyz);
     } else {
 	/* General case, use a lookup table. */
 	/* AToB (mft2) */
@@ -681,7 +778,7 @@
 
 	    if ((code = cos_stream_add_bytes(pcstrm, tables[i].data, len)) < 0 ||
 		(tables[i].write != 0 &&
-		 (code = tables[i].write(pcstrm, &tables[i], pdev->pdf_memory)) < 0) ||
+		 (code = tables[i].write(pcstrm, &tables[i], pdev->pdf_memory, pciec)) < 0) ||
 		(code = cos_stream_add_bytes(pcstrm, pad, 
 			-(int)(tables[i].length) & 3)) < 0
 		)

Modified: branches/chrisl-test-gs/base/gdevpdfm.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfm.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfm.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1512,7 +1512,7 @@
 		    return_error(gs_error_VMerror);
 		memcpy(str, vdata, j);
 		memcpy(str + j, buf + 1, len);
-		alt_pair[1].data = vdata = str;
+		alt_pair[1].data = str;
 		alt_pair[1].size = vsize = j + len;
 		pair = alt_pair;
 	    }

Modified: branches/chrisl-test-gs/base/gdevpdfo.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfo.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfo.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1279,6 +1279,9 @@
 	gs_alloc_struct(mem, cos_stream_t, &st_cos_object, cname);
 
     cos_object_init((cos_object_t *)pcs, pdev, &cos_stream_procs);
+    pcs->md5_valid = 0;
+    gs_md5_init(&pcs->md5);
+    memset(&pcs->hash, 0x00, 16);
     return pcs;
 }
 
@@ -1298,12 +1301,38 @@
     cos_dict_release(pco, cname);
 }
 
+static int hash_cos_stream(gs_memory_t *mem, const cos_object_t *pco, FILE *sfile, uint64_t *hash)
+{
+    const cos_stream_t *pcs = (const cos_stream_t *)pco;
+    cos_stream_piece_t *pcsp = pcs->pieces;
+    byte *ptr;
+    long position_save = ftell(sfile);
+    int result;
+    gs_md5_state_t md5;
+
+    gs_md5_init(&md5);
+    
+    while(pcsp) {
+	ptr = gs_malloc(mem, sizeof (byte), pcsp->size, "hash_cos_stream");
+	fseek(sfile, pcsp->position, SEEK_SET);
+	if (fread(ptr, 1, pcsp->size, sfile) != pcsp->size) {
+	    result = gs_note_error(gs_error_ioerror);
+	    return result;
+	}
+	gs_md5_append(&md5, ptr, pcsp->size);
+	gs_free(mem, ptr, sizeof (byte), pcsp->size, "hash_cos_stream");
+	pcsp = pcsp->next;
+    }
+    fseek(sfile, position_save, SEEK_SET);
+    gs_md5_finish(&md5, (gs_md5_byte_t *)hash);
+    return 0;
+}
+
 static int
 cos_stream_equal(const cos_object_t *pco0, const cos_object_t *pco1, gx_device_pdf *pdev)
 {
     const cos_stream_t *pcs0 = (const cos_stream_t *)pco0;
     const cos_stream_t *pcs1 = (const cos_stream_t *)pco1;
-    bool result = false;
     int code;
 
     code = cos_dict_equal(pco0, pco1, pdev);
@@ -1311,46 +1340,17 @@
 	return code;
     if (!code)
 	return false;
-    {
-	/* fixme : this assumes same segmentation for both streams.
-	   In general it is not true. */
-	FILE *sfile = pdev->streams.file;
-	cos_stream_piece_t *pcsp0 = pcs0->pieces, *pcsp1 = pcs1->pieces;
-	long position_save = ftell(sfile);
-
-	for (; pcsp0 && pcsp1; pcsp0 = pcsp0->next, pcsp1 = pcsp1->next) {
-	    long position0 = pcsp0->position;
-	    long position1 = pcsp1->position;
-	    uint size0 = pcsp0->size;
-	    uint size1 = pcsp1->size;
-	    byte buf0[512], buf1[sizeof(buf0)];
-
-	    if (size0 != size1)
-		goto notequal;
-	    for(; size0; position0 += size1, position1 += size1, size0 -= size1) {
-		size1 = min(sizeof(buf0), size0);
-		fseek(sfile, position0, SEEK_SET);
-		if (fread(buf0, 1, size1, sfile) != size1) {
-		    result = gs_note_error(gs_error_ioerror);
-		    goto notequal;
+    if (!pco0->md5_valid) {
+	hash_cos_stream(pdev->memory, pco0, pdev->streams.file, (uint64_t *)&pcs0->hash);
 		}
-		fseek(sfile, position1, SEEK_SET);
-		if (fread(buf1, 1, size1, sfile) != size1) {
-		    result = gs_note_error(gs_error_ioerror);
-		    goto notequal;
+    if (!pco1->md5_valid) {
+	hash_cos_stream(pdev->memory, pco1, pdev->streams.file, (uint64_t *)&pcs1->hash);
 		}
-		if (memcmp(buf0, buf1, size1))
-		    goto notequal;
+    if (memcmp(&pcs0->hash, &pcs1->hash, 16) == 0)
+	return true;
+    return false;
+
 	    }
-	}
-	if (pcsp0 || pcsp1)
-	    goto notequal;
-	result = true;
-notequal:
-	fseek(sfile, position_save, SEEK_SET);
-	return result;
-    }
-}
 
 /* Find the total length of a stream. */
 long
@@ -1554,6 +1554,7 @@
     int code;
 
     stream_write(target, pr->ptr + 1, count);
+    gs_md5_append(&ss->pcs->md5, pr->ptr + 1, count);
     pr->ptr = pr->limit;
     sflush(target);
     code = cos_stream_add(ss->pcs, (uint)(stell(pdev->streams.strm) - start_pos));
@@ -1567,6 +1568,8 @@
 
     sflush(s);
     status = s_close_filters(&ss->target, ss->pdev->streams.strm);
+    gs_md5_finish(&ss->pcs->md5, (gs_md5_byte_t *)ss->pcs->hash);
+    ss->pcs->md5_valid = 1;
     return (status < 0 ? status : s_std_close(s));
 }
 
@@ -1592,6 +1595,9 @@
 	goto fail;
     ss->template = &cos_write_stream_template;
     ss->pcs = pcs;
+    ss->pcs->md5_valid = 0;
+    gs_md5_init(&ss->pcs->md5);
+    memset(&ss->pcs->hash, 0x00, 16);
     ss->pdev = pdev;
     ss->s = s;
     ss->target = pdev->streams.strm; /* not s->strm */

Modified: branches/chrisl-test-gs/base/gdevpdfo.h
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfo.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfo.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -34,6 +34,7 @@
  */
 
 #include "gsparam.h"
+#include "smd5.h"
 
 /* Define some needed abstract types. */
 #ifndef gx_device_pdf_DEFINED
@@ -114,6 +115,9 @@
     byte written;		/* see above */\
     long length;                /* only for stream objects */\
     stream *input_strm;		/* only for stream objects */\
+    gs_md5_state_t md5;         /* only for stream objects */\
+    int md5_valid;              /* only for stream objects */\
+    byte hash[16];		/* only for stream objects */\
     /* input_strm is introduced recently for pdfmark. */\
     /* Using this field, psdf_binary_writer_s may be simplified. */\
 }

Modified: branches/chrisl-test-gs/base/gdevpdfp.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfp.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfp.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -84,6 +84,7 @@
 
 	/* Target viewer capabilities (Ghostscript-specific)  */
  /* pi("ForOPDFRead", gs_param_type_bool, ForOPDFRead),			    pdfwrite-only */
+    pi("ProduceDSC", gs_param_type_bool, ProduceDSC),
     pi("PatternImagemask", gs_param_type_bool, PatternImagemask),
     pi("MaxClipPathSize", gs_param_type_int, MaxClipPathSize),
     pi("MaxShadingBitmapSize", gs_param_type_int, MaxShadingBitmapSize),
@@ -212,7 +213,8 @@
 	(param_requested(plist, "DSC") > 0 &&
 	 (code = param_write_null(plist, "DSC")) < 0) ||
 	(code = gs_param_write_items(plist, pdev, NULL, pdf_param_items)) < 0
-	);
+	)
+    {}
     return code;
 }
 
@@ -281,6 +283,8 @@
      * psdf_put_params.
      */
     ecode = code = param_read_bool(plist, "LockDistillerParams", &locked);
+    if (ecode < 0)
+	param_signal_error(plist, param_name, ecode);
  
     if (!(locked && pdev->params.LockDistillerParams)) {
 	/* General parameters. */
@@ -289,6 +293,8 @@
 	    int efo = 1;
 
 	    ecode = param_put_int(plist, (param_name = ".EmbedFontObjects"), &efo, ecode);
+	    if (ecode < 0)
+		param_signal_error(plist, param_name, ecode);
 	    if (efo != 1)
 		param_signal_error(plist, param_name, ecode = gs_error_rangecheck);
 	}
@@ -296,6 +302,8 @@
 	    int cdv = CoreDistVersion;
 
 	    ecode = param_put_int(plist, (param_name = "CoreDistVersion"), &cdv, ecode);
+	    if (ecode < 0)
+		return gs_note_error(ecode);
 	    if (cdv != CoreDistVersion)
 		param_signal_error(plist, param_name, ecode = gs_error_rangecheck);
 	}
@@ -317,8 +325,12 @@
 		    cl = (float)1.3;
 		else if (cl < (float)1.45)
 		    cl = (float)1.4;
+		else if (cl < (float)1.55)
+		    cl = (float)1.5;
+		else if (cl < (float)1.65)
+		    cl = (float)1.6;
 		else
-		    cl = (float)1.5;
+		    cl = (float)1.7;
 	    case 1:
 		break;
 	}
@@ -341,7 +353,8 @@
 	    if (code < 0 ||
 		(pdev->is_ps2write && (code = param_read_string(plist, "OPDFReadProcsetPath", &pdev->OPDFReadProcsetPath)) < 0) ||
 		(!pdev->is_ps2write && (code = param_read_bool(plist, "ForOPDFRead", &pdev->ForOPDFRead)) < 0)
-		);
+		){
+	    }
 	    plist->memory = mem;
 	}
 	if (code < 0)
@@ -386,6 +399,11 @@
     }
     if (ecode < 0)
 	goto fail;
+
+    if (pdev->is_ps2write && (code = param_read_bool(plist, "ProduceDSC", &pdev->ProduceDSC)) < 0) {
+	param_signal_error(plist, param_name, code);
+    }
+
     /* PDFA and PDFX are stored in the page device dictionary and therefore
      * set on every setpagedevice. However, if we have encountered a file which
      * can't be made this way, and the PDFACompatibilityPolicy is 1, we want to
@@ -440,6 +458,9 @@
 	pdev->HaveStrokeColor = true;
     }
     pdev->ParamCompatibilityLevel = cl;
+    if (cl < 1.2) {
+	pdev->HaveCFF = false;
+    }
     ecode = gdev_psdf_put_params(dev, plist);
     if (ecode < 0)
 	goto fail;
@@ -538,7 +559,20 @@
     }
     /* Handle the float/double mismatch. */
     pdev->CompatibilityLevel = (int)(cl * 10 + 0.5) / 10.0;
+    if(pdev->OwnerPassword.size != save_dev->OwnerPassword.size || 
+	(pdev->OwnerPassword.size != 0 && 
+	 memcmp(pdev->OwnerPassword.data, save_dev->OwnerPassword.data, 
+	 pdev->OwnerPassword.size) != 0)) {
+	if (pdev->is_open) {
+	    if (pdev->PageCount == 0) {
+	        gs_closedevice((gx_device *)save_dev);
     return 0;
+	    }
+	    else
+	        emprintf(pdev->memory, "Owner Password changed mid-job, ignoring.\n");
+	}
+    }
+    return 0;
  fail:
     /* Restore all the parameters to their original state. */
     pdev->version = save_dev->version;

Modified: branches/chrisl-test-gs/base/gdevpdft.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdft.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdft.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -330,6 +330,11 @@
 	pdev->pres_soft_mask_dict->where_used |= pdev->used_mask;
 	pis->soft_mask_id = pdev->pres_soft_mask_dict->object->id;
 	pdev->pres_soft_mask_dict = NULL;
+	/* We called pdf_start_trnasparency_group (see pdf_begin_transparency_mask
+	 * above) but we don't call pdf_end_transparency_group, so we must reduce
+	 * the FormDepth ourselves.
+	 */
+	pdev->FormDepth--; 
     }
     return 0;
 }

Modified: branches/chrisl-test-gs/base/gdevpdfu.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfu.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfu.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -228,8 +228,29 @@
 }
 
 static int
-copy_procsets(stream *s, const gs_param_string *path, bool HaveTrueTypes)
+copy_ps_file(stream *s, const char *fname, bool HaveTrueTypes)
 {
+    stream *f;
+    char buf[1024];
+    int n, m = sizeof(buf) - 1;
+
+    f = sfopen(fname, "rb", s->memory);
+    if (f == NULL)
+	return_error(gs_error_undefinedfilename);
+    n = sfread(buf, 1, m, f);
+    buf[n] = 0;
+    do {
+	stream_write(s, buf, m);
+	n = sfread(buf, 1, m, f);
+    } while (n);
+    stream_write(s, "\r", 1);
+    sfclose(f);
+    return 0;
+}
+
+static int
+copy_procsets(stream *s, const gs_param_string *path, bool HaveTrueTypes, bool stripping)
+{
     char fname[gp_file_name_sizeof];
     const byte *p = path->data, *e = path->data + path->size;
     int l, i = 0, code;
@@ -257,7 +278,10 @@
 		    }
 		}
 		if (HaveTrueTypes || k < 0) {
+		    if (stripping)
 		    code = copy_ps_file_stripping(s, fname, HaveTrueTypes);
+		    else
+			code = copy_ps_file(s, fname, HaveTrueTypes);
 		    if (code < 0)
 			return code;
 		}
@@ -331,7 +355,10 @@
 		if (code < 0)
 		    return code;
 	    }
-	    code = copy_procsets(s, &pdev->OPDFReadProcsetPath, pdev->HaveTrueTypes);
+	    if (pdev->ProduceDSC)
+		code = copy_procsets(s, &pdev->OPDFReadProcsetPath, pdev->HaveTrueTypes, false);
+	    else
+		code = copy_procsets(s, &pdev->OPDFReadProcsetPath, pdev->HaveTrueTypes, true);
 	    if (code < 0)
 		return code;
 	    if (!pdev->CompressEntireFile) {
@@ -726,7 +753,7 @@
 	    sclose(s);		/* Next terminate the compression filter */
 	    gs_free_object(pdev->pdf_memory, s->cbuf, "zlib buffer");
 	    gs_free_object(pdev->pdf_memory, s, "zlib stream");
-	    pdev->strm = s = fs;
+	    pdev->strm = fs;
 	}
 	pdf_end_encrypt(pdev);
     	s = pdev->strm;
@@ -1292,13 +1319,17 @@
 void
 pdf_copy_data(stream *s, FILE *file, long count, stream_arcfour_state *ss)
 {
-    long r, left = count;
+    long r, left = count, code;
     byte buf[sbuf_size];
     
     while (left > 0) {
 	uint copy = min(left, sbuf_size);
 
 	r = fread(buf, 1, copy, file);
+	if (r < 1) {
+	    code = gs_note_error(gs_error_ioerror);
+	    return;
+	}
 	if (ss)
 	    s_arcfour_process_buffer(ss, buf, copy);
 	stream_write(s, buf, copy);
@@ -1312,7 +1343,7 @@
 void
 pdf_copy_data_safe(stream *s, FILE *file, long position, long count)
 {   
-    long r, left = count;
+    long r, left = count, code;
 
     while (left > 0) {
 	byte buf[sbuf_size];
@@ -1321,6 +1352,10 @@
 
 	fseek(file, position + count - left, SEEK_SET);
 	r = fread(buf, 1, copy, file);
+	if (r < 1) {
+	    code = gs_note_error(gs_error_ioerror);
+	    return;
+	}
 	fseek(file, end_pos, SEEK_SET);
 	stream_write(s, buf, copy);
 	sflush(s);

Modified: branches/chrisl-test-gs/base/gdevpdfv.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfv.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfv.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -200,7 +200,7 @@
 			gs_pattern1_instance_t *pinst)
 {
     gs_pattern1_template_t *t = &pinst->template;
-    gs_matrix smat = ctm_only((gs_imager_state *)pinst->saved);
+    gs_matrix smat2 = ctm_only((gs_imager_state *)pinst->saved), smat;
     double scale_x = pdev->HWResolution[0] / 72.0;
     double scale_y = pdev->HWResolution[1] / 72.0;
     cos_dict_t *pcd = cos_stream_dict((cos_stream_t *)pres->object);
@@ -217,14 +217,23 @@
     bbox[3] = t->BBox.q.y;
     /* The graphics library assumes a shifted origin to provide 
        positive bitmap pixel indices. Compensate it now. */
-    smat.tx += pinst->step_matrix.tx;
-    smat.ty += pinst->step_matrix.ty;
-    smat.xx /= scale_x;
-    smat.xy /= scale_x;
-    smat.yx /= scale_y;
-    smat.yy /= scale_y;
-    smat.tx /= scale_x;
-    smat.ty /= scale_y;
+    smat2.tx += pinst->step_matrix.tx;
+    smat2.ty += pinst->step_matrix.ty;
+    /*
+     * In PDF, the Matrix is the transformation from the pattern space to
+     * the *default* user coordinate space, not the current space.
+     * NB. For a form the default space is the parent. This means that when a
+     * form is nested inside a form, the default space is the space of the
+     * first form, and therefore we do *not* remove the resolution scaling.
+     */
+    if (pdev->FormDepth <= 1) {
+	gs_matrix scaled;
+
+	gs_make_scaling(1 / scale_x, 1 / scale_y, &scaled);
+	gs_matrix_multiply(&smat2, &scaled, &smat); 
+    } else {
+	smat = smat2;
+    }
     if (any_abs(smat.tx) < 0.0001)  /* Noise. */
 	smat.tx = 0;
     if (any_abs(smat.ty) < 0.0001)

Modified: branches/chrisl-test-gs/base/gdevpdfx.h
===================================================================
--- branches/chrisl-test-gs/base/gdevpdfx.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdfx.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -436,6 +436,7 @@
     bool ResourcesBeforeUsage; /* PS2WRITE only. */
     bool HavePDFWidths;        /* PS2WRITE only. */
     bool HaveStrokeColor;      /* PS2WRITE only. */
+    bool ProduceDSC;	       /* PS2WRITE only. */
     bool HaveTransparency;
     bool PatternImagemask; /* The target viewer|printer handles imagemask 
 			      with pattern color. */
@@ -766,6 +767,9 @@
 
 /* ------ Objects ------ */
 
+/* Allocate an ID for a future object, set its pos=0 so we can tell if it is used */
+long pdf_obj_forward_ref(gx_device_pdf * pdev);
+
 /* Allocate an ID for a future object. */
 long pdf_obj_ref(gx_device_pdf * pdev);
 
@@ -1002,7 +1006,7 @@
 #define PDF_FILTER_NAMES\
   "/ASCII85Decode", "/ASCIIHexDecode", "/CCITTFaxDecode",\
   "/DCTDecode",  "/DecodeParms", "/Filter", "/FlateDecode",\
-  "/LZWDecode", "/RunLengthDecode,", "/JBIG2Decode", "/JPXDecode"
+  "/LZWDecode", "/RunLengthDecode", "/JBIG2Decode", "/JPXDecode"
 #define PDF_FILTER_NAMES_SHORT\
   "/A85", "/AHx", "/CCF", "/DCT", "/DP", "/F", "/Fl", "/LZW", "/RL", "/???", "/???"
 

Modified: branches/chrisl-test-gs/base/gdevpdtb.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdtb.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdtb.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -223,7 +223,7 @@
     if (pbfont->do_subset != DO_SUBSET_YES && reserve_glyphs == -1) {
 	/* The only possibly non-subsetted fonts are Type 1/2 and Type 42. */
 	if (is_standard)
-	    complete = copied, code = 0;
+	    complete = copied;
 	else {
 	    code = gs_copy_font((gs_font *)font, &font->FontMatrix, mem, &complete, -1);
 	    if (code < 0)

Modified: branches/chrisl-test-gs/base/gdevpdtc.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdtc.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdtc.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -488,7 +488,6 @@
 		    return_error(gs_error_unregistered); /* Must not happen */
 		if (pdsubf->FontType == ft_user_defined  || pdsubf->FontType == ft_encrypted || 
 				pdsubf->FontType == ft_encrypted2) {
-		    code += 0; /* A good place for a breakpoint. */
 		} else {
 		    pdf_font_resource_t *pdfont;
 		    bool notdef_subst = false;
@@ -702,7 +701,6 @@
 		    type1_glyphs[0] = type1_glyphs[num_type1_glyphs];
 		    num_type1_glyphs = 1;
 		    subfont = saved_subfont;
-		    font_change = 0;
 		} else {
 		    num_type1_glyphs = 0;
 		}

Modified: branches/chrisl-test-gs/base/gdevpdtd.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdtd.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdtd.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -403,7 +403,7 @@
      */
     notdef = GS_NO_GLYPH;
     for (index = 0;
-	 (code = bfont->procs.enumerate_glyph((gs_font *)bfont, &index, 
+	 (bfont->procs.enumerate_glyph((gs_font *)bfont, &index, 
 		(is_cid ? GLYPH_SPACE_INDEX : GLYPH_SPACE_NAME), &glyph)) >= 0 &&
 	     index != 0;
 	 ) {

Modified: branches/chrisl-test-gs/base/gdevpdte.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdte.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdte.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -563,6 +563,18 @@
 	gs_text_params_t text = penum->text;
 	int xy_index_step = (!(penum->text.operation & TEXT_REPLACE_WIDTHS) ? 0 :
 			     penum->text.x_widths == penum->text.y_widths ? 2 : 1);
+	/* A glyphshow takes a shortcut by storing the single glyph directly into
+	 * penum->text.data.d_glyph. However, process_text_modify_width
+	 * replaces pte->text.data.bytes (these two are part of a union) with
+	 * pstr->data, which is not valid for a glyphshow because it alters
+	 * the glyph value store there. If we make a copy of the single glyph, 
+	 * it all works correctly.then 
+	 */
+	gs_glyph gdata_i, *gdata_p = (gs_glyph *)gdata;
+	if (penum->text.operation & TEXT_FROM_SINGLE_GLYPH) {
+	    gdata_i = *gdata;
+	    gdata_p = &gdata_i;
+	}
 	
 	if (penum->text.operation & TEXT_REPLACE_WIDTHS) {
 	    if (penum->text.x_widths != NULL)
@@ -573,7 +585,7 @@
 	penum->xy_index = 0;
 	code = process_text_modify_width(penum, (gs_font *)font, ppts,
 					 (gs_const_string *)pstr,
-					 &width_pt, gdata, false);
+					 &width_pt, (const gs_glyph *)gdata_p, false);
 	if (penum->text.operation & TEXT_REPLACE_WIDTHS) {
 	    if (penum->text.x_widths != NULL)
 		penum->text.x_widths -= xy_index * xy_index_step;
@@ -1005,7 +1017,7 @@
 	    }
 	}
 	pdf_char_widths_to_uts(pdfont3, &cw); /* convert design->text space */
-	if (pte->text.operation & TEXT_DO_DRAW) {
+	if (pte->text.operation & (TEXT_DO_DRAW | TEXT_RENDER_MODE_3)) {
 	    gs_distance_transform(cw.Width.xy.x * ppts->values.size,
 				  cw.Width.xy.y * ppts->values.size,
 				  &ppts->values.matrix, &did);

Modified: branches/chrisl-test-gs/base/gdevpdtf.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdtf.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdtf.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -30,6 +30,7 @@
 #include "gdevpdtf.h"
 #include "gdevpdtw.h"
 #include "gdevpdti.h"
+#include "whitelst.h"		/* Checks whether protected fonta cna be embedded */
 
 /* GC descriptors */
 public_st_pdf_font_resource();
@@ -208,7 +209,6 @@
 	return -1;
     }
 
-    mask |= FONT_SAME_OUTLINES;
     for (i = 0; i < PDF_NUM_STANDARD_FONTS; ++psf, ++i) {
 	gs_font_base *cfont;
 	int code;
@@ -635,11 +635,11 @@
     const int sl = strlen(gx_extendeg_glyph_name_separator);
 
     psf_enumerate_glyphs_begin(&genum, (gs_font *)pfont, NULL, 0, GLYPH_SPACE_NAME);
-    for (glyph = gs_no_glyph; (code = psf_enumerate_glyphs_next(&genum, &glyph)) != 1; ) {
+    for (glyph = gs_no_glyph; (psf_enumerate_glyphs_next(&genum, &glyph)) != 1; ) {
 	code = pfont->procs.glyph_name(pfont, glyph, &str);
 	if (code < 0)
 	    return code;
-	l = str.size - sl, j;
+	l = str.size - sl;
 	for (j = 0; j < l; j ++)
 	    if (!memcmp(gx_extendeg_glyph_name_separator, str.data + j, sl))
 		return true;
@@ -664,7 +664,8 @@
     memset(&info, 0x00, sizeof(gs_font_info_t));
     code = font->procs.font_info(font, NULL, FONT_INFO_EMBEDDING_RIGHTS, &info);
     if (code == 0 && (info.members & FONT_INFO_EMBEDDING_RIGHTS)) {
-	if ((info.EmbeddingRights == 0x0002) || (info.EmbeddingRights & 0x0200)) {
+	if (((info.EmbeddingRights == 0x0002) || (info.EmbeddingRights & 0x0200))
+	    && !IsInWhiteList ((const char *)chars, size)) {
 	    /* See the OpenType specification, "The 'OS/2' and Windows Metrics Table" for details
 	       of the fstype parameter. This is a bitfield, currently we forbid embedding of fonts
 	       with these bits set:
@@ -893,6 +894,8 @@
 					   pdf_font_descriptor_FontType(pfd),
 					   pdf_write_contents_simple);
 
+    if (code < 0)
+	return(gs_note_error(code));
     pdfont->FontDescriptor = pfd;
     set_is_MM_instance(pdfont, pdf_font_descriptor_font(pfd, false));
     *ppfres = pdfont;

Modified: branches/chrisl-test-gs/base/gdevpdtf.h
===================================================================
--- branches/chrisl-test-gs/base/gdevpdtf.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdtf.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -184,7 +184,7 @@
     GC_OBJ_ELT(pdf_base_font_t, CIDSet),\
     GC_OBJ_ELT(pdf_base_font_t, FontFile),\
     GC_STRING_ELT(pdf_base_font_t, font_name)\
-};\
+}
 
 
 typedef struct {

Modified: branches/chrisl-test-gs/base/gdevpdti.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdti.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdti.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -194,7 +194,6 @@
     code = pdf_finish_write_contents_type3(pdev, pdfont);
     if (code < 0)
 	return code;
-    s = pdev->strm; /* pdf_finish_write_contents_type3 changes pdev->strm . */
     if (!pdfont->u.simple.s.type3.bitmap_font && diff_id > 0) {
 	code = pdf_write_encoding(pdev, pdfont, diff_id, 0);
 	if (code < 0)
@@ -504,6 +503,15 @@
 	    (float)pw[3], (float)pw[4], (float)pw[5]);
 	pdfont->u.simple.s.type3.cached[ch >> 3] |= 0x80 >> (ch & 7);
     }
+    /* See comments in pdf_text_process regarding type 3 CharProc accumulation
+     * Initially this matrix was emitted there, at the start of the accumulator
+     * but if we do that then GS incorrectly applied the matrix to the 'd1'
+     * operator. We write the scale matrix here because this is *after* the 
+     * 'd1' has been emitted above, and so does not affect it.
+     */
+    code = stream_puts(pdev->strm, "0.01 0 0 0.01 0 0 cm\n");
+    if (code < 0)
+        return code;
     return 0;
 }
 

Modified: branches/chrisl-test-gs/base/gdevpdtt.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpdtt.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpdtt.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -96,6 +96,7 @@
 {
     pdf_text_enum_t *const penum = (pdf_text_enum_t *)pte;
     gx_device_pdf *pdev = (gx_device_pdf *)pte->dev;
+    gs_matrix m;
 
     if (pdev->type3charpath)
 	return gs_text_set_cache(penum->pte_default, pw, control);
@@ -103,7 +104,12 @@
     switch (control) {
     case TEXT_SET_CHAR_WIDTH:
     case TEXT_SET_CACHE_DEVICE:
-	gs_distance_transform(pw[0], pw[1], &ctm_only(pte->pis), &pdev->char_width);
+	/* See comments in pdf_text_process. We are using a 100x100 matrix
+	 * NOT the identity, but we want the cache device values to be in
+	 * font co-ordinate space, so we need to undo that scale here.
+	 */
+	gs_matrix_scale(&ctm_only(pte->pis), .01, .01, &m);
+	gs_distance_transform(pw[0], pw[1], &m, &pdev->char_width);
 	break;
     case TEXT_SET_CACHE_DEVICE2:
 	/*
@@ -112,7 +118,12 @@
 	 * width for Widths array. Therefore we don't check 
 	 * gs_rootfont(pgs)->WMode and don't use pw[6:7].
 	 */
-	gs_distance_transform(pw[0], pw[1], &ctm_only(pte->pis), &pdev->char_width);
+	/* See comments in pdf_text_process. We are using a 100x100 matrix
+	 * NOT the identity, but we want the cache device values to be in
+	 * font co-ordinate space, so we need to undo that scale here.
+	 */
+	gs_matrix_scale(&ctm_only(pte->pis), .01, .01, &m);
+	gs_distance_transform(pw[0], pw[1], &m, &pdev->char_width);
 	if (penum->cdevproc_callout) {
 	    memcpy(penum->cdevproc_result, pw, sizeof(penum->cdevproc_result));
 	    return 0;
@@ -178,6 +189,23 @@
 	    code = gx_clip_to_rectangle(penum_s->pgs, &clip_box);
 	    if (code < 0)
 		return code;
+
+	    /* See comments in pdf_text_process. We are using a 100x100 matrix
+	     * NOT the identity, but we want the cache device values to be in
+	     * font co-ordinate space, so we need to undo that scale here. We
+	     * can't do it above, where we take any scaling from the BuildChar
+	     * into account, because that would get the clip path wrong, that
+	     * needs to be in the 100x100 space so that it doesn't clip
+	     * out marking operations.
+	     */
+	    gs_matrix_scale(&ctm_only(penum_s->pgs), .01, .01, &m);
+	    for (i = 0; i < narg; i += 2) {
+		gs_point p;
+
+		gs_point_transform(pw[i], pw[i + 1], &m, &p);
+		pw1[i] = p.x;
+		pw1[i + 1] = p.y;
+	    }
 	    code = pdf_set_charproc_attrs(pdev, pte->current_font, 
 			pw1, narg, control, penum->output_char_code);
 	    if (code < 0)
@@ -209,6 +237,17 @@
 	       to go with the default implementation.
 	       Need to restore the correct CTM and add
 	       changes, which the charproc possibly did. */
+	    /* See comments in pdf_text_process. We are using a 100x100 matrix
+	     * NOT the identity,  so we need to undo that scale here.
+	     */
+	    gs_matrix_scale(&ctm_only(penum->pis), .01, .01, (gs_matrix *)&ctm_only(penum->pis));
+	    /* We also scaled the page height and width. Because we
+	     * don't go through the accumulator 'close' in pdf_text_process 
+	     * we must also undo that scale.
+	     */
+	    pdev->width /= 100;
+	    pdev->height /= 100;
+
 	    gs_matrix_multiply((gs_matrix *)&pdev->charproc_ctm, (gs_matrix *)&penum->pis->ctm, &m);
 	    gs_matrix_fixed_from_matrix(&penum->pis->ctm, &m);
 	    penum->charproc_accum = false;
@@ -583,6 +622,7 @@
     e->num_chars = num_chars;
     e->num_widths = num_widths;
     memset(e->glyph_usage, 0, len);
+    if (e->real_widths != NULL)
     memset(e->real_widths, 0, num_widths * sizeof(*e->real_widths));
     return 0;
 }
@@ -1123,6 +1163,11 @@
     if (pdfont->u.simple.s.type3.Resources == NULL)
 	return_error(gs_error_VMerror);
     /* Adobe viewers have a precision problem with small font matrices : */
+    /* Don't perform this test if all entries are 0, leads to infinite loop! */
+    if (pdfont->u.simple.s.type3.FontMatrix.xx != 0.0 ||
+	pdfont->u.simple.s.type3.FontMatrix.xy != 0.0 ||
+	pdfont->u.simple.s.type3.FontMatrix.yx != 0.0 ||
+	pdfont->u.simple.s.type3.FontMatrix.yy != 0.0) {
     while (any_abs(pdfont->u.simple.s.type3.FontMatrix.xx) < 0.001 &&
 	   any_abs(pdfont->u.simple.s.type3.FontMatrix.xy) < 0.001 &&
 	   any_abs(pdfont->u.simple.s.type3.FontMatrix.yx) < 0.001 &&
@@ -1132,6 +1177,7 @@
 	pdfont->u.simple.s.type3.FontMatrix.yx *= 10;
 	pdfont->u.simple.s.type3.FontMatrix.yy *= 10;
     }
+    }
     *ppdfont = pdfont;
     return 0;
 }
@@ -1253,8 +1299,14 @@
 	    }
 	}
     }
-    if (font->FontType == ft_encrypted || font->FontType == ft_encrypted2 || 
-	font->FontType == ft_TrueType) {
+    if (font->FontType == ft_encrypted || font->FontType == ft_encrypted2) {
+	/*|| font->FontType == ft_TrueType) */
+	/* Removed the addition of Encodings to TrueType fonts as we always write
+	 * these with the Symbolic flag set. The comment below explains why we
+	 * previously wrote these, but as the comment notes this was incorrect.
+	 * Removed as it is causing preflight problems, and is specifically
+	 * disallowed with PDF/A output.
+	 */
         /*
 	 * We write True Types with Symbolic flag set.
 	 * PDF spec says that "symbolic font should not specify Encoding entry"
@@ -1277,7 +1329,6 @@
 	(code = font_alloc(pdev, &pdfont, base_font->id, pfd)) < 0
 	)
 	return code;
-    code = 1;
 
     if (!pdf_is_CID_font(font)) {
 	pdfont->u.simple.BaseEncoding = BaseEncoding;
@@ -1305,6 +1356,8 @@
 	    widths.Width.w = 0;
 	    code = pdf_glyph_widths(pdfont, font->WMode, notdef_glyph,
 		 font, &widths, cdevproc_result);
+	    if (code < 0)
+		return code;
 	    w[0] = widths.Width.w;
 	    pdfont->used[0] |= 0x80;
 	}
@@ -1622,11 +1675,24 @@
 	    pdfont->u.simple.last_reserved_char = last_reserved_char;
 	/* Change glyphs to char codes in the text : */
 	for (i = 0; i < pstr->size; i++) {
-	    /* Picked up by Coverity, if pdfont is NULL then the call would dereference it */
+	    /* Picked up by Coverity, if pdfont is NULL then the call might dereference it */
 	    if (pdfont != NULL) {
 		/* A trick : pdf_reserve_char_code_in_pdfont here simply encodes with cgp. */
 		ch = pdf_reserve_char_code_in_pdfont(pdfont, cgp, gdata[i], &pdfont->u.simple.last_reserved_char);
 		pstr->data[i] = ch;
+	    } else {
+		/* So if pdffont is NULL, do the 'trick' code mentioned above.
+		 * If that fails (I believe it shouod not), then return an error.
+		 */
+		int j;
+
+		for (j = 0; j < cgp->num_all_chars; j++)
+		    if (cgp->s[j].glyph == gdata[i])
+			break;
+		if (j < cgp->num_all_chars)
+		    pstr->data[i] = cgp->s[j].chr;
+		else
+		    return_error(gs_error_unregistered);
 	    }
 	}
 	return 0;
@@ -1719,13 +1785,13 @@
 	code = pdf_attached_font_resource(pdev, base_font, ppdfont, NULL, NULL, NULL, NULL);
 	if (code < 0)
 	    return code;
-	if (*ppdfont != NULL && base_font != font) {
+	if (base_font != font) {
 	    if (pdfont_not_allowed == *ppdfont)
 		*ppdfont = NULL;	
-	    else if(!pdf_is_compatible_encoding(pdev, *ppdfont, 
+	}
+	if(*ppdfont != NULL && !pdf_is_compatible_encoding(pdev, *ppdfont, 
 				    base_font, cgp->s, cgp->num_all_chars))
 		*ppdfont = NULL;
-	}
 	if (*ppdfont == NULL || *ppdfont == pdfont_not_allowed) {
 	    pdf_resource_type_t type = 
 		(pdf_is_CID_font(base_font) ? resourceCIDFont 
@@ -2129,10 +2195,14 @@
 
 	/* Sort out any pending glyphs */
 	code = pdf_set_PaintType0_params(pdev, pis, size, scaled_width, &ppts->values);
+	if (code < 0)
+	    return code;
 
 	pis->line_params.half_width = scaled_width / 2;
 	code = pdf_set_text_process_state(pdev, (const gs_text_enum_t *)penum,
 				      ppts);
+	if (code < 0)
+	    return code;
 
 	pis->line_params.half_width = saved_width;
     } else {
@@ -2164,6 +2234,9 @@
 	int code;
 
 	code = pdf_open_contents(pdev, PDF_IN_STRING);
+	if (code < 0)
+	    return code;
+
 	code = pdf_prepare_stroke(pdev, pis);
 	if (code >= 0) 
 	    code = gdev_vector_prepare_stroke((gx_device_vector *)pdev,
@@ -2428,7 +2501,7 @@
 	p = (byte *)gs_alloc_string(pdev->pdf_memory, gnstr->size, "pdf_text_set_cache");
 	if (p == NULL)
 	    return_error(gs_error_VMerror);
-	sprintf(buf, "g%04x", glyph & 0xFFFF);
+	sprintf(buf, "g%04x", (unsigned int)(glyph & 0xFFFF));
 	memcpy(p, buf, 5);
 	gnstr->data = p;
     } else {
@@ -2544,6 +2617,11 @@
 	        stream_puts(pdev->strm, "0 0 0 0 0 0 d1\n");
 	    }
 	    
+	    /* See below, we scaled the device height and width to prevent 
+	     * clipping of the CharProc operations, now we need to undo that.
+	     */
+	    pdev->width /= 100;
+	    pdev->height /= 100;
 	    code = pdf_end_charproc_accum(pdev, penum->current_font, penum->cgp, 
 			pte_default->returned.current_glyph, penum->output_char_code, &gnstr);
 	    if (code < 0)
@@ -2575,6 +2653,20 @@
 		code = pdf_start_charproc_accum(pdev);
 		if (code < 0)
 		    return code;
+
+		/* We need to give FreeType some room for accuracy when 
+		 * retrieving the outline. We will use a scale factor of 100
+		 * (see below). Because this appears to the regular path
+		 * handling code as if it were at the page level, the co-ords
+		 * would be clipped frequently, so we temporarily hack the
+		 * width and height of the device here to ensure it doesn't.
+		 * Note that this requires some careful manipulation of the 
+		 * CTM in various places, which want numbers in the font
+		 * co-ordinate space, not the scaled user space.
+		 */
+		pdev->width *= 100;
+		pdev->height *= 100;
+
 		pdf_viewer_state_from_imager_state(pdev, pte->pis, pte->pdcolor);
 		/* Set line params to unallowed values so that
 		   they'll synchronize with writing them out on the first use. 
@@ -2594,7 +2686,16 @@
 		   executed gsave, so we are safe to change CTM now.
 		   Note that BuildChar may change CTM before calling setcachedevice. */
 		gs_make_identity(&m);
+		/* See comment above, we actually want to use a scale factor
+		 * of 100 in order to give FreeType some room in the fixed
+		 * precision calculations when retrieing the outline. So in
+		 * fact we don't use the identity CTM, but a 100x100 matrix
+		 * Originally tried 1000, but that was too likely to cause
+		 * clipping or arithmetic overflow.
+		 */
+		gs_matrix_scale(&m, 100, 100, &m);
 		gs_matrix_fixed_from_matrix(&penum->pis->ctm, &m);
+
 		/* Choose a character code to use with the charproc. */
 		code = pdf_choose_output_char_code(pdev, penum, &penum->output_char_code);
 		if (code < 0)

Modified: branches/chrisl-test-gs/base/gdevprn.c
===================================================================
--- branches/chrisl-test-gs/base/gdevprn.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevprn.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -417,6 +417,7 @@
 	COPY_PROC(decode_color);
 	COPY_PROC(update_spot_equivalent_colors);
 	COPY_PROC(ret_devn_params);
+        COPY_PROC(put_image);
 #undef COPY_PROC
 	/* If using a command list, already opened the device. */
 	if (is_command_list)
@@ -1039,9 +1040,12 @@
 	assign_dev_procs(mdev, mdproto);
         check_device_separable((gx_device *)mdev);
 	gx_device_fill_in_procs((gx_device *)mdev);
-    } else
+    } else {
 	gs_make_mem_device(mdev, mdproto, mem, (band_complexity == NULL ? 1 : 0),
 			   (target == (gx_device *)mdev ? NULL : target));
+        mdev->device_icc_profile = target->device_icc_profile;
+        rc_increment(mdev->device_icc_profile);
+    }
     mdev->width = target->width;
     mdev->band_y = y;
     /*
@@ -1155,6 +1159,7 @@
 	mdev = ((gx_device_plane_extract *)bdev)->plane_dev;
 	gs_free_object(bdev->memory, bdev, "destroy_buf_device");
     }
+    /* gs_free_object will do finalize which will decrement icc profile */
     dev_proc(mdev, close_device)(mdev);
     gs_free_object(mdev->memory, mdev, "destroy_buf_device");
 }

Modified: branches/chrisl-test-gs/base/gdevpsdi.c
===================================================================
--- branches/chrisl-test-gs/base/gdevpsdi.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevpsdi.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -29,6 +29,7 @@
 #include "slzwx.h"
 #include "spngpx.h"
 #include "szlibx.h"
+#include "gsicc_manage.h"
 #ifdef USE_LDF_JB2
 #include "sjbig2_luratech.h"
 #endif
@@ -131,7 +132,8 @@
     gx_device_retain((gx_device *)&mdev, true);	/* prevent freeing */
     set_linear_color_bits_mask_shift((gx_device *)&mdev);
     mdev.color_info.separable_and_linear = GX_CINFO_SEP_LIN;
-
+    /* Set mem device icc profile */
+    gsicc_init_device_profile((const gs_state *) pis, (gx_device *) &mdev);
     if (pis) {
 	/* Check for an RGB-like color space.  
 	   To recognize that we make a matrix as it were a linear operator,
@@ -215,7 +217,6 @@
     gx_device_psdf *pdev = pbw->dev;
     gs_memory_t *mem = pdev->v_memory;
     const stream_template *template = pdip->filter_template;
-    const stream_template *orig_template = template;
     const stream_template *lossless_template =
 	(pdev->params.UseFlateCompression &&
 	 pdev->version >= psdf_version_ll3 ?
@@ -246,16 +247,16 @@
 	 * called 2 times with different values of the 'lossless' argument.
 	 */
         if (lossless) {
-            orig_template = template = lossless_template;
+            template = lossless_template;
         } else if (template == NULL || template == &s_zlibE_template || 
 		   template == &s_LZWE_template) {
-            orig_template = template = &s_DCTE_template;
+            template = &s_DCTE_template;
         }
 	dict = pdip->ACSDict;
     } else if (!lossless)
 	return gs_error_rangecheck; /* Reject the alternative stream. */   
     if (pdev->version < psdf_version_ll3 && template == &s_zlibE_template)
-	orig_template = template = lossless_template;
+	template = lossless_template;
     if (dict != NULL) /* Some interpreters don't supply filter parameters. */
 	gs_c_param_list_read(dict);	/* ensure param list is in read mode */
     if (template == 0)	/* no compression */
@@ -452,9 +453,11 @@
 		const gs_imager_state * pis, const gs_pixel_image_t * pim)
 {
     return pdev->params.ConvertCMYKImagesToRGB &&
-	    pis != 0 &&
-	    gs_color_space_get_index(pim->ColorSpace) ==
-	    gs_color_space_index_DeviceCMYK;
+	    pis != 0 && pim->ColorSpace && 
+	    (gs_color_space_get_index(pim->ColorSpace) == gs_color_space_index_DeviceCMYK ||
+	    (gs_color_space_get_index(pim->ColorSpace) == gs_color_space_index_ICC
+	    && gsicc_get_default_type(pim->ColorSpace->cmm_icc_profile_data) ==
+	    gs_color_space_index_DeviceCMYK));
 }
 
 static inline void 

Modified: branches/chrisl-test-gs/base/gdevrinkj.c
===================================================================
--- branches/chrisl-test-gs/base/gdevrinkj.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevrinkj.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -287,7 +287,7 @@
     color_cmyk_to_rgb(c, m, y, k, NULL, out, dev->memory);
     for(; i>0; i--)			/* Clear spot colors */
         out[2 + i] = 0;
-};
+}
 
 static void
 gray_cs_to_spotcmyk_cm(gx_device * dev, frac gray, frac out[])

Modified: branches/chrisl-test-gs/base/gdevtfax.c
===================================================================
--- branches/chrisl-test-gs/base/gdevtfax.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevtfax.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -359,7 +359,7 @@
     }
 
     tfdev->width = width;
-    code = tiff_set_fields_for_printer(pdev, tfdev->tif);
+    code = tiff_set_fields_for_printer(pdev, tfdev->tif, 1);
     tfdev->width = save_width;
     return code;
 }

Modified: branches/chrisl-test-gs/base/gdevtfnx.c
===================================================================
--- branches/chrisl-test-gs/base/gdevtfnx.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevtfnx.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -49,7 +49,8 @@
 			24, tiff12_print_page),
     arch_is_big_endian          /* default to native endian (i.e. use big endian iff the platform is so*/,
     COMPRESSION_NONE,
-    TIFF_DEFAULT_STRIP_SIZE
+    TIFF_DEFAULT_STRIP_SIZE,
+    TIFF_DEFAULT_DOWNSCALE
 };
 
 const gx_device_tiff gs_tiff24nc_device = {
@@ -60,7 +61,8 @@
 			24, tiff_rgb_print_page),
     arch_is_big_endian          /* default to native endian (i.e. use big endian iff the platform is so*/,
     COMPRESSION_NONE,
-    TIFF_DEFAULT_STRIP_SIZE
+    TIFF_DEFAULT_STRIP_SIZE,
+    TIFF_DEFAULT_DOWNSCALE
 };
 
 const gx_device_tiff gs_tiff48nc_device = {
@@ -71,7 +73,8 @@
 			48, tiff_rgb_print_page),
     arch_is_big_endian          /* default to native endian (i.e. use big endian iff the platform is so*/,
     COMPRESSION_NONE,
-    TIFF_DEFAULT_STRIP_SIZE
+    TIFF_DEFAULT_STRIP_SIZE,
+    TIFF_DEFAULT_DOWNSCALE
 };
 
 /* ------ Private functions ------ */

Modified: branches/chrisl-test-gs/base/gdevtifs.c
===================================================================
--- branches/chrisl-test-gs/base/gdevtifs.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevtifs.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -102,8 +102,8 @@
     return gdev_prn_close(pdev);
 }
 
-int
-tiff_get_params(gx_device * dev, gs_param_list * plist)
+static int
+tiff_get_some_params(gx_device * dev, gs_param_list * plist, int which)
 {
     gx_device_tiff *const tfdev = (gx_device_tiff *)dev;
     int code = gdev_prn_get_params(dev, plist);
@@ -115,14 +115,31 @@
     if ((code = tiff_compression_param_string(&comprstr, tfdev->Compression)) < 0 ||
 	(code = param_write_string(plist, "Compression", &comprstr)) < 0)
 	ecode = code;
+    if (which & 1)
+    {
+      if ((code = param_write_long(plist, "DownScaleFactor", &tfdev->DownScaleFactor)) < 0)
+          ecode = code;
+    }
     if ((code = param_write_long(plist, "MaxStripSize", &tfdev->MaxStripSize)) < 0)
         ecode = code;
     return ecode;
 }
 
 int
-tiff_put_params(gx_device * dev, gs_param_list * plist)
+tiff_get_params(gx_device * dev, gs_param_list * plist)
 {
+    return tiff_get_some_params(dev, plist, 0);
+}
+
+int
+tiff_get_params_downscale(gx_device * dev, gs_param_list * plist)
+{
+    return tiff_get_some_params(dev, plist, 1);
+}
+
+static int
+tiff_put_some_params(gx_device * dev, gs_param_list * plist, int which)
+{
     gx_device_tiff *const tfdev = (gx_device_tiff *)dev;
     int ecode = 0;
     int code;
@@ -130,6 +147,7 @@
     bool big_endian = tfdev->BigEndian;
     uint16 compr = tfdev->Compression;
     gs_param_string comprstr;
+    long downscale = tfdev->DownScaleFactor;
     long mss = tfdev->MaxStripSize;
 
     /* Read BigEndian option as bool */
@@ -154,7 +172,22 @@
 	    ecode = code;
 	    param_signal_error(plist, param_name, ecode);
     }
-
+    /* Read Downscale factor */
+    if (which & 1) {
+        switch (code = param_read_long(plist,
+                                       (param_name = "DownScaleFactor"),
+                                       &downscale)) {
+            case 0:
+                if (downscale <= 0)
+                    downscale = 1;
+                break;
+            case 1:
+                break;
+            default:
+                ecode = code;
+                param_signal_error(plist, param_name, ecode);
+        }
+    }
     switch (code = param_read_long(plist, (param_name = "MaxStripSize"), &mss)) {
         case 0:
 	    /*
@@ -181,9 +214,22 @@
     tfdev->BigEndian = big_endian;
     tfdev->Compression = compr;
     tfdev->MaxStripSize = mss;
+    tfdev->DownScaleFactor = downscale;
     return code;
 }
 
+int
+tiff_put_params(gx_device * dev, gs_param_list * plist)
+{
+    return tiff_put_some_params(dev, plist, 0);
+}
+
+int
+tiff_put_params_downscale(gx_device * dev, gs_param_list * plist)
+{
+    return tiff_put_some_params(dev, plist, 1);
+}
+
 TIFF *
 tiff_from_filep(const char *name, FILE *filep, int big_endian)
 {
@@ -213,7 +259,7 @@
 	    return_error(gs_error_invalidfileaccess);
     }
 
-    return tiff_set_fields_for_printer(pdev, tfdev->tif);
+    return tiff_set_fields_for_printer(pdev, tfdev->tif, tfdev->DownScaleFactor);
 }
 
 int tiff_set_compression(gx_device_printer *pdev,
@@ -237,16 +283,18 @@
     return 0;
 }
 
-int tiff_set_fields_for_printer(gx_device_printer *pdev, TIFF *tif)
+int tiff_set_fields_for_printer(gx_device_printer *pdev,
+                                TIFF              *tif,
+                                int                factor)
 {
-    TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, pdev->width);
-    TIFFSetField(tif, TIFFTAG_IMAGELENGTH, pdev->height);
+    TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, (pdev->width + factor-1)/factor);
+    TIFFSetField(tif, TIFFTAG_IMAGELENGTH, (pdev->height + factor-1)/factor);
     TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
     TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
 
     TIFFSetField(tif, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH);
-    TIFFSetField(tif, TIFFTAG_XRESOLUTION, (float)pdev->x_pixels_per_inch);
-    TIFFSetField(tif, TIFFTAG_YRESOLUTION, (float)pdev->y_pixels_per_inch);
+    TIFFSetField(tif, TIFFTAG_XRESOLUTION, (float)pdev->x_pixels_per_inch/factor);
+    TIFFSetField(tif, TIFFTAG_YRESOLUTION, (float)pdev->y_pixels_per_inch/factor);
 
     {
 	char revs[10];
@@ -284,7 +332,7 @@
 int
 tiff_print_page(gx_device_printer *dev, TIFF *tif)
 {
-    int code;
+    int code = 0;
     byte *data;
     int size = gdev_mem_bytes_per_scan_line((gx_device *)dev);
     int max_size = max(size, TIFFScanlineSize(tif));
@@ -318,7 +366,188 @@
     return code;
 }
 
+/* Error diffusion data is stored in errors block.
+ * We have 1 empty entry at each end to avoid overflow. When
+ * moving left to right we read from entries 2->width+1 (inclusive), and
+ * write to 1->width. When moving right to left we read from width->1 and
+ * write to width+1->2.
+ */
+static void down_and_out(TIFF *tif,
+                         byte *data,
+                         int   max_size,
+                         int   factor,
+                         int   row,
+                         int   width,
+                         int  *errors)
+{
+    int x, xx, y, value;
+    byte *outp;
+    byte *inp = data;
+    int mask;
+    int e_downleft, e_down, e_forward = 0;
+    const int threshold = factor*factor*128;
+    const int max_value = factor*factor*255;
 
+    if ((row & 1) == 0)
+    {
+        /* Left to Right pass */
+        const int back = max_size * factor -1;
+        errors += 2;
+        outp = inp;
+        for (x = width; x > 0; x--)
+        {
+            value = e_forward + *errors;
+            for (xx = factor; xx > 0; xx--)
+            {
+                for (y = factor; y > 0; y--)
+                {
+                    value += *inp;
+                    inp += max_size;
+                }
+                inp -= back;
+            }
+            if (value >= threshold)
+            {
+                *outp++ = 1;
+                value -= max_value;
+            }
+            else
+            {
+                *outp++ = 0;
+            }
+            e_forward  = value * 7/16;
+            e_downleft = value * 3/16;
+            e_down     = value * 5/16;
+            value     -= e_forward + e_downleft + e_down;
+            errors[-2] += e_downleft;
+            errors[-1] += e_down;
+            *errors++   = value;
+        }
+        outp -= width;
+    }
+    else
+    {
+        /* Right to Left pass */
+        const int back = max_size * factor + 1;
+        errors += width;
+        inp += width*factor-1;
+        outp = inp;
+        for (x = width; x > 0; x--)
+        {
+            value = e_forward + *errors;
+            for (xx = factor; xx > 0; xx--)
+            {
+                for (y = factor; y > 0; y--)
+                {
+                    value += *inp;
+                    inp += max_size;
+                }
+                inp -= back;
+            }
+            if (value >= threshold)
+            {
+                *outp-- = 1;
+                value -= max_value;
+            }
+            else
+            {
+                *outp-- = 0;
+            }
+            e_forward  = value * 7/16;
+            e_downleft = value * 3/16;
+            e_down     = value * 5/16;
+            value     -= e_forward + e_downleft + e_down;
+            errors[2] += e_downleft;
+            errors[1] += e_down;
+            *errors--   = value;
+        }
+        outp++;
+    }
+    /* Now pack the data pointed to by outp into byte form */
+    data = inp = outp;
+    outp--;
+    mask = 0;
+    for (x = width; x > 0; x--)
+    {
+        value = *inp++;
+        if (mask == 0)
+        {
+            mask = 128;
+            *++outp = 0;
+        }
+        if (value)
+            *outp |= mask;
+        mask >>= 1;
+    }
+
+    TIFFWriteScanline(tif, data, row, 0);
+}
+
+/* Special version, called with 8 bit grey input to be downsampled to 1bpp
+ * output. */
+int
+tiff_downscale_and_print_page(gx_device_printer *dev, TIFF *tif, int factor)
+{
+    int code = 0;
+    byte *data;
+    int *errors;
+    int size = gdev_mem_bytes_per_scan_line((gx_device *)dev);
+    int max_size = max(size, TIFFScanlineSize(tif)) + factor-1;
+    int row;
+    int n;
+    int width = (dev->width + factor-1)/factor;
+
+    data = gs_alloc_bytes(dev->memory,
+                          max_size * factor,
+                          "tiff_print_page(data)");
+    if (data == NULL)
+        return_error(gs_error_VMerror);
+
+    errors = (int *)gs_alloc_bytes(dev->memory,
+                                   (width+3) * sizeof(int),
+                                   "tiff_print_page(errors)");
+    if (errors == NULL)
+    {
+        gs_free_object(dev->memory, data, "tiff_print_page(data)");
+        return_error(gs_error_VMerror);
+    }
+
+    TIFFCheckpointDirectory(tif);
+
+    memset(data, 0, max_size * factor);
+    memset(errors, 0, (width+3) * sizeof(int));
+    n = 0;
+    for (row = 0; row < dev->height; row++) {
+        code = gdev_prn_copy_scan_lines(dev, row, data + max_size*n, size);
+        if (code < 0)
+            break;
+        n++;
+        if (n == factor)
+        {
+            /* Do the downsample */
+            n = 0;
+            down_and_out(tif, data, max_size, factor, row/factor, width, errors);
+        }
+    }
+    if (n != 0)
+    {
+        while (n != factor)
+        {
+            memset(data + max_size * n, 0, max_size);
+            n++;
+            row++;
+        }
+        down_and_out(tif, data, max_size, factor, row/factor, width, errors);
+    }
+
+    gs_free_object(dev->memory, errors, "tiff_print_page(errors)");
+    gs_free_object(dev->memory, data, "tiff_print_page(data)");
+
+    TIFFWriteDirectory(tif);
+    return code;
+}
+
+
 static struct compression_string {
     uint16 id;
     const char *str;

Modified: branches/chrisl-test-gs/base/gdevtifs.h
===================================================================
--- branches/chrisl-test-gs/base/gdevtifs.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevtifs.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -30,6 +30,7 @@
     bool  BigEndian;            /* true = big endian; false = little endian*/
     uint16 Compression;		/* same values as TIFFTAG_COMPRESSION */
     long MaxStripSize;
+    long DownScaleFactor;
     TIFF *tif;			/* TIFF file opened on gx_device_common.file */
 } gx_device_tiff;
 
@@ -37,7 +38,9 @@
 dev_proc_open_device(tiff_open);
 dev_proc_close_device(tiff_close);
 dev_proc_get_params(tiff_get_params);
+dev_proc_get_params(tiff_get_params_downscale);
 dev_proc_put_params(tiff_put_params);
+dev_proc_put_params(tiff_put_params_downscale);
 
 /*
  * Open a TIFF file for writing from a file descriptor.
@@ -46,18 +49,22 @@
 
 int tiff_print_page(gx_device_printer *dev, TIFF *tif);
 
+int tiff_downscale_and_print_page(gx_device_printer *dev, TIFF *tif, int factor);
+
 /*
  * Sets the compression tag for TIFF and updates the rows_per_strip tag to
  * reflect max_strip_size under the new compression scheme.
  */
 #define TIFF_DEFAULT_STRIP_SIZE 1048576
 
+#define TIFF_DEFAULT_DOWNSCALE 1
+
 int tiff_set_compression(gx_device_printer *pdev,
 			 TIFF *tif,
 			 uint compression,
 			 long max_strip_size);
 
-int tiff_set_fields_for_printer(gx_device_printer *pdev, TIFF *tif);
+int tiff_set_fields_for_printer(gx_device_printer *pdev, TIFF *tif, int factor);
 
 int gdev_tiff_begin_page(gx_device_tiff *tfdev, FILE *file);
 

Modified: branches/chrisl-test-gs/base/gdevtsep.c
===================================================================
--- branches/chrisl-test-gs/base/gdevtsep.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevtsep.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -12,11 +12,14 @@
 */
 
 /* $Id$ */
-/* tiffgray device:  8-bit Gray uncompressed TIFF device */
-/* tiff32nc device:  32-bit CMYK uncompressed TIFF device */
-/* tiffsep device: Generate individual TIFF gray files for each separation */
-/*                 as well as a 'composite' 32-bit CMYK for the page.      */
-/* tiffsep1 device: Generate individual TIFF 1-bit files for each separation. */
+/* tiffgray device:  8-bit Gray uncompressed TIFF device
+ * tiff32nc device:  32-bit CMYK uncompressed TIFF device
+ * tiffsep device:   Generate individual TIFF gray files for each separation
+ *                   as well as a 'composite' 32-bit CMYK for the page.
+ * tiffsep1 device:  Generate individual TIFF 1-bit files for each separation
+ * tiffscaled device:Mono TIFF device (dithered downscaled output from
+ *                   8-bit Gray internal rendering)
+ */
 
 #include "stdint_.h"   /* for tiff.h */
 #include "gdevtifs.h"
@@ -58,10 +61,41 @@
 		    1, 8, 255, 0, 256, 0, tiffgray_print_page),
     arch_is_big_endian          /* default to native endian (i.e. use big endian iff the platform is so*/,
     COMPRESSION_NONE,
-    TIFF_DEFAULT_STRIP_SIZE
+    TIFF_DEFAULT_STRIP_SIZE,
+    TIFF_DEFAULT_DOWNSCALE
 };
 
+/* ------ The tiffscaled device ------ */
 
+static dev_proc_print_page(tiffscaled_print_page);
+
+static const gx_device_procs tiffscaled_procs =
+prn_color_params_procs(tiff_open,
+                       tiff_output_page,
+                       tiff_close,
+                       gx_default_gray_map_rgb_color,
+                       gx_default_gray_map_color_rgb,
+                       tiff_get_params_downscale,
+                       tiff_put_params_downscale);
+
+const gx_device_tiff gs_tiffscaled_device = {
+    prn_device_body(gx_device_tiff,
+                    tiffscaled_procs,
+                    "tiffscaled",
+                    DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
+                    600, 600,   /* 600 dpi by default */
+                    0, 0, 0, 0, /* Margins */
+                    1,          /* num components */
+                    8,          /* bits per sample */
+                    255, 0, 256, 0,
+                    tiffscaled_print_page),
+    arch_is_big_endian,/* default to native endian (i.e. use big endian iff the platform is so */
+    COMPRESSION_NONE,
+    TIFF_DEFAULT_STRIP_SIZE,
+    TIFF_DEFAULT_DOWNSCALE
+};
+
+
 /* ------ Private functions ------ */
 
 static void
@@ -96,6 +130,24 @@
     return tiff_print_page(pdev, tfdev->tif);
 }
 
+static int
+tiffscaled_print_page(gx_device_printer * pdev, FILE * file)
+{
+    gx_device_tiff *const tfdev = (gx_device_tiff *)pdev;
+    int code;
+
+    if (pdev->height > (max_long - ftell(file))/(pdev->width)) /* note width is never 0 in print_page */
+        return_error(gs_error_rangecheck);  /* this will overflow max_long */
+
+    code = gdev_tiff_begin_page(tfdev, file);
+    if (code < 0)
+        return code;
+
+    tiff_set_gray_fields(pdev, tfdev->tif, 1, tfdev->Compression, tfdev->MaxStripSize);
+
+    return tiff_downscale_and_print_page(pdev, tfdev->tif, tfdev->DownScaleFactor);
+}
+
 /* ------ The cmyk devices ------ */
 
 static dev_proc_print_page(tiffcmyk_print_page);
@@ -120,7 +172,8 @@
 		    4, 32, 255, 255, 256, 256, tiffcmyk_print_page),
     arch_is_big_endian          /* default to native endian (i.e. use big endian iff the platform is so*/,
     COMPRESSION_NONE,
-    TIFF_DEFAULT_STRIP_SIZE
+    TIFF_DEFAULT_STRIP_SIZE,
+    TIFF_DEFAULT_DOWNSCALE
 };
 
 /* 16-bit-per-plane separated CMYK color. */
@@ -137,7 +190,8 @@
 		    4, 64, 255, 255, 256, 256, tiffcmyk_print_page),
     arch_is_big_endian          /* default to native endian (i.e. use big endian iff the platform is so*/,
     COMPRESSION_NONE,
-    TIFF_DEFAULT_STRIP_SIZE
+    TIFF_DEFAULT_STRIP_SIZE,
+    TIFF_DEFAULT_DOWNSCALE
 };
 
 /* ------ Private functions ------ */
@@ -1369,7 +1423,7 @@
 	if (!tfdev->tiff_comp)
 	    return_error(gs_error_invalidfileaccess);
     }
-    code = tiff_set_fields_for_printer(pdev, tfdev->tiff_comp);
+    code = tiff_set_fields_for_printer(pdev, tfdev->tiff_comp, 1);
     tiff_set_cmyk_fields(pdev, tfdev->tiff_comp, 8, COMPRESSION_NONE, tfdev->MaxStripSize);
     pdev->color_info.depth = save_depth;
     if (code < 0)
@@ -1411,7 +1465,7 @@
 	if (pdev->height > (max_long - ftell(file))/(pdev->width)) /* note width is never 0 in print_page */
 	    return_error(gs_error_rangecheck);  /* this will overflow max_long */
 
-	code = tiff_set_fields_for_printer(pdev, tfdev->tiff[comp_num]);
+        code = tiff_set_fields_for_printer(pdev, tfdev->tiff[comp_num], 1);
 	tiff_set_gray_fields(pdev, tfdev->tiff[comp_num], 8, tfdev->Compression, tfdev->MaxStripSize);
 	pdev->color_info.depth = save_depth;
         if (code < 0)
@@ -1584,7 +1638,7 @@
 	}
 
 	pdev->color_info.depth = 8;	/* Create files for 8 bit gray */
-	code = tiff_set_fields_for_printer(pdev, tfdev->tiff[comp_num]);
+        code = tiff_set_fields_for_printer(pdev, tfdev->tiff[comp_num], 1);
 	tiff_set_gray_fields(pdev, tfdev->tiff[comp_num], 1, tfdev->Compression, tfdev->MaxStripSize);
 	pdev->color_info.depth = save_depth;
         if (code < 0)

Modified: branches/chrisl-test-gs/base/gdevxcmp.c
===================================================================
--- branches/chrisl-test-gs/base/gdevxcmp.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevxcmp.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -389,6 +389,7 @@
     case 'G':
 grayscale:
 	xdev->color_info.num_components = 1;
+	xdev->color_info.gray_index = 0;
 	xdev->color_info.max_gray = xdev->cman.num_rgb - 1;
 #if HaveStdCMap
 	/* Get a standard color map if available */
@@ -434,6 +435,7 @@
     case 'M':
 monochrome:
 	xdev->color_info.num_components = 1;
+	xdev->color_info.gray_index = 0;
 	xdev->color_info.max_gray = 1;
 	xdev->color_info.dither_grays = 2;
 	break;

Modified: branches/chrisl-test-gs/base/gdevxini.c
===================================================================
--- branches/chrisl-test-gs/base/gdevxini.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevxini.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -46,6 +46,8 @@
 
 /* Forward references */
 static void gdev_x_setup_fontmap(gx_device_X *);
+static void x_get_work_area(gx_device_X *xdev, int *pwidth, int *pheight);
+static long *x_get_win_property(gx_device_X *xdev, const char *atom_name);
 
 /* Catch the alloc error when there is not enough resources for the
  * backing pixmap.  Automatically shut off backing pixmap and let the
@@ -318,7 +320,11 @@
 	    xdev->y_pixels_per_inch == FAKE_RES) {
 	    float xsize = (float)xdev->width / xdev->x_pixels_per_inch;
 	    float ysize = (float)xdev->height / xdev->y_pixels_per_inch;
+	    int workarea_width = WidthOfScreen(xdev->scr), workarea_height = HeightOfScreen(xdev->scr);
 
+	    /* Get area available for windows placement */
+	    x_get_work_area(xdev, &workarea_width, &workarea_height);
+
 	    if (xdev->xResolution == 0.0 && xdev->yResolution == 0.0) {
 		float dpi, xdpi, ydpi;
 
@@ -348,11 +354,12 @@
 		xdev->x_pixels_per_inch = xdev->xResolution;
 		xdev->y_pixels_per_inch = xdev->yResolution;
 	    }
-	    if (xdev->width > WidthOfScreen(xdev->scr)) {
-		xdev->width = xsize * xdev->x_pixels_per_inch;
+	    /* Restrict maximum window size to available work area */
+	    if (xdev->width > workarea_width) {
+		xdev->width = min(xsize * xdev->x_pixels_per_inch, workarea_width);
 	    }
-	    if (xdev->height > HeightOfScreen(xdev->scr)) {
-		xdev->height = ysize * xdev->y_pixels_per_inch;
+	    if (xdev->height > workarea_height) {
+		xdev->height = min(ysize * xdev->y_pixels_per_inch, workarea_height);
 	    }
 	    xdev->MediaSize[0] =
 		(float)xdev->width / xdev->x_pixels_per_inch * 72;
@@ -500,6 +507,49 @@
     return 0;
 }
 
+/* Get area available for windows placement */
+static void
+x_get_work_area(gx_device_X *xdev, int *pwidth, int *pheight)
+{
+    /* First get work area from window manager if available */
+    long *area;
+
+    /* Try to get NET_WORKAREA then WIN_WORKAREA */
+    if ((area = x_get_win_property(xdev, "_NET_WORKAREA")) != NULL ||
+	    (area = x_get_win_property(xdev, "_WIN_WORKAREA")) != NULL) {
+	/* Update maximum screen size with usable screen size */
+	*pwidth = area[2];
+	*pheight = area[3];
+	XFree(area);
+    }
+}
+
+/* Get window property with specified name (should be CARDINAL, four 32-bit words) */
+static long *
+x_get_win_property(gx_device_X *xdev, const char *atom_name)
+{
+    Atom r_type = (Atom)0;
+    int r_format = 0;
+    unsigned long count = 0;
+    unsigned long bytes_remain;
+    unsigned char *prop;
+
+    if (XGetWindowProperty(xdev->dpy, RootWindowOfScreen(xdev->scr),
+			   XInternAtom(xdev->dpy, atom_name, False),
+                           0, 4, False, XA_CARDINAL,
+                           &r_type, &r_format,
+                           &count, &bytes_remain, &prop) == Success &&
+                           prop &&
+                           r_type == XA_CARDINAL &&
+                           r_format == 32 &&
+                           count == 4 &&
+                           bytes_remain == 0)
+            return (long *)prop;	/* should free at the caller */
+    /* property does not exists or something went wrong */
+    XFree(prop);
+    return NULL;
+}
+
 /* Set up or take down buffering in a RAM image. */
 static int
 x_set_buffer(gx_device_X * xdev)
@@ -934,11 +984,28 @@
 	 dev->HWResolution[0] != values.HWResolution[0] ||
 	 dev->HWResolution[1] != values.HWResolution[1])
 	) {
-	int dw = dev->width - values.width;
-	int dh = dev->height - values.height;
-	double qx = dev->HWResolution[0] / values.HWResolution[0];
-	double qy = dev->HWResolution[1] / values.HWResolution[1];
+	int area_width = WidthOfScreen(xdev->scr), area_height = HeightOfScreen(xdev->scr);
+	int dw, dh;
 
+	/* Get work area */
+	x_get_work_area(xdev, &area_width, &area_height);
+
+	/* Preserve screen resolution */
+	dev->x_pixels_per_inch = values.x_pixels_per_inch;
+	dev->y_pixels_per_inch = values.y_pixels_per_inch;
+	dev->HWResolution[0] = values.HWResolution[0];
+	dev->HWResolution[1] = values.HWResolution[1];
+
+	/* Recompute window size using screen resolution and available work area size*/
+	/* pixels */
+	dev->width = min(dev->width, area_width);
+        dev->height = min(dev->height, area_height);
+        /* points */
+        dev->MediaSize[0] = (float)dev->width / xdev->x_pixels_per_inch * 72;
+        dev->MediaSize[1] = (float)dev->height / xdev->y_pixels_per_inch * 72;
+
+        dw = dev->width - values.width;
+        dh = dev->height - values.height;
 	if (dw || dh) {
 	    XResizeWindow(xdev->dpy, xdev->win,
 			  dev->width, dev->height);
@@ -964,10 +1031,6 @@
 	    } else {		/* 270 degree rotation */
 	    }
 	}
-	xdev->initial_matrix.xx *= qx;
-	xdev->initial_matrix.xy *= qx;
-	xdev->initial_matrix.yx *= qy;
-	xdev->initial_matrix.yy *= qy;
     }
     xdev->MaxTempPixmap = values.MaxTempPixmap;
     xdev->MaxTempImage = values.MaxTempImage;

Modified: branches/chrisl-test-gs/base/gdevxxf.c
===================================================================
--- branches/chrisl-test-gs/base/gdevxxf.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gdevxxf.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -31,9 +31,48 @@
 
 extern gx_device_X gs_x11_device;
 
-extern const byte gs_map_std_to_iso[256];
-extern const byte gs_map_iso_to_std[256];
+/* duplicated from gdevemap.c so that this can build as dynamic */
+/* Mappings between StandardEncoding and ISOLatin1Encoding */
+const byte gs_map_std_to_iso[256] =
+{
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 173, 46, 47,
+    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+    64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+    80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
+ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
+112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 161, 162, 163, 0, 165, 0, 167, 164, 0, 0, 171, 0, 0, 0, 0,
+    0, 0, 0, 0, 183, 0, 182, 0, 0, 0, 0, 187, 0, 0, 0, 191,
+    0, 145, 180, 147, 148, 175, 150, 151, 168, 0, 154, 184, 0, 157, 158, 159,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 198, 0, 170, 0, 0, 0, 0, 0, 216, 0, 186, 0, 0, 0, 0,
+    0, 230, 0, 0, 0, 144, 0, 0, 0, 248, 0, 223, 0, 0, 0, 0
+};
 
+const byte gs_map_iso_to_std[256] =
+{
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 0, 46, 47,
+    48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+    64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+    80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
+ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
+112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 245, 193, 194, 195, 196, 197, 198, 199, 200, 0, 202, 203, 0, 205, 206, 207,
+    32, 161, 162, 163, 168, 165, 0, 167, 200, 0, 227, 171, 0, 45, 0, 197,
+    0, 0, 0, 0, 194, 0, 182, 180, 203, 0, 235, 187, 0, 0, 0, 191,
+    0, 0, 0, 0, 0, 0, 225, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 233, 0, 0, 0, 0, 0, 0, 251,
+    0, 0, 0, 0, 0, 0, 241, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 249, 0, 0, 0, 0, 0, 0, 0
+};
+
 /* Declare the xfont procedures */
 static xfont_proc_lookup_font(x_lookup_font);
 static xfont_proc_char_xglyph(x_char_xglyph);

Deleted: branches/chrisl-test-gs/base/gp_iwatc.c
===================================================================
--- branches/chrisl-test-gs/base/gp_iwatc.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gp_iwatc.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1,240 +0,0 @@
-/* Copyright (C) 2001-2006 Artifex Software, Inc.
-   All Rights Reserved.
-  
-   This software is provided AS-IS with no warranty, either express or
-   implied.
-
-   This software is distributed under license and may not be copied, modified
-   or distributed except as expressly authorized under the terms of that
-   license.  Refer to licensing information at http://www.artifex.com/
-   or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
-   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
-*/
-
-/* $Id$ */
-/* Intel processor, Watcom C-specific routines for Ghostscript */
-#include "dos_.h"
-#include <fcntl.h>
-#include <signal.h>
-#include <stdlib.h>
-#include "stat_.h"
-#include "string_.h"
-#include "gx.h"
-#include "gp.h"
-#include "gpmisc.h"
-
-/* Library routines not declared in a standard header */
-extern char *mktemp(char *);	/* in gp_mktmp.c */
-
-/* Define a substitute for stdprn (see below). */
-static FILE *gs_stdprn;
-
-/* Forward declarations */
-static void handle_FPE(int);
-
-/* Do platform-dependent initialization. */
-void
-gp_init(void)
-{
-    gs_stdprn = 0;
-    /* Set up the handler for numeric exceptions. */
-    signal(SIGFPE, handle_FPE);
-}
-
-/* Trap numeric exceptions.  Someday we will do something */
-/* more appropriate with these. */
-static void
-handle_FPE(int sig)
-{
-    eprintf("Numeric exception:\n");
-    exit(1);
-}
-
-/* Do platform-dependent cleanup. */
-void
-gp_exit(int exit_status, int code)
-{
-}
-
-/* Exit the program. */
-void
-gp_do_exit(int exit_status)
-{
-    exit(exit_status);
-}
-
-/* ------ Persistent data cache ------*/
-  
-/* insert a buffer under a (type, key) pair */
-int gp_cache_insert(int type, byte *key, int keylen, void *buffer, int buflen)
-{ 
-    /* not yet implemented */
-    return 0;
-} 
- 
-/* look up a (type, key) in the cache */
-int gp_cache_query(int type, byte* key, int keylen, void **buffer,
-    gp_cache_alloc alloc, void *userdata)
-{
-    /* not yet implemented */
-    return -1;
-}
-
-/* ------ Printer accessing ------ */
-
-/* Open a connection to a printer.  A null file name means use the */
-/* standard printer connected to the machine, if any. */
-/* Return NULL if the connection could not be opened. */
-extern void gp_set_file_binary(int, int);
-FILE *
-gp_open_printer(const gs_memory_t *mem,
-                      char         fname[gp_file_name_sizeof],
-                      int          binary_mode)
-{
-    FILE *pfile;
-
-    if (strlen(fname) == 0 || !strcmp(fname, "PRN")) {
-#ifdef stdprn
-	if (!binary_mode)
-	    return stdprn;
-	if (gs_stdprn == 0) {
-	    /* We have to effectively reopen the printer, */
-	    /* because the Watcom library does \n -> \r\n */
-	    /* substitution on the stdprn stream. */
-	    int fno = dup(fileno(stdprn));
-
-	    setmode(fno, O_BINARY);
-	    gs_stdprn = fdopen(fno, "wb");
-	}
-	pfile = gs_stdprn;
-#else	/* WATCOM doesn't know about stdprn device */
-	pfile = fopen("PRN", (binary_mode ? "wb" : "w"));
-	if (pfile == NULL)
-	    return NULL;
-#endif	/* defined(stdprn) */
-    } else {
-	pfile = fopen(fname, (binary_mode ? "wb" : "w"));
-	if (pfile == NULL)
-	    return NULL;
-    }
-    gp_set_file_binary(fileno(pfile), binary_mode);
-    return pfile;
-}
-
-/* Close the connection to the printer. */
-void
-gp_close_printer(const gs_memory_t *mem, FILE * pfile, const char *fname)
-{
-#ifdef stdprn
-    if (pfile != stdprn)
-#endif	/* defined(stdprn) */
-	fclose(pfile);
-    if (pfile == gs_stdprn)
-	gs_stdprn = 0;
-}
-
-/* ------ File naming and accessing ------ */
-
-/* Create and open a scratch file with a given name prefix. */
-/* Write the actual file name at fname. */
-FILE *
-gp_open_scratch_file(const gs_memory_t *mem,
-                     const char        *prefix,
-                     char              *fname,
-                     const char        *mode)
-{	      /* The -7 is for XXXXXXX */
-    int prefix_length = strlen(prefix);
-    int len = gp_file_name_sizeof - prefix_length - 7;
-    FILE *f;
-
-    if (gp_file_name_is_absolute(prefix, prefix_length) ||
-	gp_gettmpdir(fname, &len) != 0
-	)
-	*fname = 0;
-    else {
-	char *temp;
-
-	/* Prevent X's in path from being converted by mktemp. */
-	for (temp = fname; *temp; temp++)
-	    *temp = tolower(*temp);
-	if (strlen(fname) && (fname[strlen(fname) - 1] != '\\'))
-	    strcat(fname, "\\");
-    }
-    if (strlen(fname) + prefix_length + 7 >= gp_file_name_sizeof)
-	return 0;		/* file name too long */
-    strcat(fname, prefix);
-    strcat(fname, "XXXXXX");
-    mktemp(fname);
-    f = gp_fopentemp(fname, mode);
-    if (f == NULL)
-	emprintf1(mem, "**** Could not open temporary file %s\n", fname);
-    return f;
-}
-
-
-/* Open a file with the given name, as a stream of uninterpreted bytes. */
-FILE *
-gp_fopen(const char *fname, const char *mode)
-{
-    return fopen(fname, mode);
-}
-
-/* ------ Font enumeration ------ */
- 
- /* This is used to query the native os for a list of font names and
-  * corresponding paths. The general idea is to save the hassle of
-  * building a custom fontmap file.
-  */
- 
-void *gp_enumerate_fonts_init(gs_memory_t *mem)
-{
-    return NULL;
-}
-         
-int gp_enumerate_fonts_next(void *enum_state, char **fontname, char **path)
-{
-    return 0;
-}
-                         
-void gp_enumerate_fonts_free(void *enum_state)
-{
-}  
-
-/* --------- 64 bit file access ----------- */
-/* fixme: Not implemented yet.
- * Currently we stub it with 32 bits access. 
- */
-
-FILE *gp_fopen_64(const char *filename, const char *mode)
-{
-    return fopen(filename, mode);
-}
-
-FILE *gp_open_scratch_file_64(const gs_memory_t *mem,
-                              const char        *prefix,
-                              char               fname[gp_file_name_sizeof],
-                              const char        *mode)
-{
-    return gp_open_scratch_file(mem, prefix, fname, mode);
-}
-
-FILE *gp_open_printer_64(const gs_memory_t *mem,
-                               char         fname[gp_file_name_sizeof],
-                               int          binary_mode)
-{
-    return gp_open_printer(mem, fname, binary_mode);
-}
-
-int64_t gp_ftell_64(FILE *strm)
-{
-    return ftell(strm);
-}
-
-int gp_fseek_64(FILE *strm, int64_t offset, int origin)
-{
-    long offset1 = (long)offset;
-    
-    if (offset != offset1)
-	return -1;
-    return fseek(strm, offset1, origin);
-}

Modified: branches/chrisl-test-gs/base/gp_upapr.c
===================================================================
--- branches/chrisl-test-gs/base/gp_upapr.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gp_upapr.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -19,6 +19,7 @@
 #endif
 
 #include "string_.h"
+#include "malloc_.h"
 #include "gx.h"
 #include "gp.h"
 
@@ -30,26 +31,34 @@
 {
 #ifdef USE_LIBPAPER
     const char *paper;
+    bool is_systempaper;
 
     paperinit();
 
     paper = systempapername();
-    if (!paper) paper = defaultpapername();
+    if (paper) 
+        is_systempaper =  true;
+    else {
+        paper = defaultpapername();
+        is_systempaper =  false;
+    }
 
     if (paper) {
-	int len = strlen(paper);
+	int rc, len = strlen(paper);
 
 	if (len < *plen) {
 	    /* string fits */
 	    strcpy(ptr, paper);
-	    *plen = len + 1;
-	    paperdone();
-	    return 0;
+	    rc = 0;
+	} else {
+	    /* string doesn't fit */
+	    rc = -1;
 	}
-	/* string doesn't fit */
 	*plen = len + 1;
 	paperdone();
-	return -1;
+	if (is_systempaper)
+            free(paper);
+	return rc;
     }
 #endif
 

Modified: branches/chrisl-test-gs/base/gsbitops.c
===================================================================
--- branches/chrisl-test-gs/base/gsbitops.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsbitops.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -659,3 +659,29 @@
 	dest += dest_raster;
     }
 }
+
+/* Copy a rectangle of bytes zeroing any padding bytes. */
+void
+bytes_copy_rectangle_zero_padding(byte * dest, uint dest_raster,
+	     const byte * src, uint src_raster, int width_bytes, int height)
+{
+    int padlen = dest_raster;
+    if (padlen < 0)
+        padlen = -padlen;
+    padlen -= width_bytes;
+    if (padlen == 0)
+    {
+        while (height-- > 0) {
+            memcpy(dest, src, width_bytes);
+            src += src_raster;
+            dest += dest_raster;
+        }
+    } else {
+        while (height-- > 0) {
+            memcpy(dest, src, width_bytes);
+            memset(dest+width_bytes, 0, padlen);
+            src += src_raster;
+            dest += dest_raster;
+        }
+    }
+}

Modified: branches/chrisl-test-gs/base/gsbitops.h
===================================================================
--- branches/chrisl-test-gs/base/gsbitops.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsbitops.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -318,4 +318,9 @@
 void bytes_copy_rectangle(byte * dest, uint dest_raster,
     const byte * src, uint src_raster, int width_bytes, int height);
 
+/* Copy a rectangle of bytes, ensuring that any padding bits at the end
+ * of each dest_raster line are zeroed. */
+void bytes_copy_rectangle_zero_padding(byte * dest, uint dest_raster,
+    const byte * src, uint src_raster, int width_bytes, int height);
+
 #endif /* gsbitops_INCLUDED */

Modified: branches/chrisl-test-gs/base/gscdevn.c
===================================================================
--- branches/chrisl-test-gs/base/gscdevn.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gscdevn.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -364,7 +364,7 @@
         }
         return(code);
     } else {
-        code = (*pcs->type->concretize_color)(pcc, pcs, conc, pis);
+        code = (*pcs->type->concretize_color)(pcc, pcs, conc, pis, dev);
         if (code < 0)
 	    return code;
         pconcs = cs_concrete_space(pcs, pis);
@@ -380,7 +380,7 @@
 
 static int
 gx_concretize_DeviceN(const gs_client_color * pc, const gs_color_space * pcs,
-		      frac * pconc, const gs_imager_state * pis)
+		      frac * pconc, const gs_imager_state * pis, gx_device *dev)
 {
     int code, tcode = 0;
     gs_client_color cc;
@@ -424,7 +424,7 @@
         if (tcode < 0)
 	    return tcode;
 
-	code = cs_concretize_color(&cc, pacs, pconc, pis);
+	code = cs_concretize_color(&cc, pacs, pconc, pis, dev);
 
     }
     else {

Modified: branches/chrisl-test-gs/base/gscicach.c
===================================================================
--- branches/chrisl-test-gs/base/gscicach.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gscicach.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -276,7 +276,8 @@
 	    pdevc = &devc_local;
 	memcpy(this->paint_values + i * client_num_components, paint_values, sizeof(*paint_values) * client_num_components);
 	memcpy(fcc.paint.values, paint_values, sizeof(*paint_values) * client_num_components);
-	code = pcs->type->remap_color(&fcc, pcs, pdevc, this->pis, this->dev, gs_color_select_texture);
+	code = pcs->type->remap_color(&fcc, pcs, pdevc, this->pis, this->trans_dev, 
+                                      gs_color_select_texture);
 	if (code < 0)
 	    return code;
 	if (pdevc->type != &gx_dc_type_data_pure)

Modified: branches/chrisl-test-gs/base/gsciemap.c
===================================================================
--- branches/chrisl-test-gs/base/gsciemap.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsciemap.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -185,7 +185,7 @@
 		gs_color_select_t select)
 {
     gs_color_space *pcs_icc;
-    int code;
+    int code, i;
     gs_client_color scale_pc;
 
     if_debug4('c', "[c]remap CIEDEFG [%g %g %g %g]\n",
@@ -207,13 +207,18 @@
     /* Do the rescale from 0 to 1 */
     rescale_input_color(&(pcs->params.defg->RangeDEFG.ranges[0]), 4, pc, &scale_pc);
     /* Now the icc remap */
-    return((pcs_icc->type->remap_color)(pc,pcs_icc,pdc,pis,dev,select));
+    code = (pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pis,dev,select);
+    /* Save unscaled data for high level device (e.g. pdfwrite) */
+    for (i = 0; i < 4; i++)
+	pdc->ccolor.paint.values[i] = pc->paint.values[i];
+    pdc->ccolor_valid = true;
+    return(code);
 }
 
 /* Render a CIEBasedDEFG color. */
 int
 gx_concretize_CIEDEFG(const gs_client_color * pc, const gs_color_space * pcs,
-		      frac * pconc, const gs_imager_state * pis)
+		      frac * pconc, const gs_imager_state * pis, gx_device *dev)
 {
     const gs_cie_defg *pcie = pcs->params.defg;
     int code;
@@ -234,12 +239,12 @@
     /* Rescale the input based upon the input range since profile is
        created to remap this range from 0 to 1 */
     if (check_range(&(pcs->params.defg->RangeDEFG.ranges[0]), 4)) {
-        return((pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis));
+        return((pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis, dev));
     }
     /* Do the rescale from 0 to 1 */
     rescale_input_color(&(pcs->params.defg->RangeDEFG.ranges[0]), 4, pc, &scale_pc);
     /* Now the icc remap */
-    return((pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis));
+    return((pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis, dev));
 }
 
 /* Used for when we have to mash entire transform to CIEXYZ */
@@ -449,6 +454,7 @@
 {
     gs_color_space *pcs_icc;
     gs_client_color scale_pc;
+    int i,code;
 
     if_debug3('c', "[c]remap CIEDEF [%g %g %g]\n",
 	      pc->paint.values[0], pc->paint.values[1],
@@ -469,13 +475,18 @@
     /* Do the rescale from 0 to 1 */
     rescale_input_color(&(pcs->params.def->RangeDEF.ranges[0]), 3, pc, &scale_pc);
     /* Now the icc remap */
-    return((pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pis,dev,select));
+    code = (pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pis,dev,select);
+    /* Save unscaled data for high level device (e.g. pdfwrite) */
+    for (i = 0; i < 3; i++)
+	pdc->ccolor.paint.values[i] = pc->paint.values[i];
+    pdc->ccolor_valid = true;
+    return(code);
 }
 
 /* Render a CIEBasedDEF color. */
 int
 gx_concretize_CIEDEF(const gs_client_color * pc, const gs_color_space * pcs,
-		     frac * pconc, const gs_imager_state * pis)
+		     frac * pconc, const gs_imager_state * pis, gx_device *dev)
 {
     const gs_cie_def *pcie = pcs->params.def;
     int code;
@@ -496,12 +507,12 @@
     /* Rescale the input based upon the input range since profile is
        created to remap this range from 0 to 1 */
     if (check_range(&(pcs->params.def->RangeDEF.ranges[0]), 3)) {
-        return((pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis));
+        return((pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis, dev));
 }
     /* Do the rescale from 0 to 1 */
     rescale_input_color(&(pcs->params.def->RangeDEF.ranges[0]), 3, pc, &scale_pc);
     /* Now the icc remap */
-    return((pcs_icc->type->concretize_color)(&scale_pc, pcs_icc, pconc, pis));
+    return((pcs_icc->type->concretize_color)(&scale_pc, pcs_icc, pconc, pis, dev));
 }
 #undef SCALE_TO_RANGE
 
@@ -541,6 +552,7 @@
     gs_color_space *pcs_icc;
     gs_client_color scale_pc;
     bool islab;
+    int i,code;
 
     if_debug3('c', "[c]remap CIEABC [%g %g %g]\n",
 	      pc->paint.values[0], pc->paint.values[1],
@@ -561,12 +573,18 @@
     /* Do the rescale from 0 to 1 */
     rescale_input_color(&(pcs->params.abc->RangeABC.ranges[0]), 3, pc, &scale_pc);
     /* Now the icc remap */
-    return((pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pis,dev,select));
+    code = (pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pis,dev,select);
+    /* Save unscaled data for high level device (e.g. pdfwrite) */
+    for (i = 0; i < 3; i++)
+	pdc->ccolor.paint.values[i] = pc->paint.values[i];
+    pdc->ccolor_valid = true;
+    /* Now the icc remap */
+    return(code);
 }
 
 int
 gx_concretize_CIEABC(const gs_client_color * pc, const gs_color_space * pcs,
-		     frac * pconc, const gs_imager_state * pis)
+		     frac * pconc, const gs_imager_state * pis, gx_device *dev)
 {
     gs_color_space *pcs_icc;
     gs_client_color scale_pc;
@@ -586,12 +604,12 @@
     /* Rescale the input based upon the input range since profile is
        created to remap this range from 0 to 1 */
     if (check_range(&(pcs->params.abc->RangeABC.ranges[0]), 3)) {
-        return((pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis));
+        return((pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis, dev));
     }
     /* Do the rescale from 0 to 1 */
     rescale_input_color(&(pcs->params.abc->RangeABC.ranges[0]), 3, pc, &scale_pc);
     /* Now the icc remap */
-    return((pcs_icc->type->concretize_color)(&scale_pc, pcs_icc, pconc, pis));
+    return((pcs_icc->type->concretize_color)(&scale_pc, pcs_icc, pconc, pis, dev));
 }
 
 /* Common code shared between remap and concretize */
@@ -645,13 +663,17 @@
     /* Do the rescale from 0 to 1 */
     rescale_input_color(&(pcs->params.a->RangeA), 1, pc, &scale_pc);
     /* Now the icc remap */
-    return((pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pis,dev,select));
+    code = (pcs_icc->type->remap_color)(&scale_pc,pcs_icc,pdc,pis,dev,select);
+    /* Save unscaled data for high level device (e.g. pdfwrite) */
+    pdc->ccolor.paint.values[0] = pc->paint.values[0];
+    pdc->ccolor_valid = true;
+    return(code);
 }
 
 /* Render a CIEBasedA color. */
 int
 gx_concretize_CIEA(const gs_client_color * pc, const gs_color_space * pcs,
-		   frac * pconc, const gs_imager_state * pis)
+		   frac * pconc, const gs_imager_state * pis, gx_device *dev)
 {
     int code;
     gs_color_space *pcs_icc;
@@ -670,12 +692,12 @@
     /* Rescale the input based upon the input range since profile is
        created to remap this range from 0 to 1 */
     if (check_range(&(pcs->params.a->RangeA), 1)) {
-        return((pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis));
+        return((pcs_icc->type->concretize_color)(pc, pcs_icc, pconc, pis, dev));
     }
     /* Do the rescale from 0 to 1 */
     rescale_input_color(&(pcs->params.a->RangeA), 1, pc, &scale_pc);
     /* Now the icc remap */
-    return((pcs_icc->type->concretize_color)(&scale_pc, pcs_icc, pconc, pis));
+    return((pcs_icc->type->concretize_color)(&scale_pc, pcs_icc, pconc, pis, dev));
 }
 
 /* Call for cases where the equivalent icc color space needs to be set */

Modified: branches/chrisl-test-gs/base/gscms.h
===================================================================
--- branches/chrisl-test-gs/base/gscms.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gscms.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -176,6 +176,7 @@
 				 * name.  This is primarily here for the system profiles, and
 				 * so that we avoid resetting them everytime the user params
 				 * are reloaded. */
+    gs_memory_t *memory;        /* In case we have some in non-gc and some in gc memory */
 };
 
 #ifndef cmm_profile_DEFINED
@@ -301,6 +302,7 @@
     cmm_profile_t *smask_gray;
     cmm_profile_t *smask_rgb;
     cmm_profile_t *smask_cmyk;
+    gs_memory_t *memory;            
 } gsicc_smask_t;
 
 /* The manager object */
@@ -312,7 +314,6 @@
     cmm_profile_t *default_cmyk;    /* Default CMYK profile for device CMKY */
     cmm_profile_t *proof_profile;   /* Proofing profile */
     cmm_profile_t *output_link;     /* Output device Link profile */
-    cmm_profile_t *device_profile;  /* The actual profile for the device */
     cmm_profile_t *lab_profile;     /* Colorspace type ICC profile from LAB to LAB */
     gsicc_devicen_t *device_n;      /* A linked list of profiles used for DeviceN support */ 
     gsicc_smask_t *smask_profiles;  /* Profiles used when we are in a softmask group */

Modified: branches/chrisl-test-gs/base/gscolor2.c
===================================================================
--- branches/chrisl-test-gs/base/gscolor2.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gscolor2.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -453,7 +453,7 @@
 
 static int
 gx_concretize_Indexed(const gs_client_color * pc, const gs_color_space * pcs,
-		      frac * pconc, const gs_imager_state * pis)
+		      frac * pconc, const gs_imager_state * pis, gx_device *dev)
 {
 
     gs_client_color cc;
@@ -463,7 +463,7 @@
 
     if (code < 0)
 	return code;
-    return (*pbcs->type->concretize_color) (&cc, pbcs, pconc, pis);
+    return (*pbcs->type->concretize_color) (&cc, pbcs, pconc, pis, dev);
 }
 
 /* Look up an index in an Indexed color space. */

Modified: branches/chrisl-test-gs/base/gscpixel.c
===================================================================
--- branches/chrisl-test-gs/base/gscpixel.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gscpixel.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -88,7 +88,7 @@
 
 static int
 gx_concretize_DevicePixel(const gs_client_color * pc, const gs_color_space * pcs,
-			  frac * pconc, const gs_imager_state * pis)
+			  frac * pconc, const gs_imager_state * pis, gx_device *dev)
 {
     /****** NOT ENOUGH BITS IN float OR frac ******/
     pconc[0] = (frac) (ulong) pc->paint.values[0];

Modified: branches/chrisl-test-gs/base/gscsepr.c
===================================================================
--- branches/chrisl-test-gs/base/gscsepr.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gscsepr.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -298,7 +298,7 @@
 
 static int
 gx_concretize_Separation(const gs_client_color *pc, const gs_color_space *pcs,
-			 frac *pconc, const gs_imager_state *pis)
+			 frac *pconc, const gs_imager_state *pis, gx_device *dev)
 {
     int code;
     gs_client_color cc;
@@ -328,10 +328,10 @@
             pcs->params.separation.get_colorname_string(pis->memory, name,
 						&pname, &name_size);
             code = gsicc_transform_named_color(pc->paint.values[0], pname, 
-                            name_size, device_values, pis, NULL, 
+                            name_size, device_values, pis, dev, NULL, 
                             &rendering_params, false);
             if (code == 0) {
-                for (k = 0; k < pis->icc_manager->device_profile->num_comps; k++){
+                for (k = 0; k < dev->device_icc_profile->num_comps; k++){
                     pconc[k] = float2frac(((float) device_values[k])/65535.0);
                 }
                 return(0);
@@ -365,7 +365,7 @@
             cc.paint.values[1] = (cc.paint.values[1]+128)/255.0;
             cc.paint.values[2] = (cc.paint.values[2]+128)/255.0;
         } 
-	return cs_concretize_color(&cc, pacs, pconc, pis);
+	return cs_concretize_color(&cc, pacs, pconc, pis, dev);
     }
     else {
     	pconc[0] = gx_unit_frac(pc->paint.values[0]);

Modified: branches/chrisl-test-gs/base/gscspace.c
===================================================================
--- branches/chrisl-test-gs/base/gscspace.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gscspace.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -731,10 +731,8 @@
     if (index == 1)
 	return ENUM_OBJ(pcs->pclient_color_space_data);
     if (index == 2)
- 	return ENUM_OBJ(pcs->cmm_icc_profile_data);
-    if (index == 3)
         return ENUM_OBJ(pcs->icc_equivalent);
-    return ENUM_USING(*pcs->type->stype, vptr, size, index - 4);
+    return ENUM_USING(*pcs->type->stype, vptr, size, index - 3);
     ENUM_PTRS_END_PROC
 }
 static 
@@ -742,7 +740,6 @@
 {
     RELOC_VAR(pcs->base_space);
     RELOC_VAR(pcs->pclient_color_space_data);
-    RELOC_VAR(pcs->cmm_icc_profile_data);
     RELOC_VAR(pcs->icc_equivalent);
     RELOC_USING(*pcs->type->stype, vptr, size);
 }

Modified: branches/chrisl-test-gs/base/gsdevice.c
===================================================================
--- branches/chrisl-test-gs/base/gsdevice.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsdevice.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -46,6 +46,9 @@
 {
     gx_device * const dev = (gx_device *)vptr;
 
+    if (dev->device_icc_profile != NULL && !dev->retained) {
+        rc_decrement(dev->device_icc_profile, "gx_device_finalize(icc_profile)");
+    }
     if (dev->finalize)
 	dev->finalize(dev);
     discard(gs_closedevice(dev));
@@ -539,6 +542,10 @@
 	 * aside from references from graphics states.
 	 */
 	rc_init(ndev, pgs->memory, 0);
+        if (pgs->device != NULL && pgs->device->device_icc_profile != NULL) {
+            ndev->device_icc_profile = pgs->device->device_icc_profile;
+            rc_increment(ndev->device_icc_profile);
+        }
 	return gs_setdevice_no_erase(pgs, ndev);
     }
     return 0;
@@ -750,6 +757,9 @@
 	COPY_ARRAY_PARAM(Margins);
 	COPY_ARRAY_PARAM(HWMargins);
 	COPY_PARAM(PageCount);
+	COPY_PARAM(MaxPatternBitmap);
+        COPY_PARAM(device_icc_profile);
+        rc_increment(dev->device_icc_profile);
 #undef COPY_ARRAY_PARAM
 	gx_device_copy_color_params(dev, target);
 }

Modified: branches/chrisl-test-gs/base/gsdparam.c
===================================================================
--- branches/chrisl-test-gs/base/gsdparam.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsdparam.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -162,7 +162,9 @@
 				&dev->color_info.anti_alias.text_bits)) < 0 ||
 	(code = param_write_int(plist, "GraphicsAlphaBits",
 				&dev->color_info.anti_alias.graphics_bits)) < 0 ||
-	(code = param_write_bool(plist, ".LockSafetyParams", &dev->LockSafetyParams)) < 0 
+	(code = param_write_bool(plist, ".LockSafetyParams", &dev->LockSafetyParams)) < 0 ||
+	(code = param_write_int(plist, "MaxPatternBitmap", &dev->MaxPatternBitmap)) < 0
+
 	)
 	return code;
 
@@ -449,6 +451,7 @@
     long ColorValues = (depth >= 32 ? -1 : 1L << depth);
     int tab = dev->color_info.anti_alias.text_bits;
     int gab = dev->color_info.anti_alias.graphics_bits;
+    int mpbm = dev->MaxPatternBitmap;
     gs_param_string cms;
     int leadingedge = dev->LeadingEdge;
 
@@ -631,7 +634,7 @@
         if (icc_pro.size <= gp_file_name_sizeof) {
             
             /* Copy device ICC profile name in the device */
-  	    if (&(dev->color_info.icc_profile[0]) != icc_pro.data)
+  	    if (&(dev->color_info.icc_profile[0]) != (char *)(icc_pro.data))
   	        memcpy(&(dev->color_info.icc_profile[0]), icc_pro.data, icc_pro.size);        
         } 
 
@@ -645,6 +648,8 @@
 	ecode = code;
     if ((code = param_anti_alias_bits(plist, "GraphicsAlphaBits", &gab)) < 0)
 	ecode = code;
+    if ((code = param_read_int(plist, "MaxPatternBitmap", &mpbm)) < 0)
+	ecode = code;
 
     switch (code = param_read_bool(plist, (param_name = ".LockSafetyParams"), &locksafe)) {
 	case 0:
@@ -826,6 +831,7 @@
 		param_normalize_anti_alias_bits(max(dev->color_info.max_gray,
 			dev->color_info.max_color), gab);
     dev->LockSafetyParams = locksafe;
+    dev->MaxPatternBitmap = mpbm;
     gx_device_decache_colors(dev);
     return 0;
 }

Modified: branches/chrisl-test-gs/base/gsdps1.c
===================================================================
--- branches/chrisl-test-gs/base/gsdps1.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsdps1.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -199,7 +199,7 @@
     bool center_of_pixel = (pgs->fill_adjust.x == 0 && pgs->fill_adjust.y == 0);
 
     /* Processing a fill object operation */
-    gs_set_object_tag(pgs, GS_PATH_TAG);
+    gs_set_object_tag((gs_imager_state*) pgs, GS_PATH_TAG);
 
     gx_set_dev_color(pgs);
     if ((is_fzero2(pgs->ctm.xy, pgs->ctm.yx) ||

Modified: branches/chrisl-test-gs/base/gsequivc.c
===================================================================
--- branches/chrisl-test-gs/base/gsequivc.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsequivc.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -387,6 +387,7 @@
     temp_device.sep_num = sep_num;
     temp_device.pequiv_cmyk_colors = pparams;
     temp_device.memory = pgs->memory;
+    temp_device.device_icc_profile = pdev->device_icc_profile;
     /*
      * Create a temp copy of the imager state.  We do this so that we
      * can modify the color space mapping (cmap) procs.  We use our

Modified: branches/chrisl-test-gs/base/gsicc.c
===================================================================
--- branches/chrisl-test-gs/base/gsicc.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsicc.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -283,9 +283,8 @@
 	gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
 			  gs_color_select_t select)
 {
-    const gsicc_manager_t *icc_manager = pis->icc_manager;
-    const cmm_profile_t *device_profile = icc_manager->device_profile;
-    int num_colorants = device_profile->num_comps;
+    const cmm_profile_t *icc_profile = dev->device_icc_profile;
+    int num_colorants = icc_profile->num_comps;
     int code;
 
     switch( num_colorants ) {
@@ -345,7 +344,7 @@
 }
 }
     /* Get a link from the cache, or create if it is not there. Need to get 16 bit profile */
-    icc_link = gsicc_get_link(pis, pcs, NULL, &rendering_params, pis->memory, false);
+    icc_link = gsicc_get_link(pis, dev, pcs, NULL, &rendering_params, pis->memory, false);
     if (icc_link->is_identity) {
         psrc_temp = &(psrc[0]);
     } else {
@@ -356,7 +355,7 @@
 #ifdef DEBUG
     if (!icc_link->is_identity) {
         num_src_comps = pcs->cmm_icc_profile_data->num_comps;
-        num_des_comps = pis->icc_manager->device_profile->num_comps;
+        num_des_comps = dev->device_icc_profile->num_comps;
         if_debug0('c',"[c]ICC remap [ ");
         for (k = 0; k < num_src_comps; k++) {
             if_debug1('c', "%d ",psrc[k]);
@@ -374,7 +373,7 @@
        the transfer function and potentially the halftoning */
     /* Right now we need to go from unsigned short to frac.  I really
        would like to avoid this sort of stuff.  That will come. */
-    for ( k = 0; k< pis->icc_manager->device_profile->num_comps; k++){
+    for ( k = 0; k< dev->device_icc_profile->num_comps; k++){
         conc[k] = ushort2frac(psrc_temp[k]);
     }
     gx_remap_concrete_ICC(conc, pcs, pdc, pis, dev, select);
@@ -395,7 +394,8 @@
     const gs_client_color * pcc,
     const gs_color_space *  pcs,
     frac *                  pconc,
-    const gs_imager_state * pis )
+    const gs_imager_state * pis,
+    gx_device *dev)
     {
 
     gsicc_link_t *icc_link;
@@ -412,7 +412,7 @@
         psrc[k] = (unsigned short) (pcc->paint.values[k]*65535.0);
 	}
     /* Get a link from the cache, or create if it is not there. Get 16 bit profile */
-    icc_link = gsicc_get_link(pis, pcs, NULL, &rendering_params, pis->memory, false);
+    icc_link = gsicc_get_link(pis, dev, pcs, NULL, &rendering_params, pis->memory, false);
     /* Transform the color */
     if (icc_link->is_identity) {
         psrc_temp = &(psrc[0]);
@@ -422,7 +422,7 @@
         gscms_transform_color(icc_link, psrc, psrc_temp, 2, NULL);
     }
     /* This needs to be optimized */
-    for (k = 0; k < pis->icc_manager->device_profile->num_comps; k++){
+    for (k = 0; k < dev->device_icc_profile->num_comps; k++){
         pconc[k] = float2frac(((float) psrc_temp[k])/65535.0);
     }
     /* Release the link */

Modified: branches/chrisl-test-gs/base/gsicc_cache.c
===================================================================
--- branches/chrisl-test-gs/base/gsicc_cache.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsicc_cache.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1,914 +1,938 @@
-/* Copyright (C) 2001-2009 Artifex Software, Inc.
-   All Rights Reserved.
-  
-   This software is provided AS-IS with no warranty, either express or
-   implied.
-
-   This software is distributed under license and may not be copied, modified
-   or distributed except as expressly authorized under the terms of that
-   license.  Refer to licensing information at http://www.artifex.com/
-   or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
-   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
-*/
-/*  GS ICC link cache.  Initial stubbing of functions.  */
-
-#include "std.h"
-#include "stdpre.h"
-#include "gstypes.h"
-#include "gsmemory.h"
-#include "gsstruct.h"  
-#include "scommon.h"
-#include "gx.h"
-#include "gxistate.h"
-#include "smd5.h" 
-#include "gscms.h"
-#include "gsicc_littlecms.h" 
-#include "gsicc_manage.h"
-#include "gsicc_cache.h"
-#include "gserrors.h"
-#include "gsmalloc.h" /* Needed for named color structure allocation */
-#include "string_.h"  /* Needed for named color structure allocation */
-#include "gxsync.h"
-        /*
-	 *  Note that the the external memory used to maintain 
-         *  links in the CMS is generally not visible to GS.  
-         *  For most CMS's the  links are 33x33x33x33x4 bytes at worst 
-         *  for a CMYK to CMYK MLUT which is about 4.5Mb per link.
-         *  If the link were matrix based it would be much much smaller.
-         *  We will likely want to do at least have an estimate of the 
-         *  memory used based upon how the CMS is configured.
-         *  This will be done later.  For now, just limit the number
-         *  of links.
-	 */
-#define ICC_CACHE_MAXLINKS 50
-
-/* Static prototypes */
-
-
-static gsicc_link_t * gsicc_alloc_link(gs_memory_t *memory, gsicc_hashlink_t hashcode);
-
-static void gsicc_link_free(gsicc_link_t *icc_link, gs_memory_t *memory);
-
-static void gsicc_get_cspace_hash(gsicc_manager_t *icc_manager, cmm_profile_t *profile, int64_t *hash);
-
-static void gsicc_compute_linkhash(gsicc_manager_t *icc_manager, cmm_profile_t *input_profile, 
-                   cmm_profile_t *output_profile, 
-                   gsicc_rendering_param_t *rendering_params, gsicc_hashlink_t *hash);
-
-static gsicc_link_t* gsicc_findcachelink(gsicc_hashlink_t hashcode,gsicc_link_cache_t *icc_link_cache, 
-                                   bool includes_proof);
-
-static gsicc_link_t* gsicc_find_zeroref_cache(gsicc_link_cache_t *icc_link_cache);
-
-static void gsicc_remove_link(gsicc_link_t *link, gs_memory_t *memory);
-
-static void gsicc_get_buff_hash(unsigned char *data, int64_t *hash, unsigned int num_bytes);
-
-static void rc_gsicc_link_cache_free(gs_memory_t * mem, void *ptr_in, client_name_t cname);
-
-/* Structure pointer information */
-
-
-
-gs_private_st_ptrs4(st_icc_link, gsicc_link_t, "gsiccmanage_link",
-		    icc_link_enum_ptrs, icc_link_reloc_ptrs,
-		    contextptr, icc_link_cache, next, wait);
-
-
-gs_private_st_ptrs3(st_icc_linkcache, gsicc_link_cache_t, "gsiccmanage_linkcache",
-		    icc_linkcache_enum_ptrs, icc_linkcache_reloc_ptrs,
-		    head, lock, wait);
-
-/**
- * gsicc_cache_new: Allocate a new ICC cache manager
- * Return value: Pointer to allocated manager, or NULL on failure.
- **/
-
-gsicc_link_cache_t *
-gsicc_cache_new(gs_memory_t *memory)
-{
-    gsicc_link_cache_t *result;
-
-    /* We want this to be maintained in stable_memory.  It should be be effected by the 
-       save and restores */
-    result = gs_alloc_struct(memory->stable_memory, gsicc_link_cache_t, &st_icc_linkcache,
-			     "gsicc_cache_new");
-    if ( result == NULL )
-        return(NULL);
-    result->lock = gx_monitor_alloc(memory->stable_memory);
-    result->wait = gx_semaphore_alloc(memory->stable_memory);
-    if (result->lock == NULL || result->wait == NULL) {
-	gs_free_object(memory->stable_memory, result, "gsicc_cache_new");
-	return(NULL);
-    }
-    result->num_waiting = 0;
-    rc_init_free(result, memory->stable_memory, 1, rc_gsicc_link_cache_free);
-    result->head = NULL;
-    result->num_links = 0;
-    result->memory = memory->stable_memory;
-    return(result);
-}
-
-static void
-rc_gsicc_link_cache_free(gs_memory_t * mem, void *ptr_in, client_name_t cname)
-{
-    /* Ending the entire cache.  The ref counts on all the links should be 0 */
-    gsicc_link_cache_t *link_cache = (gsicc_link_cache_t * ) ptr_in;
-
-    while (link_cache->head != NULL) {
-        gsicc_remove_link(link_cache->head, mem);
-        link_cache->num_links--;
-    }
-#ifdef DEBUG
-    if (link_cache->num_links != 0) {
-	eprintf1("num_links is %d, should be 0.\n", link_cache->num_links);
-    }
-#endif
-    gs_free_object(mem->stable_memory, link_cache->lock, "rc_gsicc_link_cache_free(lock)");
-    gs_free_object(mem->stable_memory, link_cache->wait, "rc_gsicc_link_cache_free(wait)");
-    gs_free_object(mem->stable_memory, link_cache, "rc_gsicc_link_cache_free");
-}
-
-static gsicc_link_t *
-gsicc_alloc_link(gs_memory_t *memory, gsicc_hashlink_t hashcode)
-{
-    gsicc_link_t *result;
-    gx_semaphore_t *wait;
-
-    /* The link has to be added in stable memory. We want them
-       to be maintained across the gsave and grestore process */
-    result = gs_alloc_struct(memory->stable_memory, gsicc_link_t, &st_icc_link,
-			     "gsicc_alloc_link");
-    wait = gx_semaphore_alloc(memory->stable_memory);
-    if (wait == NULL) {
-	gs_free_object(memory, result, "gsicc_alloc_link(wait)");
-	result = NULL;
-    }
-    if (result != NULL) {
-	/* set up placeholder values */
-	result->next = NULL;
-	result->contextptr = NULL;
-	result->link_handle = NULL;
-	result->hashcode.link_hashcode = hashcode.link_hashcode;
-	result->hashcode.des_hash = 0;
-	result->hashcode.src_hash = 0;
-	result->hashcode.rend_hash = 0;
-	result->ref_count = 1;		/* prevent it from being freed */
-	result->includes_softproof = 0;
-	result->is_identity = false;
-	result->valid = false;		/* not yet complete */
-	result->num_waiting = 0;
-	result->wait = wait;
-    }
-    return(result);
-}
-
-static void
-gsicc_set_link_data(gsicc_link_t *icc_link, void *link_handle, void *contextptr, 
-               gsicc_hashlink_t hashcode, gx_monitor_t *lock)
-{
-    gx_monitor_enter(lock);		/* lock the cache while changing data */
-    icc_link->contextptr = contextptr;
-    icc_link->link_handle = link_handle;
-    icc_link->hashcode.link_hashcode = hashcode.link_hashcode;
-    icc_link->hashcode.des_hash = hashcode.des_hash;
-    icc_link->hashcode.src_hash = hashcode.src_hash;
-    icc_link->hashcode.rend_hash = hashcode.rend_hash;
-    icc_link->includes_softproof = 0;  /* Need to enable this at some point */
-    if ( hashcode.src_hash == hashcode.des_hash ) {
-        icc_link->is_identity = true;
-    } else {
-        icc_link->is_identity = false;
-    }
-    icc_link->valid = true;
-
-    /* Now release any tasks/threads waiting for these contents */
-    while (icc_link->num_waiting > 0) {
-	gx_semaphore_signal(icc_link->wait);
-	icc_link->num_waiting--;
-    }
-    gx_monitor_leave(lock);	/* done with updating, let everyone run */
-}
-
-static void
-gsicc_link_free(gsicc_link_t *icc_link, gs_memory_t *memory)
-{
-    gscms_release_link(icc_link);
-    gs_free_object(memory->stable_memory, icc_link->wait, "gsicc_link_free(wait)");
-    gs_free_object(memory->stable_memory, icc_link, "gsicc_link_free");
-}
-
-
-
-static void 
-gsicc_get_gscs_hash(gsicc_manager_t *icc_manager, gs_color_space *colorspace, int64_t *hash)
-{
-    /* There may be some work to do here with respect to pattern and indexed spaces */
-    const gs_color_space_type *pcst = colorspace->type;
-
-      switch(pcst->index) {
-	case gs_color_space_index_DeviceGray:
-            *hash =  icc_manager->default_gray->hashcode;
-            break;
-	case gs_color_space_index_DeviceRGB:				
-            *hash =  icc_manager->default_rgb->hashcode;
-            break;
-        case gs_color_space_index_DeviceCMYK:				
-            *hash =  icc_manager->default_cmyk->hashcode;
-            break;
-	default:			
-	    break;
-    }  
-}
-
-static void
-gsicc_mash_hash(gsicc_hashlink_t *hash)
-{
-    hash->link_hashcode = (hash->des_hash) ^ (hash->rend_hash) ^ (hash->src_hash);
-}
-
-void 
-gsicc_get_icc_buff_hash(unsigned char *buffer, int64_t *hash, unsigned int buff_size)
-{
-    gsicc_get_buff_hash(buffer, hash, buff_size);
-}
-
-static void 
-gsicc_get_buff_hash(unsigned char *data, int64_t *hash, unsigned int num_bytes)
-{
-    gs_md5_state_t md5;
-    byte digest[16];
-    int k;
-    int64_t word1,word2,shift;
-
-   /* We could probably do something faster than this. But use this for now. */
-    gs_md5_init(&md5);
-    gs_md5_append(&md5, data, num_bytes);
-    gs_md5_finish(&md5, digest);
-
-    /* For now, xor this into 64 bit word */
-    word1 = 0;
-    word2 = 0;
-    shift = 0;
-
-    /* need to do it this way because of 
-       potential word boundary issues */
-    for( k = 0; k<8; k++) {
-       word1 += ((int64_t) digest[k]) << shift;
-       word2 += ((int64_t) digest[k+8]) << shift;
-       shift += 8;
-    }
-    *hash = word1 ^ word2; 
-}
-
-/* Compute a hash code for the current transformation case.
-    This just computes a 64bit xor of upper and lower portions of
-    md5 for the input, output
-    and rendering params structure.  We may change this later */
-
-static void
-gsicc_compute_linkhash(gsicc_manager_t *icc_manager, cmm_profile_t *input_profile, 
-                   cmm_profile_t *output_profile, 
-                   gsicc_rendering_param_t *rendering_params, gsicc_hashlink_t *hash)
-{
-   /* first get the hash codes for the color spaces */
-    gsicc_get_cspace_hash(icc_manager, input_profile, &(hash->src_hash));
-    gsicc_get_cspace_hash(icc_manager, output_profile, &(hash->des_hash));
-
-    /* now for the rendering paramaters */
-    gsicc_get_buff_hash((unsigned char *) rendering_params, &(hash->rend_hash),
-			sizeof(gsicc_rendering_param_t));
-
-   /* for now, mash all of these into a link hash */
-   gsicc_mash_hash(hash);
-}
-
-static void
-gsicc_get_cspace_hash(gsicc_manager_t *icc_manager, cmm_profile_t *cmm_icc_profile_data, int64_t *hash)
-{
-    if (cmm_icc_profile_data == NULL ) {
-        *hash = icc_manager->device_profile->hashcode;
-        return;
-    }
-    if (cmm_icc_profile_data->hash_is_valid ) {
-        *hash = cmm_icc_profile_data->hashcode;
-        return;
-    } else {
-        /* We need to compute for this color space */
-        gsicc_get_icc_buff_hash(cmm_icc_profile_data->buffer, hash,
-				cmm_icc_profile_data->buffer_size);
-        cmm_icc_profile_data->hashcode = *hash;
-        cmm_icc_profile_data->hash_is_valid = true;
-        return;
-    }
-}
-
-static gsicc_link_t*
-gsicc_findcachelink(gsicc_hashlink_t hash, gsicc_link_cache_t *icc_link_cache, bool includes_proof)
-{
-    gsicc_link_t *curr, *prev;
-    int64_t hashcode = hash.link_hashcode;
-
-    /* Look through the cache for the hashcode */
-    gx_monitor_enter(icc_link_cache->lock);
-
-    /* List scanning is fast, so we scan the entire list, this includes   */
-    /* links that are currently unused, but still in the cache (zero_ref) */
-    curr = icc_link_cache->head;
-    prev = NULL;
-
-    while (curr != NULL ) {
-        if (curr->hashcode.link_hashcode == hashcode && includes_proof == curr->includes_softproof) {
-	    /* move this one to the front of the list hoping we will use it again soon */
-	    if (prev != NULL) {		/* if prev == NULL, curr is already the head */
-		prev->next = curr->next;
-		curr->next = icc_link_cache->head;
-		icc_link_cache->head = curr;
-	    }
-	    curr->ref_count++;		/* bump the ref_count since we will be using this one */
-	    while (curr->valid == false) {
-		curr->num_waiting++;
-	    	gx_monitor_leave(icc_link_cache->lock);
-		gx_semaphore_wait(curr->wait);
-    		gx_monitor_enter(icc_link_cache->lock);	/* re-enter breifly */
-	    }
-	    gx_monitor_leave(icc_link_cache->lock);
-            return(curr);	/* success */
-        }
-	prev = curr;
-        curr = curr->next;
-    }
-    gx_monitor_leave(icc_link_cache->lock);
-    return(NULL);
-}
-
-/* Find entry with zero ref count and remove it */
-/* lock the cache during this time for multi-threaded case */
-/* This may release links waiting for an icc_link_cache slot */
-static gsicc_link_t*
-gsicc_find_zeroref_cache(gsicc_link_cache_t *icc_link_cache)
-{
-    gsicc_link_t *curr = NULL;
-
-    /* Look through the cache for first zero ref count */
-    /* when ref counts go to zero, the icc_link is moved to the */
-    /* end of the list, so the first we find is the 'oldest'.
-       If we get to the last entry we return NULL.  At that point
-       there are no slots available and the thread should be
-       put into a wait state.  Since most threads have at most 1 active
-       link at anyone time, this will not be an issue for a single-threaded
-       case. */
- 
-    curr = icc_link_cache->head;
-    while (curr != NULL ) {
-        if (curr->ref_count == 0) {
-	    curr->ref_count++;		/* we will use this one */
-	    break;
-        }
-        curr = curr->next;
-    }
-    return(curr);
-}
-
-/* Remove link from cache.  Notify CMS and free */
-static void
-gsicc_remove_link(gsicc_link_t *link, gs_memory_t *memory)
-{
-    gsicc_link_t *curr, *prev;
-    gsicc_link_cache_t *icc_link_cache = link->icc_link_cache;
-
-    /* NOTE: link->ref_count must be 0: assert ? */
-    gx_monitor_enter(icc_link_cache->lock);
-    curr = icc_link_cache->head;
-    prev = NULL;
-
-    while (curr != NULL ) {
-        if (curr == link) {
-	    /* remove this one from the list */
-	    if (prev == NULL) 
-		icc_link_cache->head = curr->next;
-	    else
-		prev->next = curr->next;
-            break;
-        }
-	prev = curr;
-        curr = curr->next;
-    }
-    /* if curr != link we didn't find it: assert ? */
-    gx_monitor_leave(icc_link_cache->lock);
-    gsicc_link_free(link, memory);	/* outside link */
-}
-
-gsicc_link_t* 
-gsicc_get_link(const gs_imager_state *pis, const gs_color_space  *input_colorspace, 
-                    gs_color_space *output_colorspace, 
-                    gsicc_rendering_param_t *rendering_params, gs_memory_t *memory, bool include_softproof)
-{
-    cmm_profile_t *gs_input_profile;
-    cmm_profile_t *gs_output_profile;
-
-    if ( input_colorspace->cmm_icc_profile_data == NULL ) {
-        /* Use default type */
-        gs_input_profile = gsicc_get_gscs_profile(input_colorspace, pis->icc_manager); 
-    } else {
-        gs_input_profile = input_colorspace->cmm_icc_profile_data;
-    }
-
-    if ( output_colorspace != NULL ) {
-        gs_output_profile = output_colorspace->cmm_icc_profile_data;
-    } else {
-        /* Use the device profile */
-        gs_output_profile = pis->icc_manager->device_profile;
-    }
-    return(gsicc_get_link_profile(pis, gs_input_profile, gs_output_profile, 
-                    rendering_params, memory, include_softproof));
-}
-
-/* This is the main function called to obtain a linked transform from the ICC cache
-   If the cache has the link ready, it will return it.  If not, it will request 
-   one from the CMS and then return it.  We may need to do some cache locking during
-   this process to avoid multi-threaded issues (e.g. someone deleting while someone
-   is updating a reference count) */
-
-gsicc_link_t* 
-gsicc_get_link_profile(gs_imager_state *pis, cmm_profile_t *gs_input_profile, 
-                    cmm_profile_t *gs_output_profile, 
-                    gsicc_rendering_param_t *rendering_params, gs_memory_t *memory, bool include_softproof)
-{
-    gsicc_hashlink_t hash;
-    gsicc_link_t *link, *found_link;
-    gcmmhlink_t link_handle = NULL;
-    void **contextptr = NULL;
-    gsicc_manager_t *icc_manager = pis->icc_manager; 
-    gsicc_link_cache_t *icc_link_cache = pis->icc_link_cache;
-    gs_memory_t *cache_mem = pis->icc_link_cache->memory;
-
-    gcmmhprofile_t *cms_input_profile;
-    gcmmhprofile_t *cms_output_profile;
-
-    /* First compute the hash code for the incoming case */
-    /* If the output color space is NULL we will use the device profile for the output color space */
-    gsicc_compute_linkhash(icc_manager, gs_input_profile, gs_output_profile, rendering_params, &hash);
-
-    /* Check the cache for a hit.  Need to check if softproofing was used */
-    found_link = gsicc_findcachelink(hash, icc_link_cache, include_softproof);
-    
-    /* Got a hit, return link (ref_count for the link was already bumped */
-    if (found_link != NULL) 
-        return(found_link);  /* TO FIX: We are really not going to want to have the members
-                          of this object visible outside gsiccmange */
-
-    /* If not, then lets create a new one if there is room or return NULL */
-    /* Caller will need to try later */
-
-    /* First see if we can add a link */
-    /* TODO: this should be based on memory usage, not just num_links */
-    gx_monitor_enter(icc_link_cache->lock);
-    while (icc_link_cache->num_links >= ICC_CACHE_MAXLINKS) {
-        /* If not, see if there is anything we can remove from cache. */
-	while ((link = gsicc_find_zeroref_cache(icc_link_cache)) == NULL) {
-	    icc_link_cache->num_waiting++;
-	    /* safe to unlock since above will make sure semaphore is signalled */
-	    gx_monitor_leave(icc_link_cache->lock);
-	    /* we get signalled (released from wait) when a link goes to zero ref */
-	    gx_semaphore_wait(icc_link_cache->wait);
-
-	    /* repeat the findcachelink to see if some other thread has	*/
-	    /*already started building the link	we need			*/
-	    found_link = gsicc_findcachelink(hash, icc_link_cache, include_softproof);
-    
-	    /* Got a hit, return link (ref_count for the link was already bumped */
-	    if (found_link != NULL) 
-		return(found_link);  /* TO FIX: We are really not going to want to have the members
-				  of this object visible outside gsiccmange */
-
-	    gx_monitor_enter(icc_link_cache->lock);	    /* restore the lock */
-	    /* we will re-test the num_links above while locked to insure */
-	    /* that some other thread didn't grab the slot and max us out */
-	}
-	/* Remove the zero ref_count link profile we found.		*/
-	/* Even if we remove this link, we may still be maxed out so	*/
-	/* the outermost 'while' will check to make sure some other	*/
-	/* thread did not grab the one we remove.			*/
-	gsicc_remove_link(link, cache_mem);
-        icc_link_cache->num_links--;
-    } 
-    /* insert an empty link that we will reserve so we */
-    /* can unlock while building the link contents     */
-    link = gsicc_alloc_link(cache_mem->stable_memory, hash);
-    link->icc_link_cache = icc_link_cache;
-    link->next = icc_link_cache->head;
-    icc_link_cache->head = link;
-    icc_link_cache->num_links++;
-    gx_monitor_leave(icc_link_cache->lock);	/* now that we own this link we can release */
-					/* the lock since it is not valid */
-
-    /* Now compute the link contents */
-    cms_input_profile = gs_input_profile->profile_handle;
-    if (cms_input_profile == NULL) {
-        if (gs_input_profile->buffer != NULL) {
-            cms_input_profile = 
-                gsicc_get_profile_handle_buffer(gs_input_profile->buffer,
-                                                gs_input_profile->buffer_size);
-            gs_input_profile->profile_handle = cms_input_profile;
-        } else {
-            /* See if we have a clist device pointer. */
-            if ( gs_input_profile->dev != NULL ) {
-                /* ICC profile should be in clist. This is
-                   the first call to it.  Note that the profiles are not 
-                   really shared amongst threads like the links are.  Hence
-                   the memory is for the local thread's chunk */
-                cms_input_profile = 
-                    gsicc_get_profile_handle_clist(gs_input_profile, memory);
-                gs_input_profile->profile_handle = cms_input_profile;
-            } else {
-                /* Cant create the link.  No profile present, 
-                   nor any defaults to use for this.  Really
-                   need to throw an error for this case. */
-		gsicc_remove_link(link, cache_mem);
-                icc_link_cache->num_links--;
-                return(NULL);
-            }
-        }
-    }
-  
-    cms_output_profile = gs_output_profile->profile_handle;
-    if (cms_output_profile == NULL) {
-        if (gs_output_profile->buffer != NULL) {
-            cms_input_profile = 
-                gsicc_get_profile_handle_buffer(gs_input_profile->buffer,
-                                                gs_input_profile->buffer_size);
-            gs_output_profile->profile_handle = cms_output_profile;
-        } else {
-              /* See if we have a clist device pointer. */
-            if ( gs_output_profile->dev != NULL ) {
-                /* ICC profile should be in clist. This is
-                   the first call to it. */
-                cms_output_profile = 
-                    gsicc_get_profile_handle_clist(gs_output_profile, cache_mem);
-                gs_output_profile->profile_handle = cms_output_profile;
-            } else {
-                /* Cant create the link.  No profile present, 
-                   nor any defaults to use for this.  Really
-                   need to throw an error for this case. */
-		gsicc_remove_link(link, cache_mem);
-                icc_link_cache->num_links--;
-                return(NULL);
-            }
-        }
-    }
-    link_handle = gscms_get_link(cms_input_profile, cms_output_profile, 
-                                    rendering_params);
-    if (link_handle != NULL) {
-	gsicc_set_link_data(link, link_handle, contextptr, hash, icc_link_cache->lock);
-    } else {
-	gsicc_remove_link(link, cache_mem);
-        icc_link_cache->num_links--;
-        return(NULL);
-    }
-    return(link);
-}
-
-/* The following is used to transform a named color value at a particular tint
-   value to the output device values.  This function is provided only as a
-   demonstration and will likely need to be altered and optimized for those wishing 
-   to perform full spot color look-up support.  
-   
-   The object used to perform the transformation is typically
-   a look-up table that contains the spot color name and a CIELAB value for
-   100% colorant (it could also contain device values in the table).  
-   It can be more complex where-by you have a 1-D lut that 
-   provides CIELAB values or direct device values as a function of tint.  In
-   such a case, the table would be interpolated to compute all possible tint values.  
-   If CIELAB values are provided, they can be pushed through the 
-   device profile using the CMM.  In this particular demonstration, we simply 
-   provide CIELAB for a few color names in the file 
-   toolbin/color/named_color/named_color_table.txt .
-   The tint value is used to scale the CIELAB value from 100% colorant to a D50
-   whitepoint.  The resulting CIELAB value is then pushed through the CMM to
-   obtain device values for the current device.  The file named_colors.pdf
-   which is in toolbin/color/named_color/ contains these
-   spot colors and will enable the user to see how the code behaves.  The named
-   color table is specified to ghostscript by the command line option
-   -sNamedProfile=./toolbin/color/named_color/named_color_table.txt (or with
-   full path name).  If it is desired to have ghostscript compiled with the
-   named color table, it can be placed in the iccprofiles directory and then
-   build ghostscript with COMPILE_INITS=1.  When specified the file contents
-   are pointed to by the buffer member variable of the device_named profile in
-   profile manager.  When the first call occurs in here, the contents of the
-   buffer are parsed and placed into a custom stucture that is pointed to by
-   the profile pointer.  Note that this pointer is not visible to the garbage
-   collector and should be allocated in non-gc memory as is demonstrated in
-   this sample.
-
-   Note that there are calls defined in gsicc_littlecms.c that will create link
-   transforms between Named Color ICC profiles and the output device.  Such
-   profiles are rarely used (at least I have not run across any yet) so the
-   code is currently not used.  Also note that for those serious about named
-   color support, a cache as well as efficient table-look-up methods would 
-   likely be important for performance.
-
-   Finally note that PANTONE is a registered trademark and PANTONE colors are a
-   licensed product of XRITE Inc. See http://www.pantone.com
-   for more information.  Licensees of Pantone color libraries or similar 
-   libraries should find it straight forward to interface.  Pantone names are
-   referred to in named_color_table.txt and contained in the file named_colors.pdf.
-
-   !!!!IT WILL BE NECESSARY TO PERFORM THE PROPER DEALLOCATION 
-       CLEAN-UP OF THE STRUCTURES WHEN rc_free_icc_profile OCCURS FOR THE NAMED 
-       COLOR PROFILE!!!!!!  
-
-*/
-
-/* Define the demo structure and function for named color look-up */
-
-typedef struct gsicc_namedcolor_s {
-    char *colorant_name;            /* The name */
-    unsigned int name_size;         /* size of name */
-    unsigned short lab[3];          /* CIELAB D50 values */
-} gsicc_namedcolor_t;
-
-typedef struct gsicc_namedcolortable_s {
-    gsicc_namedcolor_t *named_color;    /* The named color */
-    unsigned int number_entries;        /* The number of entries */
-} gsicc_namedcolortable_t;
-
-/* Support functions for parsing buffer */
-
-static int
-get_to_next_line(unsigned char **buffptr, int *buffer_count) 
-{
-    while (1) {
-        if (**buffptr == ';') {
-            (*buffptr)++;
-            (*buffer_count)--;
-            return(0);
-        } else {
-            (*buffptr)++;
-            (*buffer_count)--;
-        }
-        if (*buffer_count <= 0) {
-            return -1;
-        }
-    }
-}
-
-/* Function returns -1 if name not found.  Otherwise transform the color. */
-int
-gsicc_transform_named_color(float tint_value, byte *color_name, uint name_size,
-                            gx_color_value device_values[], 
-                            const gs_imager_state *pis, 
-                            cmm_profile_t *gs_output_profile, 
-                            gsicc_rendering_param_t *rendering_params, 
-                            bool include_softproof)
-{
-
-    gsicc_namedcolor_t *namedcolor_data;
-    unsigned int num_entries;
-    cmm_profile_t *named_profile;
-    gsicc_namedcolortable_t *namedcolor_table;
-    int k,j;
-    float lab[3];
-    const char *buffptr;
-    int buffer_count;
-    int count;
-    int code;
-    char *pch, *temp_ptr;
-    bool done;
-    int curr_name_size;
-    bool found_match;
-    unsigned short psrc[GS_CLIENT_COLOR_MAX_COMPONENTS];
-    unsigned short psrc_cm[GS_CLIENT_COLOR_MAX_COMPONENTS];
-    unsigned short *psrc_temp;
-    float temp;
-    unsigned short white_lab[3] = {65535, 32767, 32767};
-    gsicc_link_t *icc_link;
-    cmm_profile_t *curr_output_profile;
-
-    /* Check if the data that we have has already been generated. */
-    if (pis->icc_manager != NULL) {
-        if (pis->icc_manager->device_named != NULL) {
-            named_profile = pis->icc_manager->device_named;
-            if (named_profile->buffer != NULL && 
-                named_profile->profile_handle == NULL) {
-                /* Create the structure that we will use in searching */
-                /*  Note that we do this in non-GC memory since the
-                    profile pointer is not GC'd */
-                namedcolor_table = 
-                    (gsicc_namedcolortable_t*) gs_malloc(pis->memory->stable_memory, 1, 
-                                                    sizeof(gsicc_namedcolortable_t),
-                                                    "gsicc_transform_named_color");
-                if (namedcolor_table == NULL) return(-1);
-                /* Parse buffer and load the structure we will be searching */
-                buffptr = (const char*) named_profile->buffer;
-                buffer_count = named_profile->buffer_size;
-                count = sscanf(buffptr,"%d",&num_entries);
-                if (num_entries < 1 || count == 0) {
-                    gs_free(pis->memory, namedcolor_table, 1, 
-                            sizeof(gsicc_namedcolortable_t),
-                            "gsicc_transform_named_color");
-                    return (-1);
-                }
-                code = get_to_next_line(&buffptr,&buffer_count);
-                if (code < 0) {
-                    gs_free(pis->memory, 
-                            namedcolor_table, 1, 
-                            sizeof(gsicc_namedcolortable_t),
-                            "gsicc_transform_named_color");
-                    return (-1);
-                }
-                namedcolor_data = 
-                    (gsicc_namedcolor_t*) gs_malloc(pis->memory->stable_memory, num_entries, 
-                                                    sizeof(gsicc_namedcolor_t),
-                                                    "gsicc_transform_named_color");
-                if (namedcolor_data == NULL) {
-                    gs_free(pis->memory, namedcolor_table, 1, 
-                            sizeof(gsicc_namedcolortable_t),
-                            "gsicc_transform_named_color");
-                    return (-1);
-                }
-                namedcolor_table->number_entries = num_entries;
-                namedcolor_table->named_color = namedcolor_data;
-                for (k = 0; k < num_entries; k++) {
-                    if (k == 0) {
-                        pch = strtok(buffptr,",;");
-                    } else {
-                        pch = strtok(NULL,",;");
-                    }
-                    /* Remove any /0d /0a stuff from start */
-                    temp_ptr = pch;
-                    done = 0;
-                    while (!done) {
-                        if (*temp_ptr == 0x0d || *temp_ptr == 0x0a) {
-                            temp_ptr++;
-                        } else {
-                            done = 1;
-                        }
-                    }
-                    curr_name_size = strlen(temp_ptr);
-                    namedcolor_data[k].name_size = curr_name_size;
-                    /* +1 for the null */
-                    namedcolor_data[k].colorant_name = 
-                        (char*) gs_malloc(pis->memory->stable_memory,1,name_size+1,
-                                        "gsicc_transform_named_color");
-                    strncpy(namedcolor_data[k].colorant_name,temp_ptr,
-                            namedcolor_data[k].name_size+1);
-                    for (j = 0; j < 3; j++) {
-                        pch = strtok(NULL,",;");
-                        count = sscanf(pch,"%f",&(lab[j]));
-                    }
-                    lab[0] = lab[0]*65535/100.0;
-                    lab[1] = (lab[1] + 128.0)*65535/255;
-                    lab[2] = (lab[2] + 128.0)*65535/255;
-                    for (j = 0; j < 3; j++) {
-                        if (lab[j] > 65535) lab[j] = 65535;
-                        if (lab[j] < 0) lab[j] = 0;
-                        namedcolor_data[k].lab[j] = (unsigned short) lab[j];
-                    }
-                    if (code < 0) {
-                        gs_free(pis->memory, namedcolor_table, 1, 
-                                sizeof(gsicc_namedcolortable_t),
-                                "gsicc_transform_named_color");
-                        gs_free(pis->memory, namedcolor_data, num_entries, 
-                                sizeof(gsicc_namedcolordata_t),
-                                "gsicc_transform_named_color");
-                        return (-1);
-                    }
-                }
-                /* Assign to the profile pointer */
-                named_profile->profile_handle = namedcolor_table;
-            } else {
-                if (named_profile->profile_handle != NULL ) {
-                    namedcolor_table = 
-                        (gsicc_namedcolortable_t*) named_profile->profile_handle;
-                   num_entries = namedcolor_table->number_entries;
-                } else {
-                    return(-1);
-                }
-            }
-            /* Search our structure for the color name */
-            found_match = false;
-            for (k = 0; k < num_entries; k++) {
-                if (name_size == namedcolor_table->named_color[k].name_size) {
-                    if( strncmp((const char *) namedcolor_table->named_color[k].colorant_name,
-                        (const char *) color_name, name_size) == 0) {
-                            found_match = true;
-                            break;
-                    }
-                }
-            }
-            if (found_match) {
-                /* Apply tint and push through CMM */
-                for (j = 0; j < 3; j++) {
-                    temp = (float) namedcolor_table->named_color[k].lab[j] * tint_value
-                            + (float) white_lab[j] * (1.0 - tint_value);
-                    psrc[j] = (unsigned short) temp;
-                }
-                if ( gs_output_profile != NULL ) {
-                    curr_output_profile = gs_output_profile;
-                } else {
-                    /* Use the device profile */
-                    curr_output_profile = pis->icc_manager->device_profile;
-                }
-                icc_link = gsicc_get_link_profile(pis, pis->icc_manager->lab_profile, 
-                                                    curr_output_profile, rendering_params, 
-                                                    pis->memory, false);
-                if (icc_link->is_identity) {
-                    psrc_temp = &(psrc[0]);
-                } else {
-                    /* Transform the color */
-                    psrc_temp = &(psrc_cm[0]);
-                    gscms_transform_color(icc_link, psrc, psrc_temp, 2, NULL);
-                }
-                gsicc_release_link(icc_link);
-                for ( k = 0; k < curr_output_profile->num_comps; k++){
-                    device_values[k] = psrc_temp[k];
-                }
-                return(0);
-            } else {
-                return (-1);
-            }
-        }
-    }
-    return(-1);
-}
-
-/* Used by gs to notify the ICC manager that we are done with this link for now */
-/* This may release elements waiting on a icc_link_cache slot */
-void 
-gsicc_release_link(gsicc_link_t *icclink)
-{
-    gsicc_link_cache_t *icc_link_cache = icclink->icc_link_cache;
-
-    gx_monitor_enter(icc_link_cache->lock);
-    /* Decrement the reference count */
-    if (--(icclink->ref_count) == 0) {
-
-	gsicc_link_t *curr, *prev;
-
-
-	/* Find link in cache, and move it to the end of the list.  */
-	/* This way zero ref_count links are found LRU first	*/
-	curr = icc_link_cache->head;
-	prev = NULL;
-	while (curr != icclink) {
-	    prev = curr;
-	    curr = curr->next;
-	};
-	if (prev == NULL) {
-	    /* this link was the head */
-	    icc_link_cache->head = curr->next;
-	} else {
-	    prev->next = curr->next;		/* de-link this one */
-	}
-	/* Find the first zero-ref entry on the list */
-	curr = icc_link_cache->head;
-	prev = NULL;
-	while (curr != NULL && curr->ref_count > 0) {
-	    prev = curr;
-	    curr = curr->next;
-	}
-	/* Found where to link this one into the tail of the list */
-	if (prev == NULL) {
-	    icc_link_cache->head = icclink;
-	    icclink->next = icc_link_cache->head->next;
-	} else {
-	    /* link this one in here */
-	    prev->next = icclink;	
-	    icclink->next = curr;
-	}
-
-	/* now release any tasks waiting for a cache slot */
-        while (icclink->icc_link_cache->num_waiting > 0) {
-	    gx_semaphore_signal(icclink->icc_link_cache->wait);
-	    icclink->icc_link_cache->num_waiting--;
-        }
-    }
-    gx_monitor_leave(icc_link_cache->lock);
-}
-
-/* Used to initialize the buffer description prior to color conversion */
-
-void
-gsicc_init_buffer(gsicc_bufferdesc_t *buffer_desc, unsigned char num_chan, unsigned char bytes_per_chan,
-                  bool has_alpha, bool alpha_first, bool is_planar, int plane_stride, int row_stride,
-                  int num_rows, int pixels_per_row)
-{
-    buffer_desc->num_chan = num_chan;
-    buffer_desc->bytes_per_chan = bytes_per_chan;
-    buffer_desc->has_alpha = has_alpha;
-    buffer_desc->alpha_first = alpha_first;
-    buffer_desc->is_planar = is_planar;
-    buffer_desc->plane_stride = plane_stride;
-    buffer_desc->row_stride = row_stride;
-    buffer_desc->num_rows = num_rows;
-    buffer_desc->pixels_per_row = pixels_per_row; 
-
-#if arch_is_big_endian
-    buffer_desc->little_endian = false;
-#else
-    buffer_desc->little_endian = true;
-#endif
-
-}
-
+/* Copyright (C) 2001-2009 Artifex Software, Inc.
+   All Rights Reserved.
+  
+   This software is provided AS-IS with no warranty, either express or
+   implied.
+
+   This software is distributed under license and may not be copied, modified
+   or distributed except as expressly authorized under the terms of that
+   license.  Refer to licensing information at http://www.artifex.com/
+   or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
+   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
+*/
+/*  GS ICC link cache.  Initial stubbing of functions.  */
+
+#include "std.h"
+#include "stdpre.h"
+#include "gstypes.h"
+#include "gsmemory.h"
+#include "gsstruct.h"  
+#include "scommon.h"
+#include "gx.h"
+#include "gxistate.h"
+#include "smd5.h" 
+#include "gscms.h"
+#include "gsicc_littlecms.h" 
+#include "gsicc_manage.h"
+#include "gsicc_cache.h"
+#include "gserrors.h"
+#include "gsmalloc.h" /* Needed for named color structure allocation */
+#include "string_.h"  /* Needed for named color structure allocation */
+#include "gxsync.h"
+#include "gzstate.h"
+        /*
+	 *  Note that the the external memory used to maintain 
+         *  links in the CMS is generally not visible to GS.  
+         *  For most CMS's the  links are 33x33x33x33x4 bytes at worst 
+         *  for a CMYK to CMYK MLUT which is about 4.5Mb per link.
+         *  If the link were matrix based it would be much much smaller.
+         *  We will likely want to do at least have an estimate of the 
+         *  memory used based upon how the CMS is configured.
+         *  This will be done later.  For now, just limit the number
+         *  of links.
+	 */
+#define ICC_CACHE_MAXLINKS 50
+
+/* Static prototypes */
+
+
+static gsicc_link_t * gsicc_alloc_link(gs_memory_t *memory, gsicc_hashlink_t hashcode);
+
+static void gsicc_link_free(gsicc_link_t *icc_link, gs_memory_t *memory);
+
+static void gsicc_get_cspace_hash(gsicc_manager_t *icc_manager, gx_device *dev, 
+                                  cmm_profile_t *profile, int64_t *hash);
+
+static void gsicc_compute_linkhash(gsicc_manager_t *icc_manager, gx_device *dev, 
+                                   cmm_profile_t *input_profile, 
+                                   cmm_profile_t *output_profile, 
+                                   gsicc_rendering_param_t *rendering_params, 
+                                   gsicc_hashlink_t *hash);
+
+static gsicc_link_t* gsicc_findcachelink(gsicc_hashlink_t hashcode,gsicc_link_cache_t *icc_link_cache, 
+                                   bool includes_proof);
+
+static gsicc_link_t* gsicc_find_zeroref_cache(gsicc_link_cache_t *icc_link_cache);
+
+static void gsicc_remove_link(gsicc_link_t *link, gs_memory_t *memory);
+
+static void gsicc_get_buff_hash(unsigned char *data, int64_t *hash, unsigned int num_bytes);
+
+static void rc_gsicc_link_cache_free(gs_memory_t * mem, void *ptr_in, client_name_t cname);
+
+/* Structure pointer information */
+
+
+
+gs_private_st_ptrs4(st_icc_link, gsicc_link_t, "gsiccmanage_link",
+		    icc_link_enum_ptrs, icc_link_reloc_ptrs,
+		    contextptr, icc_link_cache, next, wait);
+
+
+gs_private_st_ptrs3(st_icc_linkcache, gsicc_link_cache_t, "gsiccmanage_linkcache",
+		    icc_linkcache_enum_ptrs, icc_linkcache_reloc_ptrs,
+		    head, lock, wait);
+
+/**
+ * gsicc_cache_new: Allocate a new ICC cache manager
+ * Return value: Pointer to allocated manager, or NULL on failure.
+ **/
+
+gsicc_link_cache_t *
+gsicc_cache_new(gs_memory_t *memory)
+{
+    gsicc_link_cache_t *result;
+
+    /* We want this to be maintained in stable_memory.  It should be be effected by the 
+       save and restores */
+    result = gs_alloc_struct(memory->stable_memory, gsicc_link_cache_t, &st_icc_linkcache,
+			     "gsicc_cache_new");
+    if ( result == NULL )
+        return(NULL);
+    result->lock = gx_monitor_alloc(memory->stable_memory);
+    result->wait = gx_semaphore_alloc(memory->stable_memory);
+    if (result->lock == NULL || result->wait == NULL) {
+	gs_free_object(memory->stable_memory, result, "gsicc_cache_new");
+	return(NULL);
+    }
+    result->num_waiting = 0;
+    rc_init_free(result, memory->stable_memory, 1, rc_gsicc_link_cache_free);
+    result->head = NULL;
+    result->num_links = 0;
+    result->memory = memory->stable_memory;
+    return(result);
+}
+
+static void
+rc_gsicc_link_cache_free(gs_memory_t * mem, void *ptr_in, client_name_t cname)
+{
+    /* Ending the entire cache.  The ref counts on all the links should be 0 */
+    gsicc_link_cache_t *link_cache = (gsicc_link_cache_t * ) ptr_in;
+
+    while (link_cache->head != NULL) {
+        gsicc_remove_link(link_cache->head, mem);
+        link_cache->num_links--;
+    }
+#ifdef DEBUG
+    if (link_cache->num_links != 0) {
+	eprintf1("num_links is %d, should be 0.\n", link_cache->num_links);
+    }
+#endif
+    gs_free_object(mem->stable_memory, link_cache->lock, "rc_gsicc_link_cache_free(lock)");
+    gs_free_object(mem->stable_memory, link_cache->wait, "rc_gsicc_link_cache_free(wait)");
+    gs_free_object(mem->stable_memory, link_cache, "rc_gsicc_link_cache_free");
+}
+
+static gsicc_link_t *
+gsicc_alloc_link(gs_memory_t *memory, gsicc_hashlink_t hashcode)
+{
+    gsicc_link_t *result;
+    gx_semaphore_t *wait;
+
+    /* The link has to be added in stable memory. We want them
+       to be maintained across the gsave and grestore process */
+    result = gs_alloc_struct(memory->stable_memory, gsicc_link_t, &st_icc_link,
+			     "gsicc_alloc_link");
+    wait = gx_semaphore_alloc(memory->stable_memory);
+    if (wait == NULL) {
+	gs_free_object(memory, result, "gsicc_alloc_link(wait)");
+	result = NULL;
+    }
+    if (result != NULL) {
+	/* set up placeholder values */
+	result->next = NULL;
+	result->contextptr = NULL;
+	result->link_handle = NULL;
+	result->hashcode.link_hashcode = hashcode.link_hashcode;
+	result->hashcode.des_hash = 0;
+	result->hashcode.src_hash = 0;
+	result->hashcode.rend_hash = 0;
+	result->ref_count = 1;		/* prevent it from being freed */
+	result->includes_softproof = 0;
+	result->is_identity = false;
+	result->valid = false;		/* not yet complete */
+	result->num_waiting = 0;
+	result->wait = wait;
+    }
+    return(result);
+}
+
+static void
+gsicc_set_link_data(gsicc_link_t *icc_link, void *link_handle, void *contextptr, 
+               gsicc_hashlink_t hashcode, gx_monitor_t *lock)
+{
+    gx_monitor_enter(lock);		/* lock the cache while changing data */
+    icc_link->contextptr = contextptr;
+    icc_link->link_handle = link_handle;
+    icc_link->hashcode.link_hashcode = hashcode.link_hashcode;
+    icc_link->hashcode.des_hash = hashcode.des_hash;
+    icc_link->hashcode.src_hash = hashcode.src_hash;
+    icc_link->hashcode.rend_hash = hashcode.rend_hash;
+    icc_link->includes_softproof = 0;  /* Need to enable this at some point */
+    if ( hashcode.src_hash == hashcode.des_hash ) {
+        icc_link->is_identity = true;
+    } else {
+        icc_link->is_identity = false;
+    }
+    icc_link->valid = true;
+
+    /* Now release any tasks/threads waiting for these contents */
+    while (icc_link->num_waiting > 0) {
+	gx_semaphore_signal(icc_link->wait);
+	icc_link->num_waiting--;
+    }
+    gx_monitor_leave(lock);	/* done with updating, let everyone run */
+}
+
+static void
+gsicc_link_free(gsicc_link_t *icc_link, gs_memory_t *memory)
+{
+    gscms_release_link(icc_link);
+    gs_free_object(memory->stable_memory, icc_link->wait, "gsicc_link_free(wait)");
+    gs_free_object(memory->stable_memory, icc_link, "gsicc_link_free");
+}
+
+
+
+static void 
+gsicc_get_gscs_hash(gsicc_manager_t *icc_manager, gs_color_space *colorspace, int64_t *hash)
+{
+    /* There may be some work to do here with respect to pattern and indexed spaces */
+    const gs_color_space_type *pcst = colorspace->type;
+
+      switch(pcst->index) {
+	case gs_color_space_index_DeviceGray:
+            *hash =  icc_manager->default_gray->hashcode;
+            break;
+	case gs_color_space_index_DeviceRGB:				
+            *hash =  icc_manager->default_rgb->hashcode;
+            break;
+        case gs_color_space_index_DeviceCMYK:				
+            *hash =  icc_manager->default_cmyk->hashcode;
+            break;
+	default:			
+	    break;
+    }  
+}
+
+static void
+gsicc_mash_hash(gsicc_hashlink_t *hash)
+{
+    hash->link_hashcode = (hash->des_hash) ^ (hash->rend_hash) ^ (hash->src_hash);
+}
+
+void 
+gsicc_get_icc_buff_hash(unsigned char *buffer, int64_t *hash, unsigned int buff_size)
+{
+    gsicc_get_buff_hash(buffer, hash, buff_size);
+}
+
+static void 
+gsicc_get_buff_hash(unsigned char *data, int64_t *hash, unsigned int num_bytes)
+{
+    gs_md5_state_t md5;
+    byte digest[16];
+    int k;
+    int64_t word1,word2,shift;
+
+   /* We could probably do something faster than this. But use this for now. */
+    gs_md5_init(&md5);
+    gs_md5_append(&md5, data, num_bytes);
+    gs_md5_finish(&md5, digest);
+
+    /* For now, xor this into 64 bit word */
+    word1 = 0;
+    word2 = 0;
+    shift = 0;
+
+    /* need to do it this way because of 
+       potential word boundary issues */
+    for( k = 0; k<8; k++) {
+       word1 += ((int64_t) digest[k]) << shift;
+       word2 += ((int64_t) digest[k+8]) << shift;
+       shift += 8;
+    }
+    *hash = word1 ^ word2; 
+}
+
+/* Compute a hash code for the current transformation case.
+    This just computes a 64bit xor of upper and lower portions of
+    md5 for the input, output
+    and rendering params structure.  We may change this later */
+
+static void
+gsicc_compute_linkhash(gsicc_manager_t *icc_manager, gx_device *dev,
+                       cmm_profile_t *input_profile, 
+                       cmm_profile_t *output_profile, 
+                       gsicc_rendering_param_t *rendering_params, 
+                       gsicc_hashlink_t *hash)
+{
+   /* first get the hash codes for the color spaces */
+    gsicc_get_cspace_hash(icc_manager, dev, input_profile, &(hash->src_hash));
+    gsicc_get_cspace_hash(icc_manager, dev, output_profile, &(hash->des_hash));
+
+    /* now for the rendering paramaters */
+    gsicc_get_buff_hash((unsigned char *) rendering_params, &(hash->rend_hash),
+			sizeof(gsicc_rendering_param_t));
+
+   /* for now, mash all of these into a link hash */
+   gsicc_mash_hash(hash);
+}
+
+static void
+gsicc_get_cspace_hash(gsicc_manager_t *icc_manager, gx_device *dev, 
+                      cmm_profile_t *cmm_icc_profile_data, int64_t *hash)
+{
+    if (cmm_icc_profile_data == NULL ) {
+        *hash = dev->device_icc_profile->hashcode;
+        return;
+    }
+    if (cmm_icc_profile_data->hash_is_valid ) {
+        *hash = cmm_icc_profile_data->hashcode;
+        return;
+    } else {
+        /* We need to compute for this color space */
+        gsicc_get_icc_buff_hash(cmm_icc_profile_data->buffer, hash,
+				cmm_icc_profile_data->buffer_size);
+        cmm_icc_profile_data->hashcode = *hash;
+        cmm_icc_profile_data->hash_is_valid = true;
+        return;
+    }
+}
+
+static gsicc_link_t*
+gsicc_findcachelink(gsicc_hashlink_t hash, gsicc_link_cache_t *icc_link_cache, bool includes_proof)
+{
+    gsicc_link_t *curr, *prev;
+    int64_t hashcode = hash.link_hashcode;
+
+    /* Look through the cache for the hashcode */
+    gx_monitor_enter(icc_link_cache->lock);
+
+    /* List scanning is fast, so we scan the entire list, this includes   */
+    /* links that are currently unused, but still in the cache (zero_ref) */
+    curr = icc_link_cache->head;
+    prev = NULL;
+
+    while (curr != NULL ) {
+        if (curr->hashcode.link_hashcode == hashcode && includes_proof == curr->includes_softproof) {
+	    /* move this one to the front of the list hoping we will use it again soon */
+	    if (prev != NULL) {		/* if prev == NULL, curr is already the head */
+		prev->next = curr->next;
+		curr->next = icc_link_cache->head;
+		icc_link_cache->head = curr;
+	    }
+	    curr->ref_count++;		/* bump the ref_count since we will be using this one */
+	    while (curr->valid == false) {
+		curr->num_waiting++;
+	    	gx_monitor_leave(icc_link_cache->lock);
+		gx_semaphore_wait(curr->wait);
+    		gx_monitor_enter(icc_link_cache->lock);	/* re-enter breifly */
+	    }
+	    gx_monitor_leave(icc_link_cache->lock);
+            return(curr);	/* success */
+        }
+	prev = curr;
+        curr = curr->next;
+    }
+    gx_monitor_leave(icc_link_cache->lock);
+    return(NULL);
+}
+
+/* Find entry with zero ref count and remove it */
+/* lock the cache during this time for multi-threaded case */
+/* This may release links waiting for an icc_link_cache slot */
+static gsicc_link_t*
+gsicc_find_zeroref_cache(gsicc_link_cache_t *icc_link_cache)
+{
+    gsicc_link_t *curr = NULL;
+
+    /* Look through the cache for first zero ref count */
+    /* when ref counts go to zero, the icc_link is moved to the */
+    /* end of the list, so the first we find is the 'oldest'.
+       If we get to the last entry we return NULL.  At that point
+       there are no slots available and the thread should be
+       put into a wait state.  Since most threads have at most 1 active
+       link at anyone time, this will not be an issue for a single-threaded
+       case. */
+ 
+    curr = icc_link_cache->head;
+    while (curr != NULL ) {
+        if (curr->ref_count == 0) {
+	    curr->ref_count++;		/* we will use this one */
+	    break;
+        }
+        curr = curr->next;
+    }
+    return(curr);
+}
+
+/* Remove link from cache.  Notify CMS and free */
+static void
+gsicc_remove_link(gsicc_link_t *link, gs_memory_t *memory)
+{
+    gsicc_link_t *curr, *prev;
+    gsicc_link_cache_t *icc_link_cache = link->icc_link_cache;
+
+    /* NOTE: link->ref_count must be 0: assert ? */
+    gx_monitor_enter(icc_link_cache->lock);
+    curr = icc_link_cache->head;
+    prev = NULL;
+
+    while (curr != NULL ) {
+        if (curr == link) {
+	    /* remove this one from the list */
+	    if (prev == NULL) 
+		icc_link_cache->head = curr->next;
+	    else
+		prev->next = curr->next;
+            break;
+        }
+	prev = curr;
+        curr = curr->next;
+    }
+    /* if curr != link we didn't find it: assert ? */
+    gx_monitor_leave(icc_link_cache->lock);
+    gsicc_link_free(link, memory);	/* outside link */
+}
+
+gsicc_link_t* 
+gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in, 
+               const gs_color_space  *input_colorspace, 
+               gs_color_space *output_colorspace, 
+               gsicc_rendering_param_t *rendering_params, 
+               gs_memory_t *memory, bool include_softproof)
+{
+    cmm_profile_t *gs_input_profile;
+    cmm_profile_t *gs_output_profile;
+    gs_state *pgs;
+    gx_device *dev;
+
+    if (dev_in == NULL) {
+        /* Get from the imager state which is going to be a graphic state.
+           This only occurs for the other (non-ps/pdf) interpreters */
+        pgs = (gs_state*) pis;
+        dev = pgs->device;
+    } else {
+        dev = dev_in;
+    }
+
+    if ( input_colorspace->cmm_icc_profile_data == NULL ) {
+        /* Use default type */
+        gs_input_profile = gsicc_get_gscs_profile(input_colorspace, pis->icc_manager); 
+    } else {
+        gs_input_profile = input_colorspace->cmm_icc_profile_data;
+    }
+
+    if ( output_colorspace != NULL ) {
+        gs_output_profile = output_colorspace->cmm_icc_profile_data;
+    } else {
+        /* Use the device profile */
+        gs_output_profile = dev->device_icc_profile;
+    }
+    return(gsicc_get_link_profile(pis, dev, gs_input_profile, gs_output_profile, 
+                    rendering_params, memory, include_softproof));
+}
+
+/* This is the main function called to obtain a linked transform from the ICC cache
+   If the cache has the link ready, it will return it.  If not, it will request 
+   one from the CMS and then return it.  We may need to do some cache locking during
+   this process to avoid multi-threaded issues (e.g. someone deleting while someone
+   is updating a reference count) */
+
+gsicc_link_t* 
+gsicc_get_link_profile(gs_imager_state *pis, gx_device *dev, 
+                       cmm_profile_t *gs_input_profile, 
+                       cmm_profile_t *gs_output_profile, 
+                       gsicc_rendering_param_t *rendering_params, 
+                       gs_memory_t *memory, bool include_softproof)
+{
+    gsicc_hashlink_t hash;
+    gsicc_link_t *link, *found_link;
+    gcmmhlink_t link_handle = NULL;
+    void **contextptr = NULL;
+    gsicc_manager_t *icc_manager = pis->icc_manager; 
+    gsicc_link_cache_t *icc_link_cache = pis->icc_link_cache;
+    gs_memory_t *cache_mem = pis->icc_link_cache->memory;
+
+    gcmmhprofile_t *cms_input_profile;
+    gcmmhprofile_t *cms_output_profile;
+
+    /* First compute the hash code for the incoming case */
+    /* If the output color space is NULL we will use the device profile for the output color space */
+    gsicc_compute_linkhash(icc_manager, dev, gs_input_profile, gs_output_profile, 
+                            rendering_params, &hash);
+
+    /* Check the cache for a hit.  Need to check if softproofing was used */
+    found_link = gsicc_findcachelink(hash, icc_link_cache, include_softproof);
+    
+    /* Got a hit, return link (ref_count for the link was already bumped */
+    if (found_link != NULL) 
+        return(found_link);  /* TO FIX: We are really not going to want to have the members
+                          of this object visible outside gsiccmange */
+
+    /* If not, then lets create a new one if there is room or return NULL */
+    /* Caller will need to try later */
+
+    /* First see if we can add a link */
+    /* TODO: this should be based on memory usage, not just num_links */
+    gx_monitor_enter(icc_link_cache->lock);
+    while (icc_link_cache->num_links >= ICC_CACHE_MAXLINKS) {
+        /* If not, see if there is anything we can remove from cache. */
+	while ((link = gsicc_find_zeroref_cache(icc_link_cache)) == NULL) {
+	    icc_link_cache->num_waiting++;
+	    /* safe to unlock since above will make sure semaphore is signalled */
+	    gx_monitor_leave(icc_link_cache->lock);
+	    /* we get signalled (released from wait) when a link goes to zero ref */
+	    gx_semaphore_wait(icc_link_cache->wait);
+
+	    /* repeat the findcachelink to see if some other thread has	*/
+	    /*already started building the link	we need			*/
+	    found_link = gsicc_findcachelink(hash, icc_link_cache, include_softproof);
+    
+	    /* Got a hit, return link (ref_count for the link was already bumped */
+	    if (found_link != NULL) 
+		return(found_link);  /* TO FIX: We are really not going to want to have the members
+				  of this object visible outside gsiccmange */
+
+	    gx_monitor_enter(icc_link_cache->lock);	    /* restore the lock */
+	    /* we will re-test the num_links above while locked to insure */
+	    /* that some other thread didn't grab the slot and max us out */
+	}
+	/* Remove the zero ref_count link profile we found.		*/
+	/* Even if we remove this link, we may still be maxed out so	*/
+	/* the outermost 'while' will check to make sure some other	*/
+	/* thread did not grab the one we remove.			*/
+	gsicc_remove_link(link, cache_mem);
+        icc_link_cache->num_links--;
+    } 
+    /* insert an empty link that we will reserve so we */
+    /* can unlock while building the link contents     */
+    link = gsicc_alloc_link(cache_mem->stable_memory, hash);
+    link->icc_link_cache = icc_link_cache;
+    link->next = icc_link_cache->head;
+    icc_link_cache->head = link;
+    icc_link_cache->num_links++;
+    gx_monitor_leave(icc_link_cache->lock);	/* now that we own this link we can release */
+					/* the lock since it is not valid */
+
+    /* Now compute the link contents */
+    cms_input_profile = gs_input_profile->profile_handle;
+    if (cms_input_profile == NULL) {
+        if (gs_input_profile->buffer != NULL) {
+            cms_input_profile = 
+                gsicc_get_profile_handle_buffer(gs_input_profile->buffer,
+                                                gs_input_profile->buffer_size);
+            gs_input_profile->profile_handle = cms_input_profile;
+        } else {
+            /* See if we have a clist device pointer. */
+            if ( gs_input_profile->dev != NULL ) {
+                /* ICC profile should be in clist. This is
+                   the first call to it.  Note that the profiles are not 
+                   really shared amongst threads like the links are.  Hence
+                   the memory is for the local thread's chunk */
+                cms_input_profile = 
+                    gsicc_get_profile_handle_clist(gs_input_profile, memory);
+                gs_input_profile->profile_handle = cms_input_profile;
+            } else {
+                /* Cant create the link.  No profile present, 
+                   nor any defaults to use for this.  Really
+                   need to throw an error for this case. */
+		gsicc_remove_link(link, cache_mem);
+                icc_link_cache->num_links--;
+                return(NULL);
+            }
+        }
+    }
+  
+    cms_output_profile = gs_output_profile->profile_handle;
+    if (cms_output_profile == NULL) {
+        if (gs_output_profile->buffer != NULL) {
+            cms_input_profile = 
+                gsicc_get_profile_handle_buffer(gs_input_profile->buffer,
+                                                gs_input_profile->buffer_size);
+            gs_output_profile->profile_handle = cms_output_profile;
+        } else {
+              /* See if we have a clist device pointer. */
+            if ( gs_output_profile->dev != NULL ) {
+                /* ICC profile should be in clist. This is
+                   the first call to it. */
+                cms_output_profile = 
+                    gsicc_get_profile_handle_clist(gs_output_profile, cache_mem);
+                gs_output_profile->profile_handle = cms_output_profile;
+            } else {
+                /* Cant create the link.  No profile present, 
+                   nor any defaults to use for this.  Really
+                   need to throw an error for this case. */
+		gsicc_remove_link(link, cache_mem);
+                icc_link_cache->num_links--;
+                return(NULL);
+            }
+        }
+    }
+    link_handle = gscms_get_link(cms_input_profile, cms_output_profile, 
+                                    rendering_params);
+    if (link_handle != NULL) {
+	gsicc_set_link_data(link, link_handle, contextptr, hash, icc_link_cache->lock);
+    } else {
+	gsicc_remove_link(link, cache_mem);
+        icc_link_cache->num_links--;
+        return(NULL);
+    }
+    return(link);
+}
+
+/* The following is used to transform a named color value at a particular tint
+   value to the output device values.  This function is provided only as a
+   demonstration and will likely need to be altered and optimized for those wishing 
+   to perform full spot color look-up support.  
+   
+   The object used to perform the transformation is typically
+   a look-up table that contains the spot color name and a CIELAB value for
+   100% colorant (it could also contain device values in the table).  
+   It can be more complex where-by you have a 1-D lut that 
+   provides CIELAB values or direct device values as a function of tint.  In
+   such a case, the table would be interpolated to compute all possible tint values.  
+   If CIELAB values are provided, they can be pushed through the 
+   device profile using the CMM.  In this particular demonstration, we simply 
+   provide CIELAB for a few color names in the file 
+   toolbin/color/named_color/named_color_table.txt .
+   The tint value is used to scale the CIELAB value from 100% colorant to a D50
+   whitepoint.  The resulting CIELAB value is then pushed through the CMM to
+   obtain device values for the current device.  The file named_colors.pdf
+   which is in toolbin/color/named_color/ contains these
+   spot colors and will enable the user to see how the code behaves.  The named
+   color table is specified to ghostscript by the command line option
+   -sNamedProfile=./toolbin/color/named_color/named_color_table.txt (or with
+   full path name).  If it is desired to have ghostscript compiled with the
+   named color table, it can be placed in the iccprofiles directory and then
+   build ghostscript with COMPILE_INITS=1.  When specified the file contents
+   are pointed to by the buffer member variable of the device_named profile in
+   profile manager.  When the first call occurs in here, the contents of the
+   buffer are parsed and placed into a custom stucture that is pointed to by
+   the profile pointer.  Note that this pointer is not visible to the garbage
+   collector and should be allocated in non-gc memory as is demonstrated in
+   this sample.
+
+   Note that there are calls defined in gsicc_littlecms.c that will create link
+   transforms between Named Color ICC profiles and the output device.  Such
+   profiles are rarely used (at least I have not run across any yet) so the
+   code is currently not used.  Also note that for those serious about named
+   color support, a cache as well as efficient table-look-up methods would 
+   likely be important for performance.
+
+   Finally note that PANTONE is a registered trademark and PANTONE colors are a
+   licensed product of XRITE Inc. See http://www.pantone.com
+   for more information.  Licensees of Pantone color libraries or similar 
+   libraries should find it straight forward to interface.  Pantone names are
+   referred to in named_color_table.txt and contained in the file named_colors.pdf.
+
+   !!!!IT WILL BE NECESSARY TO PERFORM THE PROPER DEALLOCATION 
+       CLEAN-UP OF THE STRUCTURES WHEN rc_free_icc_profile OCCURS FOR THE NAMED 
+       COLOR PROFILE!!!!!!  
+
+*/
+
+/* Define the demo structure and function for named color look-up */
+
+typedef struct gsicc_namedcolor_s {
+    char *colorant_name;            /* The name */
+    unsigned int name_size;         /* size of name */
+    unsigned short lab[3];          /* CIELAB D50 values */
+} gsicc_namedcolor_t;
+
+typedef struct gsicc_namedcolortable_s {
+    gsicc_namedcolor_t *named_color;    /* The named color */
+    unsigned int number_entries;        /* The number of entries */
+} gsicc_namedcolortable_t;
+
+/* Support functions for parsing buffer */
+
+static int
+get_to_next_line(unsigned char **buffptr, int *buffer_count) 
+{
+    while (1) {
+        if (**buffptr == ';') {
+            (*buffptr)++;
+            (*buffer_count)--;
+            return(0);
+        } else {
+            (*buffptr)++;
+            (*buffer_count)--;
+        }
+        if (*buffer_count <= 0) {
+            return -1;
+        }
+    }
+}
+
+/* Function returns -1 if name not found.  Otherwise transform the color. */
+int
+gsicc_transform_named_color(float tint_value, byte *color_name, uint name_size,
+                            gx_color_value device_values[], 
+                            const gs_imager_state *pis, gx_device *dev, 
+                            cmm_profile_t *gs_output_profile, 
+                            gsicc_rendering_param_t *rendering_params, 
+                            bool include_softproof)
+{
+
+    gsicc_namedcolor_t *namedcolor_data;
+    unsigned int num_entries;
+    cmm_profile_t *named_profile;
+    gsicc_namedcolortable_t *namedcolor_table;
+    int k,j;
+    float lab[3];
+    const char *buffptr;
+    int buffer_count;
+    int count;
+    int code;
+    char *pch, *temp_ptr;
+    bool done;
+    int curr_name_size;
+    bool found_match;
+    unsigned short psrc[GS_CLIENT_COLOR_MAX_COMPONENTS];
+    unsigned short psrc_cm[GS_CLIENT_COLOR_MAX_COMPONENTS];
+    unsigned short *psrc_temp;
+    float temp;
+    unsigned short white_lab[3] = {65535, 32767, 32767};
+    gsicc_link_t *icc_link;
+    cmm_profile_t *curr_output_profile;
+
+    /* Check if the data that we have has already been generated. */
+    if (pis->icc_manager != NULL) {
+        if (pis->icc_manager->device_named != NULL) {
+            named_profile = pis->icc_manager->device_named;
+            if (named_profile->buffer != NULL && 
+                named_profile->profile_handle == NULL) {
+                /* Create the structure that we will use in searching */
+                /*  Note that we do this in non-GC memory since the
+                    profile pointer is not GC'd */
+                namedcolor_table = 
+                    (gsicc_namedcolortable_t*) gs_malloc(pis->memory->stable_memory, 1, 
+                                                    sizeof(gsicc_namedcolortable_t),
+                                                    "gsicc_transform_named_color");
+                if (namedcolor_table == NULL) return(-1);
+                /* Parse buffer and load the structure we will be searching */
+                buffptr = (const char*) named_profile->buffer;
+                buffer_count = named_profile->buffer_size;
+                count = sscanf(buffptr,"%d",&num_entries);
+                if (num_entries < 1 || count == 0) {
+                    gs_free(pis->memory, namedcolor_table, 1, 
+                            sizeof(gsicc_namedcolortable_t),
+                            "gsicc_transform_named_color");
+                    return (-1);
+                }
+                code = get_to_next_line(&buffptr,&buffer_count);
+                if (code < 0) {
+                    gs_free(pis->memory, 
+                            namedcolor_table, 1, 
+                            sizeof(gsicc_namedcolortable_t),
+                            "gsicc_transform_named_color");
+                    return (-1);
+                }
+                namedcolor_data = 
+                    (gsicc_namedcolor_t*) gs_malloc(pis->memory->stable_memory, num_entries, 
+                                                    sizeof(gsicc_namedcolor_t),
+                                                    "gsicc_transform_named_color");
+                if (namedcolor_data == NULL) {
+                    gs_free(pis->memory, namedcolor_table, 1, 
+                            sizeof(gsicc_namedcolortable_t),
+                            "gsicc_transform_named_color");
+                    return (-1);
+                }
+                namedcolor_table->number_entries = num_entries;
+                namedcolor_table->named_color = namedcolor_data;
+                for (k = 0; k < num_entries; k++) {
+                    if (k == 0) {
+                        pch = strtok(buffptr,",;");
+                    } else {
+                        pch = strtok(NULL,",;");
+                    }
+                    /* Remove any /0d /0a stuff from start */
+                    temp_ptr = pch;
+                    done = 0;
+                    while (!done) {
+                        if (*temp_ptr == 0x0d || *temp_ptr == 0x0a) {
+                            temp_ptr++;
+                        } else {
+                            done = 1;
+                        }
+                    }
+                    curr_name_size = strlen(temp_ptr);
+                    namedcolor_data[k].name_size = curr_name_size;
+                    /* +1 for the null */
+                    namedcolor_data[k].colorant_name = 
+                        (char*) gs_malloc(pis->memory->stable_memory,1,name_size+1,
+                                        "gsicc_transform_named_color");
+                    strncpy(namedcolor_data[k].colorant_name,temp_ptr,
+                            namedcolor_data[k].name_size+1);
+                    for (j = 0; j < 3; j++) {
+                        pch = strtok(NULL,",;");
+                        count = sscanf(pch,"%f",&(lab[j]));
+                    }
+                    lab[0] = lab[0]*65535/100.0;
+                    lab[1] = (lab[1] + 128.0)*65535/255;
+                    lab[2] = (lab[2] + 128.0)*65535/255;
+                    for (j = 0; j < 3; j++) {
+                        if (lab[j] > 65535) lab[j] = 65535;
+                        if (lab[j] < 0) lab[j] = 0;
+                        namedcolor_data[k].lab[j] = (unsigned short) lab[j];
+                    }
+                    if (code < 0) {
+                        gs_free(pis->memory, namedcolor_table, 1, 
+                                sizeof(gsicc_namedcolortable_t),
+                                "gsicc_transform_named_color");
+                        gs_free(pis->memory, namedcolor_data, num_entries, 
+                                sizeof(gsicc_namedcolordata_t),
+                                "gsicc_transform_named_color");
+                        return (-1);
+                    }
+                }
+                /* Assign to the profile pointer */
+                named_profile->profile_handle = namedcolor_table;
+            } else {
+                if (named_profile->profile_handle != NULL ) {
+                    namedcolor_table = 
+                        (gsicc_namedcolortable_t*) named_profile->profile_handle;
+                   num_entries = namedcolor_table->number_entries;
+                } else {
+                    return(-1);
+                }
+            }
+            /* Search our structure for the color name */
+            found_match = false;
+            for (k = 0; k < num_entries; k++) {
+                if (name_size == namedcolor_table->named_color[k].name_size) {
+                    if( strncmp((const char *) namedcolor_table->named_color[k].colorant_name,
+                        (const char *) color_name, name_size) == 0) {
+                            found_match = true;
+                            break;
+                    }
+                }
+            }
+            if (found_match) {
+                /* Apply tint and push through CMM */
+                for (j = 0; j < 3; j++) {
+                    temp = (float) namedcolor_table->named_color[k].lab[j] * tint_value
+                            + (float) white_lab[j] * (1.0 - tint_value);
+                    psrc[j] = (unsigned short) temp;
+                }
+                if ( gs_output_profile != NULL ) {
+                    curr_output_profile = gs_output_profile;
+                } else {
+                    /* Use the device profile */
+                    curr_output_profile = dev->device_icc_profile;
+                }
+                icc_link = gsicc_get_link_profile(pis, dev, 
+                                                pis->icc_manager->lab_profile, 
+                                                curr_output_profile, rendering_params, 
+                                                pis->memory, false);
+                if (icc_link->is_identity) {
+                    psrc_temp = &(psrc[0]);
+                } else {
+                    /* Transform the color */
+                    psrc_temp = &(psrc_cm[0]);
+                    gscms_transform_color(icc_link, psrc, psrc_temp, 2, NULL);
+                }
+                gsicc_release_link(icc_link);
+                for ( k = 0; k < curr_output_profile->num_comps; k++){
+                    device_values[k] = psrc_temp[k];
+                }
+                return(0);
+            } else {
+                return (-1);
+            }
+        }
+    }
+    return(-1);
+}
+
+/* Used by gs to notify the ICC manager that we are done with this link for now */
+/* This may release elements waiting on a icc_link_cache slot */
+void 
+gsicc_release_link(gsicc_link_t *icclink)
+{
+    gsicc_link_cache_t *icc_link_cache = icclink->icc_link_cache;
+
+    gx_monitor_enter(icc_link_cache->lock);
+    /* Decrement the reference count */
+    if (--(icclink->ref_count) == 0) {
+
+	gsicc_link_t *curr, *prev;
+
+
+	/* Find link in cache, and move it to the end of the list.  */
+	/* This way zero ref_count links are found LRU first	*/
+	curr = icc_link_cache->head;
+	prev = NULL;
+	while (curr != icclink) {
+	    prev = curr;
+	    curr = curr->next;
+	};
+	if (prev == NULL) {
+	    /* this link was the head */
+	    icc_link_cache->head = curr->next;
+	} else {
+	    prev->next = curr->next;		/* de-link this one */
+	}
+	/* Find the first zero-ref entry on the list */
+	curr = icc_link_cache->head;
+	prev = NULL;
+	while (curr != NULL && curr->ref_count > 0) {
+	    prev = curr;
+	    curr = curr->next;
+	}
+	/* Found where to link this one into the tail of the list */
+	if (prev == NULL) {
+	    icc_link_cache->head = icclink;
+	    icclink->next = icc_link_cache->head->next;
+	} else {
+	    /* link this one in here */
+	    prev->next = icclink;	
+	    icclink->next = curr;
+	}
+
+	/* now release any tasks waiting for a cache slot */
+        while (icclink->icc_link_cache->num_waiting > 0) {
+	    gx_semaphore_signal(icclink->icc_link_cache->wait);
+	    icclink->icc_link_cache->num_waiting--;
+        }
+    }
+    gx_monitor_leave(icc_link_cache->lock);
+}
+
+/* Used to initialize the buffer description prior to color conversion */
+
+void
+gsicc_init_buffer(gsicc_bufferdesc_t *buffer_desc, unsigned char num_chan, unsigned char bytes_per_chan,
+                  bool has_alpha, bool alpha_first, bool is_planar, int plane_stride, int row_stride,
+                  int num_rows, int pixels_per_row)
+{
+    buffer_desc->num_chan = num_chan;
+    buffer_desc->bytes_per_chan = bytes_per_chan;
+    buffer_desc->has_alpha = has_alpha;
+    buffer_desc->alpha_first = alpha_first;
+    buffer_desc->is_planar = is_planar;
+    buffer_desc->plane_stride = plane_stride;
+    buffer_desc->row_stride = row_stride;
+    buffer_desc->num_rows = num_rows;
+    buffer_desc->pixels_per_row = pixels_per_row; 
+
+#if arch_is_big_endian
+    buffer_desc->little_endian = false;
+#else
+    buffer_desc->little_endian = true;
+#endif
+
+}
+

Modified: branches/chrisl-test-gs/base/gsicc_cache.h
===================================================================
--- branches/chrisl-test-gs/base/gsicc_cache.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsicc_cache.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -21,18 +21,23 @@
 typedef struct gs_imager_state_s gs_imager_state;
 #endif
 
+#ifndef gx_device_DEFINED
+#  define gx_device_DEFINED
+typedef struct gx_device_s gx_device;
+#endif
+
 gsicc_link_cache_t* gsicc_cache_new(gs_memory_t *memory);
 void
 gsicc_init_buffer(gsicc_bufferdesc_t *buffer_desc, unsigned char num_chan, 
                   unsigned char bytes_per_chan, bool has_alpha, bool alpha_first, 
                   bool is_planar, int plane_stride, int row_stride, int num_rows, 
                   int pixels_per_row);
-gsicc_link_t* gsicc_get_link(const gs_imager_state * pis, 
+gsicc_link_t* gsicc_get_link(const gs_imager_state * pis, gx_device *dev, 
                              const gs_color_space  *input_colorspace,
                              gs_color_space *output_colorspace,
                              gsicc_rendering_param_t *rendering_params, 
                              gs_memory_t *memory, bool include_softproof);
-gsicc_link_t* gsicc_get_link_profile(gs_imager_state *pis, 
+gsicc_link_t* gsicc_get_link_profile(gs_imager_state *pis, gx_device *dev, 
                                      cmm_profile_t *gs_input_profile,
                                      cmm_profile_t *gs_output_profile,
                                      gsicc_rendering_param_t *rendering_params, 
@@ -41,7 +46,7 @@
 void gsicc_get_icc_buff_hash(unsigned char *buffer, int64_t *hash, unsigned int buff_size);
 int gsicc_transform_named_color(float tint_value, byte *color_name, uint name_size,
                             gx_color_value device_values[], 
-                            const gs_imager_state *pis, 
+                            const gs_imager_state *pis, gx_device *dev, 
                             cmm_profile_t *gs_output_profile, 
                             gsicc_rendering_param_t *rendering_params, 
                             bool include_softproof);

Modified: branches/chrisl-test-gs/base/gsicc_create.c
===================================================================
--- branches/chrisl-test-gs/base/gsicc_create.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsicc_create.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -148,9 +148,9 @@
 #define icMultiUnicodeText 0x6d6c7563           /* 'mluc' v4 text type */
 #define icMultiFunctionAtoBType 0x6d414220      /* 'mAB ' v4 lutAtoBtype type */
 #define icSigChromaticAdaptationTag 0x63686164  /* 'chad' */
-#define D50_X 0.9642
-#define D50_Y 1.0
-#define D50_Z 0.8249
+#define D50_X 0.9642f
+#define D50_Y 1.0f
+#define D50_Z 0.8249f
 #define DEFAULT_TABLE_NSIZE 9
 #define DEFAULT_TABLE_GRAYSIZE 128
 
@@ -1039,12 +1039,12 @@
 gsicc_create_compute_cam( gs_vector3 *white_src, gs_vector3 *white_des, 
                                 float *cam)
 {
-    float cat02matrix[] = {0.7328, 0.4296, -0.1624,
-                            -0.7036, 1.6975, 0.0061,
-                             0.003, 0.0136, 0.9834};
-    float cat02matrixinv[] = {1.0961, -0.2789, 0.1827,
-                              0.4544, 0.4735, 0.0721,
-                             -0.0096, -0.0057, 1.0153};
+    float cat02matrix[] = {0.7328f, 0.4296f, -0.1624f,
+                            -0.7036f, 1.6975f, 0.0061f,
+                             0.003f, 0.0136f, 0.9834f};
+    float cat02matrixinv[] = {1.0961f, -0.2789f, 0.1827f,
+                              0.4544f, 0.4735f, 0.0721f,
+                             -0.0096f, -0.0057f, 1.0153f};
     float vonkries_diag[9];
     float temp_matrix[9];
     float lms_wp_src[3], lms_wp_des[3];
@@ -1493,9 +1493,10 @@
     for(k = 0; k < num_tags; k++) {
         profile_size += tag_list[k].size;
     }
-
-    /* Now we can go ahead and fill our buffer with the data */
-    buffer = gs_alloc_bytes(memory,profile_size,"gsicc_create_from_cal");
+    /* Now we can go ahead and fill our buffer with the data.  Profile
+       buffer data is in non-gc memory */
+    buffer = gs_alloc_bytes(memory->non_gc_memory, 
+                            profile_size, "gsicc_create_from_cal");
     curr_ptr = buffer;
     /* The header */
     header->size = profile_size;
@@ -1653,8 +1654,10 @@
         profile_size += tag_list[k].size;
     }
     /* End of tag table information */
-    /* Now we can go ahead and fill our buffer with the data */
-    buffer = gs_alloc_bytes(memory,profile_size,"create_lutAtoBprofile");
+    /* Now we can go ahead and fill our buffer with the data.  Profile
+       is in non-gc memory */
+    buffer = gs_alloc_bytes(memory->non_gc_memory, profile_size, 
+        "create_lutAtoBprofile");
     curr_ptr = buffer;
     /* The header */
     header->size = profile_size;

Modified: branches/chrisl-test-gs/base/gsicc_manage.c
===================================================================
--- branches/chrisl-test-gs/base/gsicc_manage.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsicc_manage.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -74,25 +74,13 @@
 gs_private_st_ptrs2(st_gsicc_colorname, gsicc_colorname_t, "gsicc_colorname",
 		    gsicc_colorname_enum_ptrs, gsicc_colorname_reloc_ptrs, name, next);
 
-gs_private_st_ptrs1(st_gsicc_namelist, gsicc_namelist_t, "gsicc_namelist",
-		    gsicc_namelist_enum_ptrs, gsicc_namelist_reloc_ptrs, head);
-gs_private_st_ptrs3(st_gsicc_profile, cmm_profile_t, "gsicc_profile",
-		    gsicc_profile_enum_ptrs, gsicc_profile_reloc_ptrs, buffer, 
-                    dev, spotnames);
-
-gs_private_st_ptrs10(st_gsicc_manager, gsicc_manager_t, "gsicc_manager",
+gs_private_st_ptrs1(st_gsicc_manager, gsicc_manager_t, "gsicc_manager",
 		    gsicc_manager_enum_ptrs, gsicc_manager_profile_reloc_ptrs,
-		    device_profile, device_named, default_gray, default_rgb,
-                    default_cmyk, proof_profile, output_link, lab_profile,
-                    device_n, smask_profiles); 
+		    smask_profiles); 
 
 gs_private_st_ptrs2(st_gsicc_devicen, gsicc_devicen_t, "gsicc_devicen",
 		gsicc_devicen_enum_ptrs, gsicc_devicen_reloc_ptrs, head, final);
 
-gs_private_st_ptrs3(st_gsicc_smask, gsicc_smask_t, "gsicc_smask",
-		gsicc_smask_enum_ptrs, gsicc_smask_reloc_ptrs, smask_gray, 
-                smask_rgb, smask_cmyk);
-
 gs_private_st_ptrs2(st_gsicc_devicen_entry, gsicc_devicen_entry_t, 
                     "gsicc_devicen_entry", gsicc_devicen_entry_enum_ptrs, 
                     gsicc_devicen_entry_reloc_ptrs, iccprofile, next);
@@ -195,12 +183,12 @@
 {
     gsicc_smask_t *result;
 
-    result = gs_alloc_struct(memory, 
-            gsicc_smask_t, &st_gsicc_smask, "gsicc_new_iccsmask");
+    result = (gsicc_smask_t *) gs_alloc_bytes(memory, sizeof(gsicc_smask_t), "gsicc_new_iccsmask");
     if (result != NULL) {
         result->smask_gray = NULL;
         result->smask_rgb = NULL;
         result->smask_cmyk = NULL;
+        result->memory = memory;
     }
     return(result);
 }
@@ -394,7 +382,7 @@
             return;
     }
     icc_profile->spotnames = 
-        gsicc_get_spotnames(icc_profile->profile_handle, memory);
+        gsicc_get_spotnames(icc_profile->profile_handle, memory->non_gc_memory);
     return;
 }
 
@@ -404,8 +392,8 @@
 {
     gsicc_namelist_t *result;
 
-    result = gs_alloc_struct(memory,gsicc_namelist_t,
-		&st_gsicc_namelist, "gsicc_new_namelist");
+    result = (gsicc_namelist_t *) gs_alloc_bytes(memory->non_gc_memory, sizeof(gsicc_namelist_t),
+                             "gsicc_new_namelist");
     result->count = 0;
     result->head = NULL;
     return(result);
@@ -720,9 +708,8 @@
     return(str);
 }
 
-/* This set the device profile entry of the ICC manager.  If the
-   device does not have a defined profile, then a default one
-   is selected. */
+/* This sets the device profile. If the device does not have a defined 
+   profile, then a default one is selected. */
 int
 gsicc_init_device_profile(const gs_state *pgs, gx_device * dev)
 {
@@ -751,23 +738,58 @@
                 break;
         }
     } 
-
     /* Set the manager */
-    if (pgs->icc_manager->device_profile == NULL) {
+    if (dev->device_icc_profile == NULL) {
+        /* No color model for the device */
         code = gsicc_set_device_profile(pgs->icc_manager, dev, pgs->memory);
         return(code);
+    } else {
+        /* Check for cases where the color model has changed */
+        if (dev->device_icc_profile->num_comps != 
+            dev->color_info.num_components || 
+            strncmp(dev->device_icc_profile->name,dev->color_info.icc_profile,
+            dev->device_icc_profile->name_length) != 0 ) {
+            /* First go ahead and try to use the profile path that is already 
+               given in the dev */
+            code = gsicc_set_device_profile(pgs->icc_manager, dev, pgs->memory);
+            /* Check that we are OK in our setting of the profile.  If not,
+               then we go ahead and grab the proper default rather than 
+               render wrong or even worst crash */
+            if (dev->device_icc_profile->num_comps != 
+                dev->color_info.num_components || code < 0) {
+                if (pgs->icc_manager->profiledir != NULL) {
+                    strcpy(dev->color_info.icc_profile, pgs->icc_manager->profiledir);
+                } else {
+                    /* profiledir not set.  go ahead and clear out the 
+                       current profile information to avoid two profile 
+                       names getting concatenated */
+                    dev->color_info.icc_profile[0] = '\0';
     }
+                switch(dev->color_info.num_components) {
+                    case 1:
+                        strcat(dev->color_info.icc_profile, DEFAULT_GRAY_ICC);
+                        break;
+                    case 3:
+                        strcat(dev->color_info.icc_profile, DEFAULT_RGB_ICC);
+                        break;
+                    case 4:
+                        strcat(dev->color_info.icc_profile, DEFAULT_CMYK_ICC);
+                        break;
+                    default:
+                        strcat(dev->color_info.icc_profile, DEFAULT_CMYK_ICC);
+                        break;
+                }
+            }
+            return(code);
+        }
     return(0);
 }
+}
 
-/*  This computes the hash code for the
-    device profile and assigns the code
-    and the profile to the DeviceProfile
-    member variable in the ICC Manager
-    This should really occur only one time.
-    This is different than gs_set_device_profile
-    which sets the profile on the output
-    device */
+/*  This computes the hash code for the device profile and assigns the profile 
+    to the device_icc_profile member variable of the device.  This should 
+    really occur only one time, but may occur twice if a color model is 
+    specified or a non default profile is specified on the command line */
 static int 
 gsicc_set_device_profile(gsicc_manager_t *icc_manager, gx_device * pdev, 
                          gs_memory_t * mem)
@@ -777,12 +799,14 @@
     const char *profile = &(pdev->color_info.icc_profile[0]);
     int code;
 
-    if (icc_manager->device_profile == NULL) {
-        /* Device profile in icc manager has not 
-           yet been set. Lets do it. */
-        /* Check if device has a profile.  This 
-           should always be true, since if one was
-           not set, we should have set it to the default. 
+    /* It is possible that the device profile has already been 
+       set.  We need to decrement if so and reset */
+
+    if (pdev->device_icc_profile != NULL) {
+        rc_decrement(pdev->device_icc_profile, "gsicc_set_device_profile");
+    }
+    /* Check if device has a profile.  This should always be true, since if 
+       one was not set, we should have set it to the default. 
         */
         if (profile != '\0') {
             str = gsicc_open_search(profile, strlen(profile), mem, icc_manager);
@@ -790,7 +814,7 @@
                 icc_profile = 
                     gsicc_profile_new(str, mem, profile, strlen(profile));
                 code = sfclose(str);
-                icc_manager->device_profile = icc_profile;
+            pdev->device_icc_profile = icc_profile;
 
                 /* Get the profile handle */
                 icc_profile->profile_handle = 
@@ -814,7 +838,6 @@
             } else
                 return gs_rethrow(-1, "cannot find device profile");
         }
-    }
     return(0);
 }
 
@@ -855,14 +878,15 @@
     cmm_profile_t *result;
     int code;
     char *nameptr;
+    gs_memory_t *mem_nongc = memory->non_gc_memory;
 
-    result = (cmm_profile_t*) gs_alloc_struct(memory, cmm_profile_t, 
-                                &st_gsicc_profile, "gsicc_profile_new");
+    result = (cmm_profile_t*) gs_alloc_bytes(mem_nongc, sizeof(cmm_profile_t),  
+                                    "gsicc_profile_new");
     if (result == NULL) 
         return result;
     memset(result,0,sizeof(gsicc_serialized_profile_t));
     if (namelen > 0) {
-        nameptr = (char*) gs_alloc_bytes(memory->non_gc_memory, namelen,
+        nameptr = (char*) gs_alloc_bytes(mem_nongc, namelen,
 	   		     "gsicc_profile_new");
         memcpy(nameptr, pname, namelen);
         result->name = nameptr;
@@ -875,19 +899,20 @@
        object from our own constructed buffer.  For 
        example if we are converting CalRGB to an ICC type */
     if ( s != NULL) {
-        code = gsicc_load_profile_buffer(result, s, memory);
+        code = gsicc_load_profile_buffer(result, s, mem_nongc);
         if (code < 0) {
-            gs_free_object(memory, result, "gsicc_profile_new");
+            gs_free_object(mem_nongc, result, "gsicc_profile_new");
             return NULL;
         }
     } else {
         result->buffer = NULL;
         result->buffer_size = 0;
     }
-    rc_init_free(result, memory, 1, rc_free_icc_profile);
+    rc_init_free(result, mem_nongc, 1, rc_free_icc_profile);
     result->profile_handle = NULL;
     result->spotnames = NULL;
     result->dev = NULL;
+    result->memory = mem_nongc;
     return(result);
 }
 
@@ -897,11 +922,12 @@
     cmm_profile_t *profile = (cmm_profile_t *)ptr_in;
     int k;
     gsicc_colorname_t *curr_name, *next_name;
+    gs_memory_t *mem_nongc =  profile->memory;
 
     if (profile->rc.ref_count <= 1 ) {
         /* Clear out the buffer if it is full */
         if(profile->buffer != NULL) {
-            gs_free_object(mem, profile->buffer, "rc_free_icc_profile");
+            gs_free_object(mem_nongc, profile->buffer, "rc_free_icc_profile");
             profile->buffer = NULL;
         }
 
@@ -913,7 +939,7 @@
 
         /* Release the name if it has been set */
         if(profile->name != NULL) {
-            gs_free_object(mem->non_gc_memory ,profile->name,"rc_free_icc_profile");
+            gs_free_object(mem_nongc ,profile->name,"rc_free_icc_profile");
             profile->name = NULL;
             profile->name_length = 0;
         }
@@ -926,15 +952,15 @@
             for ( k = 0; k < profile->spotnames->count; k++) {
                 next_name = curr_name->next;
                 /* Free the name */
-                gs_free_object(mem, curr_name->name, "rc_free_icc_profile");
+                gs_free_object(mem_nongc, curr_name->name, "rc_free_icc_profile");
                 /* Free the name structure */
-                gs_free_object(mem, curr_name, "rc_free_icc_profile");
+                gs_free_object(mem_nongc, curr_name, "rc_free_icc_profile");
                 curr_name = next_name;
             }
             /* Free the main object */
-            gs_free_object(mem, profile->spotnames, "rc_free_icc_profile");
+            gs_free_object(mem_nongc, profile->spotnames, "rc_free_icc_profile");
         }
-	gs_free_object(mem, profile, "rc_free_icc_profile");
+	gs_free_object(mem_nongc, profile, "rc_free_icc_profile");
     }
 }
 
@@ -975,7 +1001,6 @@
    result->lab_profile = NULL;
    result->device_named = NULL;
    result->output_link = NULL;
-   result->device_profile = NULL;
    result->proof_profile = NULL;
    result->device_n = NULL;
    result->smask_profiles = NULL;
@@ -1000,7 +1025,6 @@
    rc_decrement(icc_manager->default_rgb, "rc_gsicc_manager_free");
    rc_decrement(icc_manager->device_named, "rc_gsicc_manager_free");
    rc_decrement(icc_manager->output_link, "rc_gsicc_manager_free");
-   rc_decrement(icc_manager->device_profile, "rc_gsicc_manager_free");
    rc_decrement(icc_manager->proof_profile, "rc_gsicc_manager_free");
    rc_decrement(icc_manager->lab_profile, "rc_gsicc_manager_free");
 
@@ -1167,7 +1191,8 @@
            the clist ioprocs */
         /* Allocate the buffer */
         profile_size = size - sizeof(gsicc_serialized_profile_t);
-        buffer_ptr = gs_alloc_bytes(memory, profile_size,
+        /* Profile and its members are ALL in non-gc memory */
+        buffer_ptr = gs_alloc_bytes(memory->non_gc_memory, profile_size,
 					    "gsicc_get_profile_handle_clist");
         if (buffer_ptr == NULL)
             return(0);

Modified: branches/chrisl-test-gs/base/gsimage.c
===================================================================
--- branches/chrisl-test-gs/base/gsimage.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsimage.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -210,7 +210,7 @@
     if (code < 0)
 	return code;
     /* Processing an image object operation */
-    gs_set_object_tag(pgs, GS_IMAGE_TAG);
+    gs_set_object_tag((gs_imager_state*) pgs, GS_IMAGE_TAG);
 
     if (uses_color) {
 	gx_set_dev_color(pgs);

Modified: branches/chrisl-test-gs/base/gsiodisk.c
===================================================================
--- branches/chrisl-test-gs/base/gsiodisk.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsiodisk.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -217,7 +217,7 @@
             return_error(gs_error_undefinedfilename);
     }
 
-    return iodev_os_fopen(iodev_default, realname, access, pfile, rfname, rnamelen);
+    return iodev_os_fopen(iodev_default(pstate->memory), realname, access, pfile, rfname, rnamelen);
 }
 
 static int

Modified: branches/chrisl-test-gs/base/gsmdebug.h
===================================================================
--- branches/chrisl-test-gs/base/gsmdebug.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsmdebug.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -18,6 +18,8 @@
 #ifndef gsmdebug_INCLUDED
 #  define gsmdebug_INCLUDED
 
+#include "valgrind.h"
+
 /* Define the fill patterns used for debugging the allocator. */
 extern const byte
        gs_alloc_fill_alloc,	/* allocated but not initialized */
@@ -35,10 +37,15 @@
 
 #ifdef DEBUG
 #  define gs_alloc_fill(ptr, fill, len)\
-     BEGIN if ( gs_alloc_debug ) gs_alloc_memset(ptr, fill, (ulong)(len)); END
+     BEGIN                                                           \
+     if ( gs_alloc_debug ) gs_alloc_memset(ptr, fill, (ulong)(len)); \
+     VALGRIND_MAKE_MEM_UNDEFINED(ptr,(ulong)(len));                  \
+     END
 #else
 #  define gs_alloc_fill(ptr, fill, len)\
-     DO_NOTHING
+     BEGIN                                                           \
+     VALGRIND_MAKE_MEM_UNDEFINED(ptr,(ulong)(len));                  \
+     END
 #endif
 
 #endif /* gsmdebug_INCLUDED */

Modified: branches/chrisl-test-gs/base/gsovrc.c
===================================================================
--- branches/chrisl-test-gs/base/gsovrc.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsovrc.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -424,8 +424,8 @@
     0,					/* ret_devn_params */
     gx_forward_fillpage,
     0,                                  /* push_transparency_state */
-    0                                   /* pop_transparency_state */
-
+    0,                                  /* pop_transparency_state */
+    0                                   /* put_image */   
 };
 
 /*

Modified: branches/chrisl-test-gs/base/gsovrc.h
===================================================================
--- branches/chrisl-test-gs/base/gsovrc.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsovrc.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -294,7 +294,7 @@
  * entire gs_overprint_s structure.
  */
 #define private_st_gs_overprint_t()	/* In gsovrc.c */\
-  gs_private_st_simple(st_overprint, gs_overprint_t, "gs_overprint_t");
+  gs_private_st_simple(st_overprint, gs_overprint_t, "gs_overprint_t")
 
 
 

Modified: branches/chrisl-test-gs/base/gspaint.c
===================================================================
--- branches/chrisl-test-gs/base/gspaint.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gspaint.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -77,7 +77,7 @@
 	return_error(gs_error_Fatal);
     }
     /* Processing a fill object operation */
-    gs_set_object_tag(pgs, GS_PATH_TAG);
+    gs_set_object_tag((gs_imager_state*) pgs, GS_PATH_TAG);
 
     gx_set_dev_color(pgs);
 
@@ -257,10 +257,10 @@
 	  which sets gs_hit_device, which is uncolored.
      */
     if (gx_device_has_color(gs_currentdevice(pgs))) {
-	gs_set_object_tag(pgs, GS_PATH_TAG);
+	gs_set_object_tag((gs_imager_state*) pgs, GS_PATH_TAG);
     }
     else {
-	gs_set_object_tag(pgs, GS_TEXT_TAG);
+	gs_set_object_tag((gs_imager_state*) pgs, GS_TEXT_TAG);
     }
     gx_set_dev_color(pgs);
     code = gs_state_color_load(pgs);
@@ -333,9 +333,9 @@
        target device 1 bit per component is a cache and this is
        text else it is a path */
     if (gx_device_has_color(gs_currentdevice(pgs)))
-        gs_set_object_tag(pgs, GS_PATH_TAG);
+        gs_set_object_tag((gs_imager_state*) pgs, GS_PATH_TAG);
     else
-        gs_set_object_tag(pgs, GS_TEXT_TAG);
+        gs_set_object_tag((gs_imager_state*) pgs, GS_TEXT_TAG);
 
     /* Here we need to distinguish text from vectors to compute the object tag.
        Actually we need to know whether this function is called to rasterize a character,
@@ -364,10 +364,10 @@
           Type 3 charproc streams immediately.
      */
     if (gx_device_has_color(gs_currentdevice(pgs))) {
-	gs_set_object_tag(pgs, GS_PATH_TAG);
+	gs_set_object_tag((gs_imager_state*) pgs, GS_PATH_TAG);
     }
     else {
-	gs_set_object_tag(pgs, GS_TEXT_TAG);
+	gs_set_object_tag((gs_imager_state*) pgs, GS_TEXT_TAG);
     }
     /* Evil: The following call is a macro that might return! */
     gx_set_dev_color(pgs);

Modified: branches/chrisl-test-gs/base/gsptype1.c
===================================================================
--- branches/chrisl-test-gs/base/gsptype1.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsptype1.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -290,6 +290,7 @@
 	      inst.size.x, inst.size.y);
     /* Absent other information, instances always require a mask. */
     inst.uses_mask = true;
+    inst.is_clist = false;	/* automatically set clist (don't force use) */
     gx_translate_to_fixed(saved, float2fixed_rounded(inst.step_matrix.tx - bbox.p.x),
 			         float2fixed_rounded(inst.step_matrix.ty - bbox.p.y));
     inst.step_matrix.tx = bbox.p.x;
@@ -508,12 +509,6 @@
 	&((const gs_pattern1_instance_t *)pinst)->template;
 }
 
-/* Check device color for Pattern Type 1. */
-bool
-gx_dc_is_pattern1_color(const gx_device_color *pdevc)
-{
-    return pdevc->type == &gx_dc_pattern;
-}
 
 /* Get transparency object pointer */
 void *
@@ -527,7 +522,7 @@
 bool
 gx_dc_is_pattern1_color_clist_based(const gx_device_color *pdevc)
 {
-    if (pdevc->type != &gx_dc_pattern)
+    if (!(gx_dc_is_pattern1_color(pdevc)))
 	return false;
     return gx_pattern_tile_is_clist(pdevc->colors.pattern.p_tile);
 }
@@ -536,7 +531,7 @@
 gs_id
 gs_dc_get_pattern_id(const gx_device_color *pdevc)
 {
-    if (pdevc->type != &gx_dc_pattern)
+    if (!(gx_dc_is_pattern1_color(pdevc)))
 	return gs_no_id;
     if (pdevc->colors.pattern.p_tile == NULL)
 	return gs_no_id;
@@ -968,6 +963,16 @@
     gx_dc_pattern_get_nonzero_comps
 };
 
+const gx_device_color_type_t gx_dc_pattern_trans = {
+    &st_dc_pattern,
+    gx_dc_pattern_save_dc, gx_dc_pattern_get_dev_halftone,
+    gx_dc_ht_get_phase,
+    gx_dc_pattern_load, gx_dc_pat_trans_fill_rectangle,
+    gx_dc_default_fill_masked, gx_dc_pattern_equal,
+    gx_dc_pattern_write, gx_dc_pattern_read, 
+    gx_dc_pattern_get_nonzero_comps
+};
+
 extern_st(st_dc_ht_binary);
 gs_private_st_composite(st_dc_pure_masked, gx_device_color, "dc_pure_masked",
 			dc_masked_enum_ptrs, dc_masked_reloc_ptrs);
@@ -1206,13 +1211,13 @@
 	}
 	if (ctile->id == id &&
 	    ctile->is_dummy == !internal_accum &&
-	    (pdevc->type != &gx_dc_pattern ||
+	    (!(gx_dc_is_pattern1_color(pdevc)) ||
 	     ctile->depth == dev->color_info.depth)
 	    ) {
 	    int px = pis->screen_phase[select].x;
 	    int py = pis->screen_phase[select].y;
 
-	    if (pdevc->type == &gx_dc_pattern) {	/* colored */
+	    if (gx_dc_is_pattern1_color(pdevc)) {	/* colored */
 		pdevc->colors.pattern.p_tile = ctile;
 #	    if 0 /* Debugged with Bug688308.ps and applying patterns after clist.
 		    Bug688308.ps has a step_matrix much bigger than pattern bbox;
@@ -1491,7 +1496,7 @@
 
 
 
-/* Write a pattern into command list, possibly dividing intoi portions. */
+/* Write a pattern into command list, possibly dividing into portions. */
 int
 gx_dc_pattern_write(
     const gx_device_color *         pdevc,
@@ -1797,6 +1802,7 @@
                 ptile->ttrans->rect.q.y = trans_info.rect.q.y;
                 ptile->ttrans->rowstride = trans_info.rowstride;
                 ptile->ttrans->width = trans_info.width;
+                pdevc->type = &gx_dc_pattern_trans;
 
        	        code = gx_dc_pattern_read_trans_buff(ptile, offset1, dp, left, mem);
 	        if (code < 0)
@@ -1816,36 +1822,19 @@
 	size_c = buf.size_c;
 	ptile->tbits.size.x = size_b; /* HACK: Use unrelated field for saving size_b between calls. */
 	ptile->tbits.size.y = size_c; /* HACK: Use unrelated field for saving size_c between calls. */
-	{   /* HACK: Artificial arguments for gx_pattern_accum_alloc 
-	       to force a clist-based accummulator. 
-	       A better way would be to split gx_pattern_accum_alloc.
-	     */
+	{
 	    gs_state state;
 	    gs_pattern1_instance_t inst;
 
 	    memset(&state, 0, sizeof(state));
 	    memset(&inst, 0, sizeof(inst));
-#	    if 0 /* wrong. Currently PaintType 2 can't pass here. */
-	    if (buf.paint_type == 2) {
-		/* Convert to a raster pattern cell cropped with the current band. */
-		gx_device_memory *mdev = gs_alloc_struct(mem, gx_device_memory,
-				       &st_device_memory,
-				       "gx_dc_pattern_read");
-
-		if (mdev == 0)
-		    return_error(gs_error_VMerror);
-		gs_make_mem_device(mdev, gdev_mem_device_for_bits(1), mem, -1, NULL);
-		state.device = (gx_device *)mdev;
-		inst.template.PaintType = 2;
-	    } else 
-#	    endif
-	    {
+	    /* NB: Currently PaintType 2 can't pass here. */
 		state.device = (gx_device *)dev; /* Break 'const'. */
 		inst.template.PaintType = 1;
-	    }
 	    inst.size.x = buf.size.x;
 	    inst.size.y = buf.size.y;
 	    inst.saved = &state;
+	    inst.is_clist = buf.is_clist;	/* tell gx_pattern_accum_alloc to use clist */
 	    ptile->cdev = (gx_device_clist *)gx_pattern_accum_alloc(mem, mem, 
 			       &inst, "gx_dc_pattern_read");
 	    if (ptile->cdev == NULL)
@@ -1888,3 +1877,35 @@
     }
     return size - left;
 }
+
+/* Set the transparency pattern procs for filling rects.  */
+void
+gx_set_pattern_procs_trans(gx_device_color *pdevc)
+{
+    pdevc->type = &gx_dc_pattern_trans;
+    return;
+}
+
+/* Set the standard pattern procs for filling rects.  */
+void
+gx_set_pattern_procs_standard(gx_device_color *pdevc)
+{
+    pdevc->type = &gx_dc_pattern;
+    return;
+}
+
+/* Check if transparency pattern procs for filling rects.  */
+bool 
+gx_pattern_procs_istrans(gx_device_color *pdevc)
+{
+    return(pdevc->type == &gx_dc_pattern_trans);
+}
+
+/* Check device color for Pattern Type 1. */
+bool
+gx_dc_is_pattern1_color(const gx_device_color *pdevc)
+{
+    return (pdevc->type == &gx_dc_pattern || pdevc->type == &gx_dc_pattern_trans);
+}
+
+

Modified: branches/chrisl-test-gs/base/gsptype1.h
===================================================================
--- branches/chrisl-test-gs/base/gsptype1.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsptype1.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -94,6 +94,12 @@
 /* Get transparency pointer */
 void * gx_pattern1_get_transptr(const gx_device_color *pdevc);
 
+/* For changing the device color procs when we have a transparency situation */
+
+void gx_set_pattern_procs_trans(gx_device_color *pdevc);
+void gx_set_pattern_procs_standard(gx_device_color *pdevc);
+bool gx_pattern_procs_istrans(gx_device_color *pdevc);
+
 /* Check device color for clist-based Pattern Type 1. */
 bool gx_dc_is_pattern1_color_clist_based(const gx_device_color *pdevc);
 

Modified: branches/chrisl-test-gs/base/gsropt.h
===================================================================
--- branches/chrisl-test-gs/base/gsropt.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsropt.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -30,6 +30,42 @@
  */
 #define TRANSPARENCY_PER_H_P
 
+/* Raster ops are explained in Chapter 5 of "The PCL 5 Color Technical
+ * Reference Manual", but essentially, they provide a way of mixing
+ * various bitmaps together. The most general form is where a texture
+ * bitmap, a source bitmap, and a destination bitmap are added together to
+ * give a new destination bitmap value.
+ *
+ * Each bitmap value is either 0 or 1, so essentially each raster op is
+ * a function of the form f(D,S,T). (Confusingly, the HP documentation uses
+ * the name 'pattern' in the english descriptive text in an inconsistent way
+ * to sometimes mean 'texture' and sometimes mean something that is used to
+ * help generate the texture. We will use texture exclusively here.)
+ *
+ * There are therefore 8 possible values on input to such functions, and 2
+ * possible output values for each input. Hence 2^8 = 256 possible raster
+ * op functions.
+ *
+ * For any given function, f(D,S,T), we can form an 8 bit number as follows:
+ *  Bit 0 = f(0,0,0)
+ *  Bit 1 = f(1,0,0)
+ *  Bit 2 = f(0,1,0)
+ *  Bit 3 = f(1,1,0)
+ *  Bit 4 = f(0,0,1)
+ *  Bit 5 = f(1,0,1)
+ *  Bit 6 = f(0,1,1)
+ *  Bit 7 = f(1,1,1)
+ * Running this in reverse for each number from 0 to 255 we have an
+ * enumeratation of the possible 3 input raster op functions.
+ *
+ * We could therefore define F(op,D,S,T) to be a 'master' function that
+ * encapsulates all these raster op functions as follows:
+ *  F(op,D,S,T) = !!(op & ((D?0xAA:0x55) & (S?0xCC:0x33) & (T?0xF0:0xF)))
+ * We don't actually use that technique here (as it only works for 1bpp
+ * inputs, and we actually use the rasterops for doing multiple bits at
+ * once - it is mentioned for interests sake only.
+ */
+
 /*
  * By the magic of Boolean algebra, we can operate on the rop codes using
  * Boolean operators and get the right result.  E.g., the value of
@@ -130,11 +166,24 @@
 #define rop3_uses_T(op) rop3_uses_(op, rop3_T, rop3_T_shift)
 /*
  * Test whether an operation is idempotent, i.e., whether
- * f(D, S, T) = f(f(D, S, T), S, T).  This is equivalent to the condition that
- * for all values s and t, !( f(0,s,t) == 1 && f(1,s,t) == 0 ).
+ *      f(D, S, T) = f(f(D, S, T), S, T)   (for all D,S,T)
+ * f has a range of 0 or 1, so this is equivalent to the condition that:
+ *    There exists no s,t, s.t. (f(0,s,t) == 1 && f(1,s,t) == 0)
+ * or equivalently:
+ *    For all s, t, ~(f(0,s,t) == 1 &&   f(1,s,t) == 0 )
+ * or For all s, t, ~(f(0,s,t) == 1 && ~(f(1,s,t) == 1))
+ * or For all s, t, ~((f(0,s,t) & ~f(1,s,t)) == 1)
+ * or For all s, t,  ((f(0,s,t) & ~f(1,s,t)) == 0)
+ *
+ * We can code this as a logical operation by observing that:
+ *     ((~op)                 & rop3_D) gives us a bitfield of ~f(1,s,t)
+ *     (((op)<<rop_3_D_shift) & rop3_D) gives us a bitfield of  f(0,s,t)
+ * So
+ *     ((~op) & rop3_D) & ((op<<rop3_D_shift) & rop3_D) == 0 iff idempotent
+ * === ((~op) & (op<<rop3_D_shift) & rop3_D) == 0 iff idempotent
  */
 #define rop3_is_idempotent(op)\
-  !( (op) & ~((op) << rop3_D_shift) & rop3_D )
+  !( (~op) & ((op) << rop3_D_shift) & rop3_D )
 
 /* Transparency */
 #define source_transparent_default false

Modified: branches/chrisl-test-gs/base/gsstate.c
===================================================================
--- branches/chrisl-test-gs/base/gsstate.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsstate.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1129,7 +1129,6 @@
 {
     struct gx_cie_joint_caches_s *tmp_cie;
     gs_devicen_color_map          tmp_ccm;
-    struct gx_pattern_cache_s    *tmp_pc;
     gs_client_color              *tmp_cc;
     int                           tmp;
     gx_device_color              *tmp_dc;

Modified: branches/chrisl-test-gs/base/gstext.c
===================================================================
--- branches/chrisl-test-gs/base/gstext.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gstext.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -247,7 +247,7 @@
 	return_error(gs_error_undefinedresult); /* sic! : CPSI compatibility */
     if (text->operation & TEXT_DO_DRAW) {
 	code = gx_effective_clip_path(pgs, &pcpath);
-        gs_set_object_tag(pgs, GS_TEXT_TAG);
+        gs_set_object_tag((gs_imager_state*) pgs, GS_TEXT_TAG);
 	if (code < 0)
 	    return code;
     }
@@ -257,7 +257,7 @@
        Unfortunately we can't effectively know a leaf font type here,
        so we load the color unconditionally . */
     /* Processing a text object operation */
-    gs_set_object_tag(pgs, GS_TEXT_TAG);
+    gs_set_object_tag((gs_imager_state*) pgs, GS_TEXT_TAG);
 
     gx_set_dev_color(pgs);
     code = gs_state_color_load(pgs);
@@ -286,7 +286,7 @@
      * well.
      */
     /* Processing a text object operation */
-    gs_set_object_tag(pgs, GS_TEXT_TAG);
+    gs_set_object_tag((gs_imager_state*) pgs, GS_TEXT_TAG);
 
     if (pte->pdcolor != 0)
         gx_set_dev_color(pgs);

Modified: branches/chrisl-test-gs/base/gstrans.c
===================================================================
--- branches/chrisl-test-gs/base/gstrans.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gstrans.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -399,7 +399,7 @@
 {
     gs_pdf14trans_params_t params = { 0 };
 
-    if (check_for_nontrans_pattern(pgs,
+    if (pgs->is_gstate && check_for_nontrans_pattern(pgs,
                   (unsigned char *)"gs_end_transparency_group")) {
         return(0);
     }

Modified: branches/chrisl-test-gs/base/gstype42.c
===================================================================
--- branches/chrisl-test-gs/base/gstype42.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gstype42.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -60,6 +60,7 @@
 /* ---------------- Font level ---------------- */
 
 GS_NOTIFY_PROC(gs_len_glyphs_release);
+GS_NOTIFY_PROC(gs_gsub_release);
 
 /* Read data from sfnts. */
 int
@@ -202,6 +203,11 @@
 							"gs_type42_font_init(GSUB)");
 	    if (pfont->data.gsub == 0)
 		return_error(gs_error_VMerror);
+
+	    code = gs_font_notify_register((gs_font *)pfont, gs_gsub_release, (void *)pfont);
+	    if (code < 0)
+		return code;
+
 	    code = gs_type42_read_data(pfont, offset, pfont->data.gsub_size, pfont->data.gsub);
 	    if ( code < 0 )
 		return code;
@@ -440,6 +446,16 @@
     return 0;
 }
 
+int
+gs_gsub_release(void *data, void *event)
+{   
+    gs_font_type42 *pfont = (gs_font_type42 *)data;
+
+    gs_font_notify_unregister((gs_font *)pfont, gs_gsub_release, (void *)data);
+    gs_free_object(pfont->memory, pfont->data.gsub, "gs_gsub_release");
+    return 0;
+}
+
 /* ---------------- Glyph level ---------------- */
 
 /*
@@ -1240,7 +1256,8 @@
     return gs_imager_setflat((gs_imager_state *)pgs, 
 		gs_char_flatness((gs_imager_state *)pgs, 1.0));
 }
-
+#if 0
+/* Used only by add_simple below, which has been removed as unused. */
 /* Add 2nd degree Bezier to the path */
 static int
 add_quadratic_curve(gx_path * const ppath, const gs_fixed_point * const a,
@@ -1249,7 +1266,9 @@
     return gx_path_add_curve(ppath, (a->x + 2*b->x)/3, (a->y + 2*b->y)/3,
 	(c->x + 2*b->x)/3, (c->y + 2*b->y)/3, c->x, c->y);
 }
-
+#endif
+#if 0
+/* Used only by check_component below, which was removed as unused. */
 /*
  * Append a simple glyph outline to a path (ppath != 0) and/or return
  * its list of points (ppts != 0).
@@ -1446,7 +1465,11 @@
     }
     return 0;
 }
-
+#endif
+#if 0
+/* Used only by append_component below, which is also apprently unused and
+ * was removed by RJW.
+ */
 /* Append a glyph outline. */
 static int
 check_component(uint glyph_index, const gs_matrix_fixed *pmat,
@@ -1478,6 +1501,7 @@
     *pgd = glyph_data;
     return 1;			/* composite */
 }
+#endif
 #if 0
 /* RJW: Does not appear to be used */
 static int

Modified: branches/chrisl-test-gs/base/gsutil.c
===================================================================
--- branches/chrisl-test-gs/base/gsutil.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsutil.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -290,22 +290,20 @@
 }
 
 void
-gs_set_object_tag(gs_state * pgs, const gs_object_tag_type_t tag)
+gs_set_object_tag(gs_imager_state * pis, const gs_object_tag_type_t tag)
 {
-    if (pgs->memory->gs_lib_ctx->BITTAG != GS_DEVICE_DOESNT_SUPPORT_TAGS) {
-        if ( pgs->object_tag != tag ) {
-            pgs->object_tag = tag;
+    if (pis->memory->gs_lib_ctx->BITTAG != GS_DEVICE_DOESNT_SUPPORT_TAGS) {
+        pis->object_tag = tag;
             /* mkromfs breaks this dependance 
                NB: needs to be fixed.
                gx_unset_dev_color(pgs);
              **/
-            pgs->memory->gs_lib_ctx->BITTAG = tag;
+        pis->memory->gs_lib_ctx->BITTAG = tag;
             /* the assumption is made that the caller will:
              * gx_set_dev_color(pgs);
              */
         }
     }
-}
 
 gs_object_tag_type_t
 gs_current_object_tag(gs_memory_t * mem)

Modified: branches/chrisl-test-gs/base/gsutil.h
===================================================================
--- branches/chrisl-test-gs/base/gsutil.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gsutil.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -65,7 +65,12 @@
 
 #include "gxstate.h"
 
-void gs_set_object_tag(gs_state * pgs, const gs_object_tag_type_t tag);
+#ifndef gs_imager_state_DEFINED
+#  define gs_imager_state_DEFINED
+typedef struct gs_imager_state_s gs_imager_state;
+#endif
+
+void gs_set_object_tag(gs_imager_state * pis, const gs_object_tag_type_t tag);
 void gs_enable_object_tagging(gs_memory_t *);
 
 #endif /* gsutil_INCLUDED */

Modified: branches/chrisl-test-gs/base/gxblend.c
===================================================================
--- branches/chrisl-test-gs/base/gxblend.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxblend.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -189,7 +189,7 @@
                   row_stride, num_rows, num_cols);
     /* Transform the data */
     gscms_transform_color_buffer(icclink, &input_buff_desc, 
-                        &output_buff_desc, src, dst);
+                        &output_buff_desc, (void*) src, (void*) dst);
 }
 
 void
@@ -1173,7 +1173,9 @@
 void
 art_pdf_composite_knockout_simple_8(byte *dst,
 				    byte *dst_shape,
+                                    byte *dst_tag,
 				    const byte *src,
+                                    byte tag,
 				    int n_chan, byte opacity)
 {
     byte src_shape = src[n_chan];
@@ -1218,9 +1220,11 @@
 void
 art_pdf_composite_knockout_isolated_8(byte *dst,
 				      byte *dst_shape,
+                                      byte *dst_tag,
 				      const byte *src,
 				      int n_chan,
 				      byte shape,
+                                      byte tag,
 				      byte alpha_mask, byte shape_mask)
 {
     int tmp;
@@ -1235,6 +1239,8 @@
 	dst[n_chan] = (tmp + (tmp >> 8)) >> 8;
 	if (dst_shape != NULL)
 	    *dst_shape = 255;
+        if (dst_tag != NULL)
+            *dst_tag = tag;
     } else {
 	/* Use src_shape to interpolate (in premultiplied alpha space)
 	   between dst and (src, opacity). */
@@ -1268,8 +1274,11 @@
 	    tmp = (255 - *dst_shape) * (255 - src_shape) + 0x80;
 	    *dst_shape = 255 - ((tmp + (tmp >> 8)) >> 8);
 	}
+	if (dst_tag != NULL) {
+            *dst_tag = (*dst_tag | tag) & ~GS_UNTOUCHED_TAG;
     }
 }
+}
 
 void
 art_pdf_composite_knockout_8(byte *dst,
@@ -1389,16 +1398,13 @@
 }
 
 #if RAW_DUMP
-
 /* Debug dump of buffer data from pdf14 device.  Saved in
    planar form with global indexing and tag information in
    file name */
-
 void
 dump_raw_buffer(int num_rows, int width, int n_chan,
                 int plane_stride, int rowstride, 
                 char filename[],byte *Buffer)
-
 {
     char full_file_name[50];
     FILE *fid;
@@ -1409,34 +1415,21 @@
    /* clist_band_count is incremented at every pdf14putimage */
    /* Useful for catching this thing and only dumping */
    /* during a particular band if we have a large file */
-   /* if (clist_band_count != 80) return; */
-
+   /* if (clist_band_count != 0) return; */
     buff_ptr = Buffer;
-
     max_bands = ( n_chan < 57 ? n_chan : 56);   /* Photoshop handles at most 56 bands */
     sprintf(full_file_name,"%d)%s_%dx%dx%d.raw",global_index,filename,width,num_rows,max_bands);
     fid = fopen(full_file_name,"wb");
 
     for (z = 0; z < max_bands; ++z) {
-
         /* grab pointer to the next plane */
-
         buff_ptr = &(Buffer[z*plane_stride]);
-    
         for ( y = 0; y < num_rows; y++ ) {
-
             /* write out each row */
             fwrite(buff_ptr,sizeof(unsigned char),width,fid);
-
             buff_ptr += rowstride;
-
         }
-
     }
-
 	fclose(fid);
-
 }
-
-
 #endif

Modified: branches/chrisl-test-gs/base/gxblend.h
===================================================================
--- branches/chrisl-test-gs/base/gxblend.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxblend.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -283,17 +283,19 @@
 void
 art_pdf_composite_knockout_simple_8(byte *dst,
 				    byte *dst_shape,
-
-				    const byte *src,
+                                    byte *dst_tag,
+				    const byte *src, byte tag,
 				    int n_chan, byte opacity);
 
 /**
  * art_pdf_composite_knockout_isolated_8: Simple knockout compositing.
  * @dst: Destination pixel. 
  * @dst_shape: Shape associated with @dst.
+ * @dst_tag: Tag associated with @dst.
  * @src: Source pixel.
  * @n_chan: Number of channels.
  * @shape: Shape.
+ * @shape: Tag.
  * @alpha_mask: Alpha mask.
  * @shape_mask: Shape mask.
  *
@@ -303,9 +305,11 @@
 void
 art_pdf_composite_knockout_isolated_8(byte *dst,
 				      byte *dst_shape,
+                                      byte *dst_tag,
 				      const byte *src,
 				      int n_chan,
 				      byte shape,
+                                      byte tag,
 				      byte alpha_mask, byte shape_mask);
 
 /**
@@ -369,14 +373,8 @@
 	      int x0, int x1, int y0, int y1, int n_chan, bool additive,
 	      const pdf14_nonseparable_blending_procs_t * pblend_procs);
 
-gx_color_index pdf14_encode_smask_color(gx_device *dev, 
-             const gx_color_value colors[], int ncomp);
-
-int pdf14_decode_smask_color(gx_device * dev, gx_color_index color, 
-                             gx_color_value * out, int ncomp);
-
-
 gx_color_index pdf14_encode_color(gx_device *dev, const gx_color_value colors[]);
+gx_color_index pdf14_encode_color_tag(gx_device *dev, const gx_color_value colors[]);
 
 int pdf14_decode_color(gx_device * dev, gx_color_index color, gx_color_value * out);
 gx_color_index pdf14_compressed_encode_color(gx_device *dev, const gx_color_value colors[]);
@@ -389,6 +387,8 @@
 
 void gx_build_blended_image_row(byte *buf_ptr, int y, int planestride, 
 			   int width, int num_comp, byte bg, byte *linebuf);
+void gx_blend_image_buffer(byte *buf_ptr, int width, int height, 
+                      int rowstride, int planestride, int num_comp, byte bg);
 int gx_put_blended_image_cmykspot(gx_device *target, byte *buf_ptr, 
 		      int planestride, int rowstride,
 		      int x0, int y0, int width, int height, int num_comp, byte bg,

Modified: branches/chrisl-test-gs/base/gxblend1.c
===================================================================
--- branches/chrisl-test-gs/base/gxblend1.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxblend1.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -145,7 +145,6 @@
 void
 pdf14_preserve_backdrop(pdf14_buf *buf, pdf14_buf *tos, bool has_shape)
 {
-
     /* make copy of backdrop for compositing */
     int x0 = max(buf->rect.p.x, tos->rect.p.x);
     int x1 = min(buf->rect.q.x, tos->rect.q.x);
@@ -158,7 +157,7 @@
 	byte *tos_plane = tos->data + x0 - tos->rect.p.x + (y0 - tos->rect.p.y) * tos->rowstride;
 	int i;
 	/*int n_chan_copy = buf->n_chan + (tos->has_shape ? 1 : 0);*/
-	int n_chan_copy = tos->n_chan + (tos->has_shape ? 1 : 0);
+        int n_chan_copy = tos->n_chan + (tos->has_shape ? 1 : 0) + (tos->has_tags ? 1 : 0);
 
 	for (i = 0; i < n_chan_copy; i++) {
 		byte *buf_ptr = buf_plane;
@@ -173,32 +172,25 @@
 		buf_plane += buf->planestride;
 		tos_plane += tos->planestride;
 	    }
-	if (has_shape && !tos->has_shape)
+        if (has_shape && !tos->has_shape) {
+            if (tos->has_tags) {
+                buf_plane -= buf->planestride;
+            }
 	    memset (buf_plane, 0, buf->planestride);
     }
-
-
+    }
 #if RAW_DUMP
-
     if (x0 < x1 && y0 < y1) {
-        
         byte *buf_plane = buf->data + x0 - buf->rect.p.x + 
             (y0 - buf->rect.p.y) * buf->rowstride;
-
         dump_raw_buffer(y1-y0, x1 - x0, buf->n_planes,
                     buf->planestride, buf->rowstride, 
                     "BackDropInit",buf_plane);
-
         global_index++;
-
     }
-
 #endif
-
 }
 
-
-
 void
 pdf14_compose_group(pdf14_buf *tos, pdf14_buf *nos, pdf14_buf *maskbuf, 
 	      int x0, int x1, int y0, int y1, int n_chan, bool additive,
@@ -228,8 +220,12 @@
     int tos_shape_offset = n_chan * tos_planestride;
     int tos_alpha_g_offset = tos_shape_offset +
     (tos->has_shape ? tos_planestride : 0);
+    bool tos_has_tag = tos->has_tags;
+    int tos_tag_offset = tos_planestride * (tos->n_planes - 1);
     int nos_shape_offset = n_chan * nos_planestride;
     bool nos_has_shape = nos->has_shape;
+    bool nos_has_tag = nos->has_tags;
+    int nos_tag_offset = nos_planestride * (nos->n_planes - 1);
     byte *mask_tr_fn = NULL; /* Quiet compiler. */
 #if RAW_DUMP
     byte *composed_ptr = NULL;
@@ -237,13 +233,14 @@
 
     rect_merge(nos->bbox, tos->bbox);
 
-    if_debug6('v', "pdf14_pop_transparency_group y0 = %d, y1 = %d, w = %d, alpha = %d, shape = %d, bm = %d\n",
+    if_debug6('v', "pdf14_pop_transparency_group y0 = %d, y1 = %d, w = %d, alpha = %d, shape = %d, tag =  bm = %d\n",
 			y0, y1, width, alpha, shape, blend_mode);
     if (nos->has_alpha_g)
 	nos_alpha_g_ptr = nos_ptr + n_chan * nos_planestride;
     else
 	nos_alpha_g_ptr = NULL;
 
+
     if (maskbuf != NULL) { 
        
         mask_tr_fn = maskbuf->transfer_fn;
@@ -330,15 +327,20 @@
 	    if (nos_knockout) {
 		byte *nos_shape_ptr = nos_has_shape ?
 		    &nos_ptr[x + nos_shape_offset] : NULL;
+                byte *nos_tag_ptr = nos_has_tag ?
+                    &nos_ptr[x + nos_tag_offset] : NULL;
 		byte tos_shape = tos_ptr[x + tos_shape_offset];
-
+		byte tos_tag = tos_ptr[x + tos_tag_offset];
 		art_pdf_composite_knockout_isolated_8(nos_pixel,
 						    nos_shape_ptr,
+                                                    nos_tag_ptr,
 						    tos_pixel,
 						    n_chan - 1,
 						    tos_shape,
+                                                    tos_tag,
 						    pix_alpha, shape);
-	    } else if (tos_isolated) {
+            } else {
+                if (tos_isolated) {
 		art_pdf_composite_group_8(nos_pixel, nos_alpha_g_ptr,
 				    tos_pixel, n_chan - 1,
 				    pix_alpha, blend_mode, pblend_procs);
@@ -348,13 +350,24 @@
 				    tos_pixel, tos_alpha_g, n_chan - 1,
 				    pix_alpha, blend_mode, pblend_procs);
 	    }
+                if (tos_has_tag) {
+                    if (pix_alpha == 255) {
+                        nos_ptr[x + nos_tag_offset] = tos_ptr[x + tos_tag_offset];     
+                    } else if (tos_ptr[x + tos_tag_offset] != GS_UNTOUCHED_TAG) {  
+                        nos_ptr[x + nos_tag_offset] = 
+                            (nos_ptr[x + nos_tag_offset] | 
+                            tos_ptr[x + tos_tag_offset]) &
+                            ~GS_UNTOUCHED_TAG;     
+                    }
+                }
+            }
 	    if (nos_has_shape) {
 		nos_ptr[x + nos_shape_offset] =
 		    art_pdf_union_mul_8 (nos_ptr[x + nos_shape_offset],
 					    tos_ptr[x + tos_shape_offset],
 					    shape);
+
 	    }
-        
 	    /* Complement the results for subtractive color spaces */
 	    if (additive) {
 		for (i = 0; i < n_chan; ++i) {
@@ -393,7 +406,7 @@
 #if RAW_DUMP
 
 	/* The group alpha should disappear */
-    dump_raw_buffer(y1-y0, width, tos->n_planes - tos->has_alpha_g,
+    dump_raw_buffer(y1-y0, width, tos->n_planes - tos->has_alpha_g - tos->has_shape,
                 nos_planestride, nos->rowstride, 
                 "Composed",composed_ptr);
 
@@ -405,16 +418,15 @@
 }
 
 /*
- * Encode a list of smask colorant values into a gx_color_index_value.
- * This has its own encoder as it may have a different number of colorants
- * compared to the actual device.
+ * Encode a list of colorant values into a gx_color_index_value.
  */
 gx_color_index
-pdf14_encode_smask_color(gx_device *dev, const gx_color_value	colors[],int ncomp)
+pdf14_encode_color(gx_device *dev, const gx_color_value	colors[])
 {
     int drop = sizeof(gx_color_value) * 8 - 8;
     gx_color_index color = 0;
     int i;
+    int ncomp = dev->color_info.num_components;
 
     for (i = 0; i < ncomp; i++) {
 	color <<= 8;
@@ -424,33 +436,20 @@
 }
 
 /*
- * Decode a gx_color_index value back to a list of colorant values.
-  * This has its own decoder as it may have a different number of colorants
- * compared to the actual device.*/
-int
-pdf14_decode_smask_color(gx_device * dev, gx_color_index color, gx_color_value * out, int ncomp)
-{
-    int i;
-
-    for (i = 0; i < ncomp; i++) {
-	out[ncomp - i - 1] = (gx_color_value) ((color & 0xff) * 0x101);
-	color >>= 8;
-    }
-    return 0;
-}
-
-
-/*
  * Encode a list of colorant values into a gx_color_index_value.
+   Stick the tag information at the end.  
  */
 gx_color_index
-pdf14_encode_color(gx_device *dev, const gx_color_value	colors[])
+pdf14_encode_color_tag(gx_device *dev, const gx_color_value colors[])
 {
     int drop = sizeof(gx_color_value) * 8 - 8;
-    gx_color_index color = 0;
+    gx_color_index color;
     int i;
     int ncomp = dev->color_info.num_components;
+    int tag_value;
 
+    /* Add in the tag information */
+    color = gs_current_object_tag(dev->memory);
     for (i = 0; i < ncomp; i++) {
 	color <<= 8;
 	color |= (colors[i] >> drop);
@@ -724,6 +723,38 @@
     }
 }
 
+void
+gx_blend_image_buffer(byte *buf_ptr, int width, int height, int rowstride, 
+                      int planestride, int num_comp, byte bg)
+{
+    int x, y;
+    int position;
+    byte comp, a;
+    int tmp, comp_num;
+
+    for (y = 0; y < height; y++) {
+        position = y * rowstride;
+        for (x = 0; x < width; x++) {
+	    /* composite RGBA (or CMYKA, etc.) pixel with over solid background */
+            a = buf_ptr[position + planestride * num_comp];
+	    if ((a + 1) & 0xfe) {
+	        a ^= 0xff;
+	        for (comp_num = 0; comp_num < num_comp; comp_num++) {
+		    comp  = buf_ptr[position + planestride * comp_num];
+		    tmp = ((bg - comp) * a) + 0x80;
+		    comp += (tmp + (tmp >> 8)) >> 8;
+		    buf_ptr[position + planestride * comp_num] = comp;
+	        }
+	    } else if (a == 0) {
+	        for (comp_num = 0; comp_num < num_comp; comp_num++) {
+		    buf_ptr[position + planestride * comp_num] = bg;
+	        }
+	    }
+            position+=1;
+        }
+    }
+}
+
 int
 gx_put_blended_image_cmykspot(gx_device *target, byte *buf_ptr, 
 		      int planestride, int rowstride,

Modified: branches/chrisl-test-gs/base/gxccman.c
===================================================================
--- branches/chrisl-test-gs/base/gxccman.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxccman.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -608,6 +608,8 @@
 	/* Pass the correct target, but decrement its refct afterwards. */
 	gs_make_mem_mono_device(pdev, pdev->memory, target);
 	rc_decrement_only(target, "gx_alloc_char_bits"); /* can't go to 0 */
+        /* Decrement the ICC profile also.  Same device is getting reinitialized */
+        if (target != NULL) rc_decrement(target->device_icc_profile,"gx_alloc_char_bits(icc profile)");
 	pdev->rc = rc;
 	pdev->retained = retained;
 	pdev->width = iwidth;

Modified: branches/chrisl-test-gs/base/gxchar.c
===================================================================
--- branches/chrisl-test-gs/base/gxchar.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxchar.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1056,8 +1056,11 @@
 		        /* If antialiasing is in effect, don't use xfont */
 		        if (log2_scale.x + log2_scale.y > 0)
 			    goto no_cache;
+			/* Don't use xfont for outline (stroked) fonts or
+			 * as the descendant of a type 0 font.
+			 */
 			if (pfont->ExactSize == fbit_use_outlines ||
-			    pfont->PaintType == 2
+			    pfont->PaintType == 2 || rfont->FontType == 0
 			    )
 			    goto no_cache;
 			if (pfont->BitmapWidths) {

Modified: branches/chrisl-test-gs/base/gxclbits.c
===================================================================
--- branches/chrisl-test-gs/base/gxclbits.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxclbits.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -471,7 +471,7 @@
     slot->x_reps = slot->y_reps = 1;
     slot->id = tiles->id;
     memset(ts_mask(slot), 0, cldev->tile_band_mask_size);
-    bytes_copy_rectangle(ts_bits(cldev, slot), raster,
+    bytes_copy_rectangle_zero_padding(ts_bits(cldev, slot), raster,
 			 tiles->data, sraster,
 			 (tiles->rep_width * depth + 7) >> 3,
 			 tiles->rep_height);

Modified: branches/chrisl-test-gs/base/gxclimag.c
===================================================================
--- branches/chrisl-test-gs/base/gxclimag.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxclimag.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -299,8 +299,17 @@
     /* Don't band if the matrix is (nearly) singular. */
     if (fabs(pmat->xx * pmat->yy - pmat->xy * pmat->yx) < 0.001)
 	return false;
-    if (is_xxyy(pmat) || is_xyyx(pmat))
-	return true;
+    /* If it's portrait, then we encode it if not a downscale */
+    if (is_xxyy(pmat))
+        return (fabs(pmat->xx) >= 1) && (fabs(pmat->yy) >= 1);
+    /* If it's landscape, then we encode it if not a downscale */
+    if (is_xyyx(pmat))
+        return (fabs(pmat->xy) >= 1) && (fabs(pmat->yx) >= 1);
+    /* Skewed, so do more expensive downscale test */
+    if ((pmat->xx * pmat->xx + pmat->xy * pmat->xy < 1.0) ||
+        (pmat->yx * pmat->yx + pmat->yy * pmat->yy < 1.0))
+        return false;
+    /* Otherwise only encode it if it doesn't rotate too much */
     t = (fabs(pmat->xx) + fabs(pmat->yy)) /
 	(fabs(pmat->xy) + fabs(pmat->yx));
     return (t < 0.2 || t > 5);
@@ -331,6 +340,7 @@
     gs_image_format_t format;
     gx_color_index colors_used = 0;
     int code;
+    bool mask_use_hl;
 
     /* We can only handle a limited set of image types. */
     switch ((gs_debug_c('`') ? -1 : pic->type->index)) {
@@ -387,26 +397,41 @@
 	for (i = 1; i < pie->num_planes; ++i)
 	    varying_depths |= pie->plane_depths[i] != pie->plane_depths[0];
     }
-    if (code < 0 ||
-	!USE_HL_IMAGES ||	/* Always use the default. */
-	(cdev->disable_mask & clist_disable_hl_image) || 
-	cdev->image_enum_id != gs_no_id ||  /* Can't handle nested images */
+
+    /* Now, check to see if we can't handle this as a high level image. */
+    if (code < 0)
+        goto use_default;
+    if (!USE_HL_IMAGES) /* Always use the default. */
+        goto use_default;
+    if (cdev->disable_mask & clist_disable_hl_image)
+        goto use_default;
+    if (cdev->image_enum_id != gs_no_id) /* Can't handle nested images */
+        goto use_default;
+    if (base_index > gs_color_space_index_DeviceCMYK &&
+        base_index != gs_color_space_index_ICC)
 	/****** Can only handle Gray, RGB, CMYK and ICC ******/
-	( base_index > gs_color_space_index_DeviceCMYK &&
-        base_index != gs_color_space_index_ICC ) ||
+        goto use_default;
+    if (has_alpha)
 	/****** CAN'T HANDLE IMAGES WITH ALPHA YET ******/
-	has_alpha ||
+        goto use_default;
+    if (varying_depths)
 	/****** CAN'T HANDLE IMAGES WITH IRREGULAR DEPTHS ******/
-	varying_depths ||
-	(code = gs_matrix_invert(&pim->ImageMatrix, &mat)) < 0 ||
+        goto use_default;
+    if ((code = gs_matrix_invert(&pim->ImageMatrix, &mat)) < 0 ||
 	(code = gs_matrix_multiply(&mat, &ctm_only(pis), &mat)) < 0 ||
 	!(cdev->disable_mask & clist_disable_nonrect_hl_image ?
 	  (is_xxyy(&mat) || is_xyyx(&mat)) :
-	  image_matrix_ok_to_band(&mat)) ||
-	/****** CAN'T HANDLE NON-PURE COLORS YET ******/
-	(uses_color && !gx_dc_is_pure(pdcolor) && !gx_dc_is_pattern1_color_clist_based(pdcolor))
-	)
+          image_matrix_ok_to_band(&mat)))
 	goto use_default;
+
+    mask_use_hl =
+        masked && ( gx_dc_is_pattern1_color(pdcolor) || gx_dc_is_pure(pdcolor) );
+    if (!mask_use_hl && uses_color && !gx_dc_is_pure(pdcolor) &&
+             !gx_dc_is_pattern1_color_clist_based(pdcolor))
+        /* Only add in masks that are pure or pattern or pattern trans types */
+        goto use_default;
+
+    /* We've passed the tests; code it as a high level image */
     {
 	int bytes_per_plane, bytes_per_row;
 

Modified: branches/chrisl-test-gs/base/gxclip.c
===================================================================
--- branches/chrisl-test-gs/base/gxclip.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxclip.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -121,6 +121,8 @@
     dev->HWResolution[1] = target->HWResolution[1];
     dev->sgr = target->sgr;
     dev->target = target;
+    dev->device_icc_profile = target->device_icc_profile;
+    /* There is no finalization for device on stack so no rc increment */
     (*dev_proc(dev, open_device)) ((gx_device *)dev);
 }
 void

Modified: branches/chrisl-test-gs/base/gxclist.c
===================================================================
--- branches/chrisl-test-gs/base/gxclist.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxclist.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -190,8 +190,8 @@
     gx_forward_ret_devn_params,
     clist_fillpage,
     NULL,                      /* push_transparency_state */
-    NULL                       /* pop_transparency_state */
-
+    NULL,                      /* pop_transparency_state */
+    NULL                       /* put_image */
 };
 
 /*------------------- Choose the implementation -----------------------
@@ -793,6 +793,7 @@
 	 * Write the terminating entry in the block file.
 	 * Note that because of copypage, there may be many such entries.
 	 */
+        memset(&cb, 0, sizeof(cb)); /* Zero the block, including any padding */
 	cb.band_min = cb.band_max = cmd_band_end;
 	cb.pos = (cldev->page_cfile == 0 ? 0 : cldev->page_info.io_procs->ftell(cldev->page_cfile));
 	code = cldev->page_info.io_procs->fwrite_chars(&cb, sizeof(cb), cldev->page_bfile);

Modified: branches/chrisl-test-gs/base/gxclist.h
===================================================================
--- branches/chrisl-test-gs/base/gxclist.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxclist.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -222,14 +222,14 @@
 
     clist_icc_serial_entry_t serial_data;
     clist_icctable_entry_t *next;  /* The next entry in the table */ 
-    cmm_profile_t *icc_profile;    /* The profile.  This is written out at the end of the writer phase */
-
+    cmm_profile_t *icc_profile;    /* The profile.  In non-gc memory. This is 
+                                      written out at the end of the writer phase */
 };
 
 #define private_st_clist_icctable_entry()\
-  gs_private_st_ptrs2(st_clist_icctable_entry,\
+  gs_private_st_ptrs1(st_clist_icctable_entry,\
 		clist_icctable_entry_t, "clist_icctable_entry",\
-		clist_icctable_entry_enum_ptrs, clist_icctable_entry_reloc_ptrs, next, icc_profile)
+		clist_icctable_entry_enum_ptrs, clist_icctable_entry_reloc_ptrs, next)
 
 typedef struct clist_icctable_s clist_icctable_t;
 

Modified: branches/chrisl-test-gs/base/gxclrast.c
===================================================================
--- branches/chrisl-test-gs/base/gxclrast.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxclrast.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -196,13 +196,13 @@
 cmd_read_data(command_buf_t *pcb, byte *ptr, uint rsize, const byte *cbp)
 {
     if (pcb->end - cbp >= rsize) {
-	memcpy(ptr, cbp, rsize);
+        memmove(ptr, cbp, rsize);
 	return cbp + rsize;
     } else {
 	uint cleft = pcb->end - cbp;
 	uint rleft = rsize - cleft;
 
-	memcpy(ptr, cbp, cleft);
+        memmove(ptr, cbp, cleft);
 	sgets(pcb->s, ptr + cleft, rleft, &rleft);
 	return pcb->end;
     }
@@ -1295,6 +1295,8 @@
 				  image.d.Width, image.d.Height);
 ibegin:			if_debug0('L', "\n");
 			{
+                            /* Processing an image operation */
+                            gs_set_object_tag(&imager_state, GS_IMAGE_TAG);
 			    code = (*dev_proc(tdev, begin_typed_image))
 				(tdev, &imager_state, NULL,
 				 (const gs_image_common_t *)&image,
@@ -1804,9 +1806,9 @@
 			case cmd_opv_stroke:
 			    stroke_params.flatness = imager_state.flatness;
 			    stroke_params.traditional = false;
-			    code = gx_stroke_path_only(ppath,
-						       (gx_path *) 0, tdev,
-					      &imager_state, &stroke_params,
+                            code = (*dev_proc(tdev, stroke_path))
+                                                       (tdev, &imager_state,
+                                                       ppath, &stroke_params,
 						       &dev_color, pcpath);
 			    break;
 			case cmd_opv_polyfill:

Modified: branches/chrisl-test-gs/base/gxcmap.c
===================================================================
--- branches/chrisl-test-gs/base/gxcmap.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxcmap.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -576,7 +576,7 @@
 /* Indicate that a color cannot be concretized. */
 int
 gx_no_concretize_color(const gs_client_color * pcc, const gs_color_space * pcs,
-		       frac * pconc, const gs_imager_state * pis)
+		       frac * pconc, const gs_imager_state * pis, gx_device *dev)
 {
     return_error(gs_error_rangecheck);
 }
@@ -591,7 +591,7 @@
     frac conc[GS_CLIENT_COLOR_MAX_COMPONENTS];
     const gs_color_space *pconcs;
     int i = pcs->type->num_components(pcs);
-    int code = (*pcs->type->concretize_color)(pcc, pcs, conc, pis);
+    int code = (*pcs->type->concretize_color)(pcc, pcs, conc, pis, dev);
 
     if (code < 0)
 	return code;
@@ -614,7 +614,7 @@
 /* DeviceGray */
 int
 gx_concretize_DeviceGray(const gs_client_color * pc, const gs_color_space * pcs,
-			 frac * pconc, const gs_imager_state * pis)
+			 frac * pconc, const gs_imager_state * pis, gx_device *dev)
 {
     pconc[0] = gx_unit_frac(pc->paint.values[0]);
     return 0;
@@ -655,7 +655,7 @@
 /* DeviceRGB */
 int
 gx_concretize_DeviceRGB(const gs_client_color * pc, const gs_color_space * pcs,
-			frac * pconc, const gs_imager_state * pis)
+			frac * pconc, const gs_imager_state * pis, gx_device *dev)
 {
     pconc[0] = gx_unit_frac(pc->paint.values[0]);
     pconc[1] = gx_unit_frac(pc->paint.values[1]);
@@ -701,7 +701,7 @@
 /* DeviceCMYK */
 int
 gx_concretize_DeviceCMYK(const gs_client_color * pc, const gs_color_space * pcs,
-			 frac * pconc, const gs_imager_state * pis)
+			 frac * pconc, const gs_imager_state * pis, gx_device *dev)
 {
     pconc[0] = gx_unit_frac(pc->paint.values[0]);
     pconc[1] = gx_unit_frac(pc->paint.values[1]);
@@ -1185,7 +1185,7 @@
 }
 
 static int
-devicen_icc_cmyk(frac cm_comps[], const gs_imager_state * pis)
+devicen_icc_cmyk(frac cm_comps[], const gs_imager_state * pis, gx_device *dev)
 {
     gsicc_link_t *icc_link;
     gsicc_rendering_param_t rendering_params;
@@ -1202,9 +1202,8 @@
     for (k = 0; k < 4; k++){
         psrc[k] = frac2cv(cm_comps[k]);
     }
-    icc_link = gsicc_get_link_profile(pis, pis->icc_manager->default_cmyk, 
-                pis->icc_manager->device_profile,
-                &rendering_params, pis->memory, false);
+    icc_link = gsicc_get_link_profile(pis, dev, pis->icc_manager->default_cmyk, 
+                dev->device_icc_profile, &rendering_params, pis->memory, false);
     /* Transform the color */
     if (icc_link->is_identity) {
         psrc_temp = &(psrc[0]);
@@ -1243,8 +1242,8 @@
     map_components_to_colorants(pcc, &(pis->color_component_map), cm_comps);
     /* See comments in cmap_devicen_direct for details on below operations */
     if (devicen_has_cmyk(dev) && 
-        pis->icc_manager->device_profile->data_cs == gsCMYK) {
-        code = devicen_icc_cmyk(cm_comps, pis);
+        dev->device_icc_profile->data_cs == gsCMYK) {
+        code = devicen_icc_cmyk(cm_comps, pis, dev);
     } 
     /* apply the transfer function(s); convert to color values */
     if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)
@@ -1294,14 +1293,14 @@
        20% M 0% Y 0% K. Hence the CMYK values should go through the same
        color management as a stand alone CMYK value.  */
     if (devicen_has_cmyk(dev) && 
-        pis->icc_manager->device_profile->data_cs == gsCMYK) {
+        dev->device_icc_profile->data_cs == gsCMYK) {
         /* We need to do a CMYK to CMYK conversion here.  This will always
            use the default CMYK profile and the device's output profile.
            We probably need to add some checking here
            and possibly permute the colorants, much as is done on the input
            side for the case when we add DeviceN icc source profiles for use
            in PDF and PS data. */
-        code = devicen_icc_cmyk(cm_comps, pis);
+        code = devicen_icc_cmyk(cm_comps, pis, dev);
     } 
     /* apply the transfer function(s); convert to color values */
     if (dev->color_info.polarity == GX_CINFO_POLARITY_ADDITIVE)

Modified: branches/chrisl-test-gs/base/gxcolor2.h
===================================================================
--- branches/chrisl-test-gs/base/gxcolor2.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxcolor2.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -83,6 +83,7 @@
      * for bitmap patterns that don't have explicit transparent pixels.
      */
     bool uses_mask;	        /* if true, pattern mask must be created */
+    bool is_clist;		/* if false, automatically determine and set, if true, use_clist */
     gs_int_point size;		/* in device coordinates */
     gx_bitmap_id id;		/* key for cached bitmap (= id of mask) */
 };

Modified: branches/chrisl-test-gs/base/gxcspace.h
===================================================================
--- branches/chrisl-test-gs/base/gxcspace.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxcspace.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -117,9 +117,9 @@
 
 #define cs_proc_concretize_color(proc)\
   int proc(const gs_client_color *, const gs_color_space *,\
-    frac *, const gs_imager_state *)
-#define cs_concretize_color(pcc, pcs, values, pis)\
-  (*(pcs)->type->concretize_color)(pcc, pcs, values, pis)
+    frac *, const gs_imager_state *, gx_device *)
+#define cs_concretize_color(pcc, pcs, values, pis, dev)\
+  (*(pcs)->type->concretize_color)(pcc, pcs, values, pis, dev)
 	cs_proc_concretize_color((*concretize_color));
 
     /* Map a concrete color to a device color. */

Modified: branches/chrisl-test-gs/base/gxdevcli.h
===================================================================
--- branches/chrisl-test-gs/base/gxdevcli.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxdevcli.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -36,6 +36,7 @@
 #include "gxcmap.h"
 #include "gsnamecl.h"
 #include "gp.h"
+#include "gscms.h"
 
 /* See Drivers.htm for documentation of the driver interface. */
 
@@ -730,6 +731,8 @@
 	long band_offset_x;		/* offsets of clist band base to (mem device) buffer */\
 	long band_offset_y;		/* for rendering that is phase sensitive (wtsimdi) */\
 	gx_stroked_gradient_recognizer_t sgr;\
+	int MaxPatternBitmap;		/* Threshold for switching to pattern_clist mode */\
+        cmm_profile_t *device_icc_profile;     /* Device profile in non-gc memory */\
 	gx_page_device_procs page_procs;	/* must be last */\
 		/* end of std_device_body */\
 	gx_device_procs procs	/* object procedures */
@@ -1411,6 +1414,13 @@
 #define dev_proc_pop_transparency_state(proc)\
   dev_t_proc_pop_transparency_state(proc, gx_device)
 
+#define dev_t_proc_put_image(proc, dev_t)\
+  int proc(gx_device *dev, const byte *buffer, int num_chan, int x, int y,\
+            int width, int height, int row_stride, int plane_stride,\
+            int alpha_plane_index, int tag_plane_index)
+#define dev_proc_put_image(proc)\
+  dev_t_proc_put_image(proc, gx_device)
+
 /* Define the device procedure vector template proper. */
 
 #define gx_device_proc_struct(dev_t)\
@@ -1478,6 +1488,7 @@
 	dev_t_proc_fillpage((*fillpage), dev_t); \
         dev_t_proc_push_transparency_state((*push_transparency_state), dev_t); \
         dev_t_proc_pop_transparency_state((*pop_transparency_state), dev_t); \
+        dev_t_proc_put_image((*put_image), dev_t); \
 }
 
 /*

Modified: branches/chrisl-test-gs/base/gxdevice.h
===================================================================
--- branches/chrisl-test-gs/base/gxdevice.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxdevice.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -102,7 +102,8 @@
 #define std_device_part3_()\
 	0/*PageCount*/, 0/*ShowpageCount*/, 1/*NumCopies*/, 0/*NumCopies_set*/,\
 	0/*IgnoreNumCopies*/, 0/*UseCIEColor*/, 0/*LockSafetyParams*/,\
-	0/*band_offset_x*/, 0/*band_offset_y*/, {false}/* sgr */,\
+	0/*band_offset_x*/, 0/*band_offset_y*/, {false}/* sgr */, 0/* MaxPatternBitmap */,\
+	0/*Profile*/,\
 	{ gx_default_install, gx_default_begin_page, gx_default_end_page }
 /*
  * We need a number of different variants of the std_device_ macro simply

Modified: branches/chrisl-test-gs/base/gxfcopy.c
===================================================================
--- branches/chrisl-test-gs/base/gxfcopy.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxfcopy.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -37,6 +37,7 @@
 #include "gxtype1.h"		/* for Type 1 glyph_outline */
 #include "gzstate.h"		/* for path for BuildChar */
 #include "gdevpsf.h"
+#include "smd5.h"		/* Create MD5 hash of Subrs when comparing fonts */
 
 #define GLYPHS_SIZE_IS_PRIME 1 /* Old code = 0, new code = 1. */
 
@@ -1101,57 +1102,47 @@
     copied_encode_char, gs_type1_glyph_info, copied_type1_glyph_outline
 };
 
-static bool 
-same_type1_subrs(const gs_font_type1 *cfont, const gs_font_type1 *ofont, 
-		 bool global)
+static void hash_subrs(gs_font_type1 *pfont)
 {
-    gs_glyph_data_t gdata0, gdata1;
-    int i, code = 0;
-    bool exit = false;
+    gs_type1_data *d0 = &pfont->data;
+    gs_glyph_data_t gdata0;
+    gs_md5_state_t md5;
+    int i, exit = 0;
 
-    gdata0.memory = cfont->memory;
-    gdata1.memory = ofont->memory;
+    gs_md5_init(&md5);
+    gdata0.memory = pfont->memory;
     /* Scan the font to determine the size of the subrs. */
     for (i = 0; !exit; i++) {
-	int code0 = cfont->data.procs.subr_data((gs_font_type1 *)cfont, 
-						i, global, &gdata0);
-	int code1 = ofont->data.procs.subr_data((gs_font_type1 *)ofont, 
-						i, global, &gdata1);
-	bool missing0, missing1;
-	
-	if (code0 == gs_error_rangecheck && code1 == gs_error_rangecheck)
-	    return 1; /* Both arrays exceeded. */
-	/*  Some fonts use null for skiping elements in subrs array. 
-	    This gives typecheck.
-	*/
-	missing0 = (code0 == gs_error_rangecheck || code0 == gs_error_typecheck);
-	missing1 = (code1 == gs_error_rangecheck || code1 == gs_error_typecheck);
-	if (missing0 && missing1)
-	    continue;
-	if (missing0 && !missing1)
-	    return 0; /* The copy has insufficient subrs. */
-	if (missing1)
-	    continue;
+	int code0 = pfont->data.procs.subr_data((gs_font_type1 *)pfont, 
+						i, true, &gdata0);
 	if (code0 < 0)
-	    code = code0, exit = true;
-	else if (code1 < 0)
-	    code = code1, exit = true;
-	else if (gdata0.bits.size != gdata1.bits.size)
 	    exit = true;
-	else if (memcmp(gdata0.bits.data, gdata1.bits.data, gdata0.bits.size))
+	else {
+	    gs_md5_append(&md5, gdata0.bits.data, gdata0.bits.size);
+	    gs_glyph_data_free(&gdata0, "hash_type1_subrs");
+	}
+    }
+    exit = 0;
+    /* Scan the font to determine the size of the subrs. */
+    for (i = 0; !exit; i++) {
+	int code0 = pfont->data.procs.subr_data((gs_font_type1 *)pfont, 
+						i, false, &gdata0);
+	if (code0 < 0)
 	    exit = true;
-	if (code0 > 0)
-	    gs_glyph_data_free(&gdata0, "same_type1_subrs");
-	if (code1 > 0)
-	    gs_glyph_data_free(&gdata1, "same_type1_subrs");
+	else {
+	    gs_md5_append(&md5, gdata0.bits.data, gdata0.bits.size);
+	    gs_glyph_data_free(&gdata0, "hash_type1_subrs");
     }
-    return code;
 }
+    gs_md5_finish(&md5, d0->hash_subrs);
+}
 
 static bool 
 same_type1_hinting(const gs_font_type1 *cfont, const gs_font_type1 *ofont)
 {
     const gs_type1_data *d0 = &cfont->data, *d1 = &ofont->data;
+    int *hash0 = (int *)&d0->hash_subrs;
+    int *hash1 = (int *)&d1->hash_subrs;
 
     if (d0->lenIV != d1->lenIV)
 	return false;
@@ -1189,10 +1180,12 @@
 	return false;
     if (!compare_tables(d0->WeightVector, d1->WeightVector))
 	return false;
-    if (!same_type1_subrs(cfont, ofont, false))
+    if (hash0[0] == 0x00 && hash0[1] == 0x00 && hash0[2] == 0x00 && hash0[3] == 0x00)
+	hash_subrs((gs_font_type1 *)cfont);
+    if (hash1[0] == 0x00 && hash1[1] == 0x00 && hash1[2] == 0x00 && hash1[3] == 0x00)
+	hash_subrs((gs_font_type1 *)ofont);
+    if (memcmp(d0->hash_subrs, d1->hash_subrs, 16) != 0)
 	return false;
-    if (!same_type1_subrs(cfont, ofont, true))
-	return false;
     /*
      *	We ignore differences in OtherSubrs because pdfwrite
      *	must build without PS interpreter and therefore copied font
@@ -1345,8 +1338,22 @@
 
     gdata.memory = font42->memory;
     code = font42->data.get_outline(font42, gid, &gdata);
+    /* If the glyph is a /.notdef, and the GID is not 0, and we failed to find 
+     * the /.notdef, try again with GID 0. We have seen fonts from GraphPad
+     * Prism which end up putting the /.notdef in the CharStrings dictionary
+     * with the wrong GID value (Bug #691573)
+     */
+    if (code < 0 && gid != 0) {
+	gs_const_string gnstr;
+	if (font->procs.glyph_name(font, glyph, &gnstr) >= 0 && gnstr.size == 7
+	    && !memcmp(gnstr.data, ".notdef", 7)) {
+	    gid = 0;
+	    code = font42->data.get_outline(font42, gid, &gdata);
+	} 
+    }
     if (code < 0)
 	return code;
+
     code = copy_glyph_data(font, gid + GS_MIN_GLYPH_INDEX, copied, options,
 			   &gdata, NULL, 0);
     if (code < 0)

Modified: branches/chrisl-test-gs/base/gxfont1.h
===================================================================
--- branches/chrisl-test-gs/base/gxfont1.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxfont1.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -137,6 +137,7 @@
     /* Additional information for Multiple Master fonts */
 #define max_WeightVector 16
     float_array(max_WeightVector) WeightVector;
+    byte hash_subrs[16];	/* Used only for checking font copyign compatibility */
 };
 
 #define gs_type1_data_s_DEFINED

Modified: branches/chrisl-test-gs/base/gxi12bit.c
===================================================================
--- branches/chrisl-test-gs/base/gxi12bit.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxi12bit.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -31,7 +31,16 @@
 #include "gxcpath.h"
 #include "gximage.h"
 #include "vdtrace.h"
+#include "gsicc.h"
+#include "gsicc_cache.h"
+#include "gsicc_littlecms.h"
+#include "gxcie.h"
+#include "gscie.h"
 
+extern void cmap_transfer_halftone(gx_color_value *pconc, gx_device_color * pdc,
+     const gs_imager_state * pis, gx_device * dev, bool has_transfer,
+     bool has_halftone, gs_color_select_t select);
+
 /* ---------------- Unpacking procedures ---------------- */
 
 static const byte *
@@ -99,6 +108,8 @@
 
 /* Use special (slow) logic for 12-bit source values. */
 static irender_proc(image_render_frac);
+static irender_proc(image_render_icc16); /* icc 16bit case */
+
 irender_proc_t
 gs_image_class_2_fracs(gx_image_enum * penum)
 {
@@ -111,9 +122,54 @@
 		penum->mask_color.values[i] =
 		    bits2frac(penum->mask_color.values[i], 12);
 	}
+        if ( (gs_color_space_get_index(penum->pcs) == gs_color_space_index_DeviceN &&
+            penum->pcs->cmm_icc_profile_data == NULL) || penum->use_mask_color || 
+            penum->bps != 16 || 
+            gs_color_space_get_index(penum->pcs) == gs_color_space_index_DevicePixel) { 
+            /* DevicePixel color space used in mask from 3x type.  Basically
+               a simple color space that just is scaled to the device bit 
+               depth when remapped. No CM needed */
 	if_debug0('b', "[b]render=frac\n");
 	return &image_render_frac;
+        } else {
+            /* Set up the link now */
+            const gs_color_space *pcs;
+            gsicc_rendering_param_t rendering_params;
+            int k;
+            int src_num_comp = cs_num_components(penum->pcs);
+
+             penum->icc_setup.need_decode = false;
+            /* Check if we need to do any decoding.  If yes, then that will slow us down */
+            for (k = 0; k < src_num_comp; k++) {
+                if ( penum->map[k].decoding != sd_none ) {
+                    penum->icc_setup.need_decode = true;
+                    break;
     }
+            }
+            /* Define the rendering intents */
+            rendering_params.black_point_comp = BP_ON;
+            rendering_params.object_type = GS_IMAGE_TAG;
+            rendering_params.rendering_intent = penum->pis->renderingintent;
+            if (gs_color_space_is_PSCIE(penum->pcs) && penum->pcs->icc_equivalent != NULL) {
+                pcs = penum->pcs->icc_equivalent;
+            } else {
+                pcs = penum->pcs;
+            }
+            penum->icc_setup.is_lab = pcs->cmm_icc_profile_data->islab;
+            penum->icc_setup.must_halftone = gx_device_must_halftone(penum->dev);
+            penum->icc_setup.has_transfer = gx_has_transfer(penum->pis,
+                                    penum->dev->device_icc_profile->num_comps);
+            if (penum->icc_setup.is_lab) penum->icc_setup.need_decode = false;
+            if (penum->icc_link == NULL) {
+                penum->icc_link = gsicc_get_link(penum->pis, penum->dev, pcs, NULL, 
+                    &rendering_params, penum->memory, false);
+            }
+            /* Use the direct unpacking proc */
+            penum->unpack = sample_unpackicc_16_proc;
+            if_debug0('b', "[b]render=icc16\n");
+            return &image_render_icc16;
+        }
+    }
     return 0;
 }
 
@@ -401,3 +457,319 @@
     penum->used.y = 0;
     return code;
 }
+
+static inline float
+rescale_input_color(gs_range range, float input)
+{
+    return((input-range.rmin)/(range.rmax-range.rmin));
+}
+
+
+/* This one includes an extra adjustment for the CIE PS color space 
+   non standard range */
+static void 
+decode_row_cie16(const gx_image_enum *penum, const unsigned short *psrc, 
+                 int spp, unsigned short *pdes, 
+                  const unsigned short *bufend, gs_range range_array[])
+{
+    unsigned short *curr_pos = pdes;
+    int k;
+    float temp;
+
+    while ( curr_pos < bufend ) {
+        for ( k = 0; k < spp; k ++ ) {
+            switch ( penum->map[k].decoding ) {
+                case sd_none:
+                    *curr_pos = *psrc;
+                    break;
+                case sd_lookup:	
+                    temp = penum->map[k].decode_lookup[(*psrc) >> 4]*65535.0;
+                    temp = rescale_input_color(range_array[k], temp);
+                    temp = temp*65535;
+                    if (temp > 65535.0) temp = 65535.0;
+                    if (temp < 0 ) temp = 0;
+                    *curr_pos = (unsigned short) temp;
+                    break;
+                case sd_compute:
+                    temp = penum->map[k].decode_base + 
+                        (*psrc) * penum->map[k].decode_factor;
+                    temp = rescale_input_color(range_array[k], temp);
+                    temp = temp*65535;
+                    if (temp > 65535) temp = 65535;
+                    if (temp < 0 ) temp = 0;
+                    *curr_pos = (unsigned short) temp;
+                default:
+                    break;
+            }
+            curr_pos++;
+            psrc++;
+        }
+    }
+}
+
+static void 
+decode_row16(const gx_image_enum *penum, const unsigned short *psrc, int spp,
+             unsigned short *pdes,const unsigned short *bufend)
+{
+    unsigned short *curr_pos = pdes;
+    int k;
+    float temp;
+
+    while ( curr_pos < bufend ) {
+        for ( k = 0; k < spp; k ++ ) {
+            switch ( penum->map[k].decoding ) {
+                case sd_none:
+                    *curr_pos = *psrc;
+                    break;
+                case sd_lookup:	
+                    temp = penum->map[k].decode_lookup[(*psrc) >> 4]*65535;
+                    if (temp > 65535) temp = 65535;
+                    if (temp < 0 ) temp = 0;
+                    *curr_pos = (unsigned short) temp;
+                    break;
+                case sd_compute:
+                    temp = penum->map[k].decode_base + 
+                        (*psrc) * penum->map[k].decode_factor;
+                    temp *= 65535;
+                    if (temp > 65535) temp = 65535;
+                    if (temp < 0 ) temp = 0;
+                    *curr_pos = (unsigned short) temp;
+                default:
+                    break;
+            }
+            curr_pos++;
+            psrc++;
+        }
+    }
+}
+
+/* Render an image with more than 8 bits per sample where we keep the data 
+   in 16 bit form and hand directly to the CMM */
+static int
+image_render_icc16(gx_image_enum * penum, const byte * buffer, int data_x,
+		  uint w, int h, gx_device * dev)
+{
+    const gs_imager_state *pis = penum->pis;
+    gs_logical_operation_t lop = penum->log_op;
+    gx_dda_fixed_point pnext;
+    image_posture posture = penum->posture;
+    fixed xprev, yprev;
+    fixed pdyx, pdyy;		/* edge of parallelogram */
+    int vci, vdi;
+    const gs_color_space *pcs;
+    gx_device_color devc1;
+    gx_device_color devc2;
+    gx_device_color *pdevc;
+    gx_device_color *pdevc_next;
+    gx_device_color *ptemp;
+    int spp = penum->spp;
+    const unsigned short *psrc_initial = (const unsigned short *)buffer + data_x * spp;
+    const unsigned short *psrc = psrc_initial;
+    const unsigned short *rsrc = psrc + spp; /* psrc + spp at start of run */
+    fixed xrun;			/* x at start of run */
+    int irun;			/* int xrun */
+    fixed yrun;			/* y ditto */
+    color_fracs run;		/* run value */
+    color_fracs next;		/* next sample value */
+    const unsigned short *bufend = psrc + w;
+    int code = 0, mcode = 0;
+    gsicc_bufferdesc_t input_buff_desc;
+    gsicc_bufferdesc_t output_buff_desc;
+    unsigned short *psrc_cm, *psrc_cm_start, *psrc_decode;
+    int k;
+    gx_color_value conc[GX_DEVICE_COLOR_MAX_COMPONENTS];
+    int spp_cm, num_pixels;
+    gx_color_index color;
+    bool need_decode = penum->icc_setup.need_decode;
+    bool must_halftone = penum->icc_setup.must_halftone;
+    bool has_transfer = penum->icc_setup.has_transfer;
+
+    if (h == 0)
+	return 0;
+
+    if (penum->icc_link == NULL) {
+        return gs_rethrow(-1, "ICC Link not created during image render icc16");
+    }
+    /* Needed for device N */
+    memset(&(conc[0]), 0, sizeof(gx_color_value[GX_DEVICE_COLOR_MAX_COMPONENTS]));
+    if (gs_color_space_is_PSCIE(penum->pcs) && penum->pcs->icc_equivalent != NULL) {
+        pcs = penum->pcs->icc_equivalent;
+    } else {
+        pcs = penum->pcs;
+    }
+    pdevc = &devc1;
+    pdevc_next = &devc2;
+    /* These used to be set by init clues */
+    pdevc->type = gx_dc_type_none;
+    pdevc_next->type = gx_dc_type_none;
+    if (h == 0)
+	return 0;
+    /* If the link is the identity, then we don't need to do any color 
+       conversions except for potentially a decode. */
+    if (penum->icc_link->is_identity && !need_decode) {
+        /* Fastest case.  No decode or CM needed */
+        psrc_cm = (unsigned short *) psrc;
+        spp_cm = spp;
+        bufend = psrc_cm +  w;
+        psrc_cm_start = NULL;
+    } else {
+        spp_cm = dev->device_icc_profile->num_comps;
+        psrc_cm = (unsigned short*) gs_alloc_bytes(pis->memory,  
+                        sizeof(unsigned short)  * w * spp_cm/spp, 
+                        "image_render_icc16");
+        psrc_cm_start = psrc_cm;
+        bufend = psrc_cm +  w * spp_cm/spp;
+        if (penum->icc_link->is_identity) {
+            /* decode only. no CM.  This is slow but does not happen that often */
+            decode_row16(penum, psrc, spp, psrc_cm, bufend);    
+        } else {
+            /* Set up the buffer descriptors. */
+            num_pixels = w/spp;
+            gsicc_init_buffer(&input_buff_desc, spp, 2,
+                          false, false, false, 0, w * 2,
+                          1, num_pixels);
+            gsicc_init_buffer(&output_buff_desc, spp_cm, 2,
+                          false, false, false, 0, num_pixels * spp_cm * 2,
+                          1, num_pixels);
+            /* For now, just blast it all through the link. If we had a significant reduction 
+               we will want to repack the data first and then do this.  That will be 
+               an optimization shortly.  For now just allocate a new output
+               buffer.  We can reuse the old one if the number of channels in the output is
+               less than or equal to the new one.  */
+            if (need_decode) {
+                /* Need decode and CM.  This is slow but does not happen that often */
+                psrc_decode = (unsigned short*) gs_alloc_bytes(pis->memory,  
+                                sizeof(unsigned short) * w * spp_cm/spp, 
+                                "image_render_icc16");
+                if (penum->cie_range == NULL) {
+                    decode_row16(penum, psrc, spp, psrc_decode, 
+                                    (const unsigned short*) (psrc_decode+w));
+                } else {
+                    /* Decode needs to include adjustment for CIE range */
+                    decode_row_cie16(penum, psrc, spp, psrc_decode, 
+                                        (const unsigned short*) (psrc_decode+w), 
+                                         penum->cie_range);
+                }
+                gscms_transform_color_buffer(penum->icc_link, &input_buff_desc, 
+                                        &output_buff_desc, (void*) psrc_decode, 
+                                        (void*) psrc_cm);
+                gs_free_object(pis->memory, (byte *)psrc_decode, "image_render_color_icc");
+            } else {
+                /* CM only. No decode */
+                gscms_transform_color_buffer(penum->icc_link, &input_buff_desc, 
+                                            &output_buff_desc, (void*) psrc, 
+                                            (void*) psrc_cm);
+            }
+        }
+    }
+
+    pnext = penum->dda.pixel0;
+    xrun = xprev = dda_current(pnext.x);
+    yrun = yprev = dda_current(pnext.y);
+    pdyx = dda_current(penum->dda.row.x) - penum->cur.x;
+    pdyy = dda_current(penum->dda.row.y) - penum->cur.y;
+    switch (posture) {
+	case image_portrait:
+	    vci = penum->yci, vdi = penum->hci;
+	    irun = fixed2int_var_rounded(xrun);
+	    break;
+	case image_landscape:
+	default:    /* we don't handle skew -- treat as landscape */
+	    vci = penum->xci, vdi = penum->wci;
+	    irun = fixed2int_var_rounded(yrun);
+	    break;
+    }
+    if_debug5('b', "[b]y=%d data_x=%d w=%d xt=%f yt=%f\n",
+	      penum->y, data_x, w, fixed2float(xprev), fixed2float(yprev));
+    memset(&run, 0, sizeof(run));
+    memset(&next, 0, sizeof(next));
+    run.v[0] = ~psrc_cm[0];	/* Force intial setting */
+    while (psrc_cm < bufend) {
+	dda_next(pnext.x);
+	dda_next(pnext.y);
+        if ( penum->alpha ) {
+            /* If the pixels are different, then take care of the alpha now */
+            /* will need to adjust spp below.... */
+        } else {
+            memcpy(&(next.v[0]),psrc_cm, spp_cm * 2);
+            psrc_cm += spp_cm;
+        }
+        /* Compare to previous.  If same then move on */
+        if (posture != image_skewed && next.all[0] == run.all[0])
+		goto inc;
+        /* This needs to be sped up */
+        for ( k = 0; k < spp_cm; k++ ) {
+            conc[k] = next.v[k];
+        } 
+        /* Now we can do an encoding directly or we have to apply transfer
+           and or halftoning */
+        if (must_halftone || has_transfer) {
+            /* We need to do the tranfer function and/or the halftoning */
+            cmap_transfer_halftone(&(conc[0]), pdevc_next, pis, dev, 
+                has_transfer, must_halftone, gs_color_select_source);
+        } else {
+            /* encode as a color index. avoid all the cv to frac to cv
+               conversions */
+            color = dev_proc(dev, encode_color)(dev, &(conc[0]));
+            /* check if the encoding was successful; we presume failure is rare */
+            if (color != gx_no_color_index)
+                color_set_pure(pdevc_next, color);
+        }
+        /* Fill the region between */
+	/* xrun/irun and xprev */
+        if (posture != image_portrait) {	/* Parallelogram */
+	    code = (*dev_proc(dev, fill_parallelogram))
+	        (dev, xrun, yrun, xprev - xrun, yprev - yrun, pdyx, pdyy,
+	         pdevc, lop);
+	    xrun = xprev;
+	    yrun = yprev;
+        } else {		/* Rectangle */
+	    int xi = irun;
+	    int wi = (irun = fixed2int_var_rounded(xprev)) - xi;
+
+	    if (wi < 0)
+	        xi += wi, wi = -wi;
+	    if (wi > 0)
+	        code = gx_fill_rectangle_device_rop(xi, vci, wi, vdi,
+						    pdevc, dev, lop);
+        }
+        if (code < 0)
+	    goto err;
+	rsrc = psrc;
+	if ((code = mcode) < 0) goto err;
+        /* Swap around the colors due to a change */
+        ptemp = pdevc;
+        pdevc = pdevc_next;
+        pdevc_next = ptemp;
+ 	run = next;
+inc:	xprev = dda_current(pnext.x);
+	yprev = dda_current(pnext.y);	/* harmless if no skew */
+    }
+    /* Fill the final run. */
+    if (posture != image_portrait) {
+	code = (*dev_proc(dev, fill_parallelogram))
+	    (dev, xrun, yrun, xprev - xrun, yprev - yrun, pdyx, pdyy,
+	     pdevc, lop);
+    } else {
+	int xi = irun;
+	int wi = (irun = fixed2int_var_rounded(xprev)) - xi;
+
+	if (wi < 0)
+	    xi += wi, wi = -wi;
+	if (wi > 0)
+	    code = gx_fill_rectangle_device_rop(xi, vci, wi, vdi,
+						pdevc, dev, lop);
+    }
+    /* Free cm buffer, if it was used */
+    if (psrc_cm_start != NULL) {
+        gs_free_object(pis->memory, (byte *)psrc_cm_start, "image_render_icc16");
+    }
+    return (code < 0 ? code : 1);
+
+    /* Save position if error, in case we resume. */
+err:
+    gs_free_object(pis->memory, (byte *)psrc_cm_start, "image_render_icc16");
+    penum->used.x = (rsrc - spp - psrc_initial) / spp;
+    penum->used.y = 0;
+    return code;
+}

Modified: branches/chrisl-test-gs/base/gxi16bit.c
===================================================================
--- branches/chrisl-test-gs/base/gxi16bit.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxi16bit.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -57,7 +57,31 @@
     return bptr;
 }
 
+static const byte *
+sample_unpackicc_16(byte * bptr, int *pdata_x, const byte * data,
+		 int data_x, uint dsize, const sample_map *ignore_smap, int spread,
+		 int ignore_num_components_per_plane)
+{
+    /* Assuming an identity map for all components. */
+    register unsigned short *bufp = (unsigned short *) bptr;
+    uint dskip = data_x << 1;
+    const byte *psrc = data + dskip;
+#define inc_bufp16(bp, n) bp = ( unsigned short *)((byte *)(bp) + (n))
+    uint sample;
+    int left = dsize - dskip;
+
+    while (left >= 2) {
+	sample = ((uint) psrc[0] << 8) + psrc[1];
+	*bufp = (unsigned short)(sample);
+	inc_bufp16(bufp, spread);
+	psrc += 2;
+	left -= 2;
+    }
+    *pdata_x = 0;
+    return bptr;
+}
 const sample_unpack_proc_t sample_unpack_16_proc = sample_unpack_16;
+const sample_unpack_proc_t sample_unpackicc_16_proc = sample_unpackicc_16;
 
 /* ---------------- Rendering procedures ---------------- */
 

Modified: branches/chrisl-test-gs/base/gxicolor.c
===================================================================
--- branches/chrisl-test-gs/base/gxicolor.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxicolor.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -158,10 +158,10 @@
         penum->icc_setup.is_lab = pcs->cmm_icc_profile_data->islab;
         penum->icc_setup.must_halftone = gx_device_must_halftone(penum->dev);
         penum->icc_setup.has_transfer = gx_has_transfer(penum->pis,
-                                penum->pis->icc_manager->device_profile->num_comps);
+                                penum->dev->device_icc_profile->num_comps);
         if (penum->icc_setup.is_lab) penum->icc_setup.need_decode = false;
         if (penum->icc_link == NULL) {
-            penum->icc_link = gsicc_get_link(penum->pis, pcs, NULL, 
+            penum->icc_link = gsicc_get_link(penum->pis, penum->dev, pcs, NULL, 
                 &rendering_params, penum->memory, false);
         }
         /* PS CIE color spaces may have addition decoding that needs to
@@ -318,7 +318,6 @@
     gx_color_value conc[GX_DEVICE_COLOR_MAX_COMPONENTS];
     int spp_cm, num_pixels;
     gx_color_index color;
-    int src_num_comp = cs_num_components(penum->pcs);
     bool need_decode = penum->icc_setup.need_decode;
     bool must_halftone = penum->icc_setup.must_halftone;
     bool has_transfer = penum->icc_setup.has_transfer;
@@ -349,7 +348,7 @@
         bufend = psrc_cm +  w;
         psrc_cm_start = NULL;
     } else {
-        spp_cm = pis->icc_manager->device_profile->num_comps;
+        spp_cm = dev->device_icc_profile->num_comps;
         psrc_cm = gs_alloc_bytes(pis->memory,  w * spp_cm/spp, "image_render_color_icc");
         psrc_cm_start = psrc_cm;
         bufend = psrc_cm +  w * spp_cm/spp;
@@ -648,7 +647,7 @@
 			   gs_color_select_source);
 mapped:	if (mcode < 0)
 	    goto fill;
-f:	if (sizeof(pdevc_next->colors.binary.color[0]) <= sizeof(ulong))
+	if (sizeof(pdevc_next->colors.binary.color[0]) <= sizeof(ulong))
 	    if_debug7('B', "[B]0x%x,0x%x,0x%x,0x%x -> 0x%lx,0x%lx,0x%lx\n",
 		  next.v[0], next.v[1], next.v[2], next.v[3],
 		  (ulong)pdevc_next->colors.binary.color[0],

Modified: branches/chrisl-test-gs/base/gximag3x.c
===================================================================
--- branches/chrisl-test-gs/base/gximag3x.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gximag3x.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -228,6 +228,8 @@
 			(int)ceil(mrect.q.x) - origin[i].x,
 			(int)ceil(mrect.q.y) - origin[i].y,
 			penum->mask[i].depth, mem);
+        mdev->device_icc_profile = dev->device_icc_profile;
+        rc_increment(dev->device_icc_profile);
 	if (code < 0)
 	    goto out1;
 	penum->mask[i].mdev = mdev;

Modified: branches/chrisl-test-gs/base/gximage.h
===================================================================
--- branches/chrisl-test-gs/base/gximage.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gximage.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -133,6 +133,7 @@
  * if 16-bit samples are supported, 0 otherwise.
  */
 extern const sample_unpack_proc_t sample_unpack_16_proc;
+extern const sample_unpack_proc_t sample_unpackicc_16_proc;
 
 /* Define the distinct postures of an image. */
 /* Each posture includes its reflected variant. */

Modified: branches/chrisl-test-gs/base/gximono.c
===================================================================
--- branches/chrisl-test-gs/base/gximono.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gximono.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -79,15 +79,16 @@
 /* Temporary function to make it easier to debug the uber-macro below */
 static int
 image_set_gray(byte sample_value, const bool masked, uint mask_base,
-                uint mask_limit, gx_device_color *pdevc, gs_client_color *cc,
-                gs_color_space *pcs, const gs_imager_state *pis, 
+                uint mask_limit, gx_device_color **ppdevc, gs_client_color *cc,
+                const gs_color_space *pcs, const gs_imager_state *pis, 
                 gx_device * dev, gs_color_select_t gs_color_select_source,
                 gx_image_enum * penum, bool tiles_fit)
 {
    cs_proc_remap_color((*remap_color));
    int code;
+   gx_device_color *pdevc;
+   pdevc = *ppdevc = &penum->clues[sample_value].dev_color;
 
-    pdevc = &penum->clues[sample_value].dev_color;
     if (!color_is_set(pdevc)) {
        if ((uint)(sample_value - mask_base) < mask_limit) {
             color_set_null(pdevc);
@@ -383,7 +384,7 @@
 		    if (run != htrun) {
 			htrun = run;
 #if USE_SET_GRAY_FUNCTION
-                        code = image_set_gray(run,masked,mask_base,mask_limit,pdevc,
+                        code = image_set_gray(run,masked,mask_base,mask_limit,&pdevc,
                             &cc,pcs,pis,dev,gs_color_select_source,penum,tiles_fit);
                         if (code < 0) 
                             goto err;
@@ -425,7 +426,7 @@
 		if (run != htrun) {
 		    htrun = run;
 #if USE_SET_GRAY_FUNCTION
-                    code = image_set_gray(run,masked,mask_base,mask_limit,pdevc,
+                    code = image_set_gray(run,masked,mask_base,mask_limit,&pdevc,
                         &cc,pcs,pis,dev,gs_color_select_source,penum,tiles_fit);
                     if (code < 0) 
                         goto err;
@@ -452,7 +453,7 @@
       last:if (stop < endp && (*stop || !masked)) {
 	    if (!masked) {
 #if USE_SET_GRAY_FUNCTION
-                    code = image_set_gray(*stop, masked,mask_base,mask_limit,pdevc,
+                    code = image_set_gray(*stop, masked,mask_base,mask_limit,&pdevc,
                         &cc,pcs,pis,dev,gs_color_select_source,penum,tiles_fit);
                     if (code < 0) 
                         goto err;
@@ -560,7 +561,7 @@
 			  ht:	/* Use halftone if needed */
 			    if (run != htrun) {
 #if USE_SET_GRAY_FUNCTION
-                                code = image_set_gray(run, masked,mask_base,mask_limit,pdevc,
+                                code = image_set_gray(run, masked,mask_base,mask_limit,&pdevc,
                                     &cc,pcs,pis,dev,gs_color_select_source,penum,tiles_fit);
                                 if (code < 0) 
                                     goto err;
@@ -607,7 +608,7 @@
 		    goto lmt;
 	    }
 #if USE_SET_GRAY_FUNCTION
-            code = image_set_gray(*stop, masked,mask_base,mask_limit,pdevc,
+            code = image_set_gray(*stop, masked,mask_base,mask_limit,&pdevc,
                 &cc,pcs,pis,dev,gs_color_select_source,penum,tiles_fit);
             if (code < 0) 
                 goto err;

Modified: branches/chrisl-test-gs/base/gxiscale.c
===================================================================
--- branches/chrisl-test-gs/base/gxiscale.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxiscale.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -100,7 +100,7 @@
     /* Do not allow mismatch in devices component output with the
        profile output size.  For example sep device with CMYK profile should
        not go through the fast method */
-    if (penum->pis->icc_manager->device_profile->num_comps 
+    if (penum->dev->device_icc_profile->num_comps
         != penum->dev->color_info.num_components) {
         use_icc = false;
     }
@@ -309,9 +309,9 @@
         if (penum->icc_setup.is_lab) penum->icc_setup.need_decode = false;
         penum->icc_setup.must_halftone = gx_device_must_halftone(penum->dev);
         penum->icc_setup.has_transfer = gx_has_transfer(penum->pis,
-                                penum->pis->icc_manager->device_profile->num_comps);
+                                penum->dev->device_icc_profile->num_comps);
         if (penum->icc_link == NULL) {
-            penum->icc_link = gsicc_get_link(penum->pis, pcs, NULL, 
+            penum->icc_link = gsicc_get_link(penum->pis, penum->dev, pcs, NULL,
                 &rendering_params, penum->memory, false);
         }
         return &image_render_interpolate_icc;
@@ -673,7 +673,8 @@
 				    LINE_ACCUM(color, bpp);
 				    vd_pixel(int2fixed(x), int2fixed(ry), color);
 				    x++, psrc += 3;
-				} while (x < xe && psrc[-3] == psrc[0] &&
+                                } while (x < xe &&
+                                         psrc[-3] == psrc[0] &&
 				     psrc[-2] == psrc[1] &&
 				     psrc[-1] == psrc[2]);
 				break;
@@ -681,8 +682,10 @@
 				do {
 				    LINE_ACCUM(color, bpp);
 				    x++, psrc += 4;
-				} while (x < xe && psrc[-4] == psrc[0] &&
-				     psrc[-3] == psrc[1] && psrc[-2] == psrc[2] &&
+                                } while (x < xe &&
+                                         psrc[-4] == psrc[0] &&
+                                         psrc[-3] == psrc[1] &&
+                                         psrc[-2] == psrc[2] &&
 				     psrc[-1] == psrc[3]);
 				break;
 			    default:
@@ -693,8 +696,8 @@
 			int rcode;
 
 			LINE_ACCUM_COPY(dev, out, bpp, xo, x, raster, ry);
-			rcode = gx_fill_rectangle_device_rop(x, ry,
-						     1, 1, &devc, dev, lop);
+                        rcode = gx_fill_rectangle_device_rop(x, ry, 1, 1,
+                                                             &devc, dev, lop);
 			if (rcode < 0)
 			    return rcode;
 			LINE_ACCUM_SKIP(bpp);
@@ -1004,7 +1007,7 @@
 		if_debug1('B', "[B]Interpolated row %d:\n[B]",
 			  penum->line_xy);
                 /* Take care of CM on the entire interpolated row */
-                spp_cm = pis->icc_manager->device_profile->num_comps;
+                spp_cm = dev->device_icc_profile->num_comps;
                 if (penum->icc_link->is_identity) {
                     /* Fastest case. No CM needed */
                     psrc_cm = (unsigned short *) psrc;

Modified: branches/chrisl-test-gs/base/gxp1fill.c
===================================================================
--- branches/chrisl-test-gs/base/gxp1fill.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxp1fill.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -31,6 +31,8 @@
 #include "gxblend.h"
 #include "gsicc_cache.h"
 
+#define fastfloor(x) (((int)(x)) - (((x)<0) && ((x) != (float)(int)(x))))
+
 /* Define the state for tile filling. */
 typedef struct tile_fill_state_s {
 
@@ -103,9 +105,9 @@
      * tile_by_steps loop, but for simple tiles, we must set it now.
      */
     if (set_mask_phase && m_tile->is_simple) {
-	px = imod(-(int)floor(m_tile->step_matrix.tx - ptfs->phase.x + 0.5),
+        px = imod(-(int)fastfloor(m_tile->step_matrix.tx - ptfs->phase.x + 0.5),
 		  m_tile->tmask.rep_width);
-	py = imod(-(int)floor(m_tile->step_matrix.ty - ptfs->phase.y + 0.5),
+        py = imod(-(int)fastfloor(m_tile->step_matrix.ty - ptfs->phase.y + 0.5),
 		  m_tile->tmask.rep_height);
     } else
 	px = py = 0;
@@ -163,17 +165,17 @@
 	v1 = ibbox.q.y - min(ptile->bbox.q.y, 0) + 0.000001;
 	if (!ptile->is_simple)
 	    u0 -= bbw, v0 -= bbh, u1 += bbw, v1 += bbh;
-	i0 = (int)floor(u0);
-	j0 = (int)floor(v0);
+        i0 = (int)fastfloor(u0);
+        j0 = (int)fastfloor(v0);
 	i1 = (int)ceil(u1);
 	j1 = (int)ceil(v1);
     }
     if_debug4('T', "[T]i=(%d,%d) j=(%d,%d)\n", i0, i1, j0, j1);
     for (i = i0; i < i1; i++)
 	for (j = j0; j < j1; j++) {
-	    int x = (int)floor(step_matrix.xx * i +
+            int x = (int)fastfloor(step_matrix.xx * i +
 			  step_matrix.yx * j + step_matrix.tx);
-	    int y = (int)floor(step_matrix.xy * i +
+            int y = (int)fastfloor(step_matrix.xy * i +
 			  step_matrix.yy * j + step_matrix.ty);
 	    int w = tbits_or_tmask->size.x;
 	    int h = tbits_or_tmask->size.y;
@@ -313,10 +315,10 @@
 	return code;
     if (ptile->is_simple && ptile->cdev == NULL) {
 	int px =
-	    imod(-(int)floor(ptile->step_matrix.tx - state.phase.x + 0.5),
+            imod(-(int)fastfloor(ptile->step_matrix.tx - state.phase.x + 0.5),
 		 bits->rep_width);
 	int py =
-	    imod(-(int)floor(ptile->step_matrix.ty - state.phase.y + 0.5),
+            imod(-(int)fastfloor(ptile->step_matrix.ty - state.phase.y + 0.5),
 		 bits->rep_height);
 
 	if (state.pcdev != dev)
@@ -512,17 +514,17 @@
 	v1 = ibbox.q.y - min(ptile->bbox.q.y, 0) + 0.000001;
 	if (!ptile->is_simple)
 	    u0 -= bbw, v0 -= bbh, u1 += bbw, v1 += bbh;
-	i0 = (int)floor(u0);
-	j0 = (int)floor(v0);
+        i0 = (int)fastfloor(u0);
+        j0 = (int)fastfloor(v0);
 	i1 = (int)ceil(u1);
 	j1 = (int)ceil(v1);
     }
     if_debug4('T', "[T]i=(%d,%d) j=(%d,%d)\n", i0, i1, j0, j1);
     for (i = i0; i < i1; i++)
 	for (j = j0; j < j1; j++) {
-	    int x = (int)floor(step_matrix.xx * i +
+            int x = (int)fastfloor(step_matrix.xx * i +
 			  step_matrix.yx * j + step_matrix.tx);
-	    int y = (int)floor(step_matrix.xy * i +
+            int y = (int)fastfloor(step_matrix.xy * i +
 			  step_matrix.yy * j + step_matrix.ty);
 	    int w = ptrans_pat->width;
 	    int h = ptrans_pat->height;
@@ -592,6 +594,8 @@
     h = ymax - ymin;
     w = xmax - xmin;
 
+    if (h <= 0 || w <= 0) return;
+
     dx = (xmin + px) % tile_width;
     dy = (ymin + py) % tile_height;
 
@@ -607,7 +611,7 @@
 
     /* Now the middle part */
 
-    num_full_tiles = (int) floor((float) (w - left_width)/ (float) tile_width);
+    num_full_tiles = (int)fastfloor((float) (w - left_width)/ (float) tile_width);
 
     /* Now the right part */
 
@@ -764,14 +768,40 @@
 
 }
 
+/* This version does a rect fill with the transparency object */
+int
+gx_dc_pat_trans_fill_rectangle(const gx_device_color * pdevc, int x, int y,
+			     int w, int h, gx_device * dev,
+			     gs_logical_operation_t lop,
+			     const gx_rop_source_t * source)
+{
+    gx_color_tile *ptile = pdevc->colors.pattern.p_tile;
+    int code;
+    gs_int_point phase;
+    const gx_rop_source_t *rop_source = source;
+    gx_rop_source_t no_source;
 
+    if (ptile == 0)             /* null pattern */
+        return 0;
+    if (rop_source == NULL)
+        set_rop_no_source(rop_source, no_source, dev);
 
+    phase.x = pdevc->phase.x;
+    phase.y = pdevc->phase.y;
+
+    code = gx_trans_pattern_fill_rect(x, y, x+w, y+h, ptile, 
+                                    ptile->ttrans->fill_trans_buffer, phase);
+
+    return code;
+}
+
 /* This fills the transparency buffer rectangles with a pattern 
    buffer that includes transparency */
 
 int 
 gx_trans_pattern_fill_rect(int xmin, int ymin, int xmax, int ymax, gx_color_tile *ptile, 
-                               gx_pattern_trans_t *fill_trans_buffer, gs_int_point phase)
+                               gx_pattern_trans_t *fill_trans_buffer, 
+                               gs_int_point phase)
 {
 
     tile_fill_trans_state_t state;
@@ -780,49 +810,44 @@
     if (ptile == 0)		/* null pattern */
 	return 0;
 
-    /* Initialize the fill state */
+    /* Fit fill */
+    if ( (xmin | ymin) < 0 ) {
+        if ( xmin < 0 )
+	    xmin = 0;
+        if ( ymin < 0 )
+            ymin = 0;
+    }
 
     state.phase.x = phase.x;
     state.phase.y = phase.y;
 
     if (ptile->is_simple && ptile->cdev == NULL) {
-        
         /* A simple case.  Tile is not clist and simple. */
-
 	int px =
-	    imod(-(int)floor(ptile->step_matrix.tx - state.phase.x + 0.5),
+            imod(-(int)fastfloor(ptile->step_matrix.tx - phase.x + 0.5),
 		  ptile->ttrans->width);
 	int py =
-	    imod(-(int)floor(ptile->step_matrix.ty - state.phase.y + 0.5),
+            imod(-(int)fastfloor(ptile->step_matrix.ty - phase.y + 0.5),
 		 ptile->ttrans->height);
 
         tile_rect_trans_simple(xmin, ymin, xmax, ymax, px, py, ptile,
             fill_trans_buffer);
-
     } else {
-
         if (ptile->cdev == NULL) {
-
             /* No clist for the pattern, but a complex case
                This portion transforms the bounding box by the step matrix
                and does partial rect fills with tiles that fall into this 
                transformed bbox */
-            
             code = tile_by_steps_trans(&state, xmin, ymin, xmax-xmin, ymax-ymin, 
                 fill_trans_buffer, ptile);
-
 	} else {
-
             /* clist for the tile.  Currently this is not implemented
                for the case when the tile has transparency.  This is
                on the to do list.  Right now, all tiles with transparency
                are rendered into the pattern cache or into the clist
                */
 	    return_error(gs_error_unregistered);
-
 	}
     }
-
 return(0);
-
 }

Modified: branches/chrisl-test-gs/base/gxp1impl.h
===================================================================
--- branches/chrisl-test-gs/base/gxp1impl.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxp1impl.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -27,6 +27,7 @@
 dev_color_proc_fill_rectangle(gx_dc_pure_masked_fill_rect);
 dev_color_proc_fill_rectangle(gx_dc_binary_masked_fill_rect);
 dev_color_proc_fill_rectangle(gx_dc_colored_masked_fill_rect);
+dev_color_proc_fill_rectangle(gx_dc_pat_trans_fill_rectangle);
 
 /*
  * Declare the Pattern color mapping procedures exported by gxpcmap.c.

Modified: branches/chrisl-test-gs/base/gxpcmap.c
===================================================================
--- branches/chrisl-test-gs/base/gxpcmap.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxpcmap.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -179,8 +179,8 @@
 {
 }
 
-#ifndef MAX_BITMAP_PATTERN_SIZE		/* Allow override with XCFLAGS */
-#  define MAX_BITMAP_PATTERN_SIZE (1024*1024)
+#ifndef MaxPatternBitmap_DEFAULT
+#  define MaxPatternBitmap_DEFAULT (8*1024*1024) /* reasonable on most modern hosts */
 #endif
 
 /* Allocate a pattern accumulator, with an initial refct of 0. */
@@ -189,11 +189,13 @@
 		       gs_pattern1_instance_t *pinst, client_name_t cname)
 {
     gx_device *tdev = pinst->saved->device;
-    int depth = (pinst->template.PaintType == 1 ? 1 : tdev->color_info.depth);
+    int depth = (pinst->template.PaintType == 2 ? 1 : tdev->color_info.depth);
     int raster = (pinst->size.x * depth + 7) / 8;
     int64_t size = (int64_t)raster * pinst->size.y;
     gx_device_forward *fdev;
     int force_no_clist = 0;
+    int max_pattern_bitmap = tdev->MaxPatternBitmap == 0 ? MaxPatternBitmap_DEFAULT :
+				tdev->MaxPatternBitmap;
 
     /* 
      * If the target device can accumulate a pattern stream and the language
@@ -213,11 +215,10 @@
 	pattern_manage))((gx_device *)pinst->saved->device, 
 	0, pinst, pattern_manage__can_accum) == 1)
 	force_no_clist = 1;
-
     /* Do not allow pattern to be a clist if it uses transparency.  We
        will want to fix this at some point */
 
-    if (force_no_clist || size < MAX_BITMAP_PATTERN_SIZE || pinst->template.PaintType != 1 || 
+    if (force_no_clist || (size < max_pattern_bitmap && !pinst->is_clist) || pinst->template.PaintType != 1 || 
                         pinst->template.uses_transparency ) {
 
 	gx_device_pattern_accum *adev = gs_alloc_struct(mem, gx_device_pattern_accum,
@@ -225,11 +226,18 @@
 
 	if (adev == 0)
 	    return 0;
+#ifdef DEBUG
+	if (pinst->is_clist)
+	    eprintf("not using clist even though clist is requested\n");
+#endif
+	pinst->is_clist = false;
 	gx_device_init((gx_device *)adev,
 		       (const gx_device *)&gs_pattern_accum_device,
 		       mem, true);
 	adev->instance = pinst;
 	adev->bitmap_memory = storage_memory;
+        adev->device_icc_profile = tdev->device_icc_profile;
+        rc_increment(tdev->device_icc_profile);
 	fdev = (gx_device_forward *)adev;
     } else {
 	gx_device_buf_procs_t buf_procs = {dummy_create_buf_device,
@@ -257,6 +265,7 @@
 	    gs_free_object(mem, cdev, cname);
 	    return 0;
 	}
+	pinst->is_clist = true;
 	memset(cdev, 0, sizeof(*cdev));
 	cwdev->params_size = sizeof(gx_device_clist);
 	cwdev->static_procs = NULL;
@@ -299,7 +308,7 @@
 	cwdev->procs = gs_clist_device_procs;
 	cwdev->procs.open_device = pattern_clist_open_device;
 	gx_device_copy_color_params((gx_device *)cwdev, tdev);
-	cwdev->target = tdev;
+	rc_assign(cwdev->target, tdev, "gx_pattern_accum_alloc");
 	clist_init_io_procs(cdev, true);
 	cwdev->data = data;
 	cwdev->data_size = data_size;
@@ -316,6 +325,8 @@
 	cwdev->pinst = pinst;
 	set_dev_proc(cwdev, get_clipping_box, gx_default_get_clipping_box);
 	fdev = (gx_device_forward *)cdev;
+        cdev->common.device_icc_profile = tdev->device_icc_profile;
+        rc_increment(tdev->device_icc_profile);
     }
     check_device_separable((gx_device *)fdev);
     gx_device_forward_fill_in_procs(fdev);
@@ -373,6 +384,7 @@
         padev->transbuff = gs_alloc_struct(mem,gx_pattern_trans_t,&st_pattern_trans,"pattern_accum_open(trans)");
         padev->transbuff->transbytes = NULL;
         padev->transbuff->pdev14 = NULL;
+        padev->transbuff->fill_trans_buffer = NULL;
 
     } else {
 
@@ -467,9 +479,9 @@
     result = gs_alloc_struct(mem, gx_pattern_trans_t, &st_pattern_trans, "new_pattern_trans_buff");
     result->transbytes = NULL;
     result->pdev14 = NULL;
+    result->fill_trans_buffer = NULL;
 
     return(result);
-
 }
 
 
@@ -681,6 +693,8 @@
 static void
 gx_pattern_cache_free_entry(gx_pattern_cache * pcache, gx_color_tile * ctile)
 {
+    gx_device *temp_device;
+
     if ((ctile->id != gx_no_bitmap_id) && !ctile->is_dummy) {
 	gs_memory_t *mem = pcache->memory;
 	gx_device_memory *pmdev;
@@ -720,22 +734,27 @@
                             ctile->cdev->common.memory);
             rc_decrement(ctile->cdev->common.icc_cache_cl,
                             "gx_pattern_cache_free_entry");
+	    gs_free_object(ctile->cdev->common.memory, ctile->cdev, "free_pattern_cache_entry(pattern-clist)");
 	    ctile->cdev = NULL;
 	}
 
         if (ctile->ttrans != NULL) {
          
             if ( ctile->ttrans->pdev14 == NULL) {
-
                 /* This can happen if we came from the clist */
-                gs_free_object(mem,ctile->ttrans->transbytes,"free_pattern_cache_entry(transbytes)");
+                gs_free_object(mem,ctile->ttrans->transbytes,
+                               "free_pattern_cache_entry(transbytes)");
+                gs_free_object(mem,ctile->ttrans->fill_trans_buffer,
+                                "free_pattern_cache_entry(fill_trans_buffer)");
                 ctile->ttrans->transbytes = NULL;
-
             } else {
-
 	        dev_proc(ctile->ttrans->pdev14, close_device)((gx_device *)ctile->ttrans->pdev14);
-                ctile->ttrans->pdev14 = NULL;  /* should be ok due to pdf14_close */
+                temp_device = ctile->ttrans->pdev14;
+                gx_device_retain(temp_device, false);
+                rc_decrement(temp_device,"gx_pattern_cache_free_entry");
+                ctile->ttrans->pdev14 = NULL;  
                 ctile->ttrans->transbytes = NULL;  /* should be ok due to pdf14_close */
+                ctile->ttrans->fill_trans_buffer = NULL; /* This is always freed */
             }
 
             used += ctile->ttrans->n_chan*ctile->ttrans->planestride;

Modified: branches/chrisl-test-gs/base/gxpcolor.h
===================================================================
--- branches/chrisl-test-gs/base/gxpcolor.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxpcolor.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -26,6 +26,7 @@
 #include "gxblend.h"
 #include "gxcpath.h"
 #include "gxdcolor.h"
+#include "gxiclass.h"
 
 #define RAW_PATTERN_DUMP 0
 
@@ -159,6 +160,7 @@
 
     const gx_device *pdev14; 
     byte *transbytes;
+    gx_pattern_trans_t *fill_trans_buffer;  /* buffer to fill */
     gs_int_rect rect;
     int rowstride;
     int planestride;
@@ -169,19 +171,17 @@
     const pdf14_nonseparable_blending_procs_t *blending_procs;
     bool is_additive;
     gs_blend_mode_t blending_mode;
-    void (* pat_trans_fill)(int xmin, int ymin, int xmax, int ymax, int px, int py, const gx_color_tile *ptile,
+    void (* pat_trans_fill)(int xmin, int ymin, int xmax, int ymax, int px, 
+                            int py, const gx_color_tile *ptile,
             gx_pattern_trans_t *fill_trans_buffer);
+    int (* image_render)(gx_image_enum * penum, const byte * buffer, 
+                            int data_x, uint w, int h, gx_device * dev);
 };
 
-
-
 #define private_st_pattern_trans() /* in gxpcmap.c */\
-gs_private_st_ptrs2(st_pattern_trans, gx_pattern_trans_t, "gx_pattern_trans",\
+gs_private_st_ptrs3(st_pattern_trans, gx_pattern_trans_t, "gx_pattern_trans",\
 		    pattern_trans_enum_ptrs, pattern_trans_reloc_ptrs,\
-		    pdev14, transbytes);
-
-
-
+		    pdev14, transbytes, fill_trans_buffer)
 /*
  * Define a color tile, an entry in the rendered Pattern cache (and
  * eventually in the colored halftone cache).  Note that the depth is
@@ -220,6 +220,7 @@
     byte pad[2];		/* structure members alignment. */
     /* The following is neither key nor value. */
     uint index;			/* the index of the tile within */
+    bool trans_group_popped;    /* Used to avoid multiple group pops in image mask fills */
     /* the cache (for GC) */
 };
 
@@ -313,18 +314,22 @@
 dev_proc_open_device(pattern_clist_open_device);
 
 /* Code to fill a pdf14 transparency rectangles with a pattern trans buffer object */
+int gx_trans_pattern_fill_rect(int xmin, int ymin, int xmax, int ymax, 
+                               gx_color_tile *ptile, 
+                               gx_pattern_trans_t *fill_trans_buffer, 
+                               gs_int_point phase);
 
-int gx_trans_pattern_fill_rect(int xmin, int ymin, int xmax, int ymax, gx_color_tile *ptile, 
-                               gx_pattern_trans_t *fill_trans_buffer, gs_int_point phase);
-
 gx_pattern_trans_t* new_pattern_trans_buff(gs_memory_t *mem);
 
-void tile_rect_trans_simple(int xmin, int ymin, int xmax, int ymax, int px, int py, const gx_color_tile *ptile,
+void tile_rect_trans_simple(int xmin, int ymin, int xmax, int ymax, int px, 
+                            int py, const gx_color_tile *ptile,
                         gx_pattern_trans_t *fill_trans_buffer);
 
-/* This is used for the case when we may have overlapping tiles.  We need to get better detection for this as 
+/* This is used for the case when we may have overlapping tiles.  
+   We need to get better detection for this as 
    it would be best to avoid doing it if not needed. */
-void tile_rect_trans_blend(int xmin, int ymin, int xmax, int ymax, int px, int py, const gx_color_tile *ptile,
+void tile_rect_trans_blend(int xmin, int ymin, int xmax, int ymax, int px, 
+                           int py, const gx_color_tile *ptile,
                         gx_pattern_trans_t *fill_trans_buffer);
 
 /* File a colored pattern with white */

Modified: branches/chrisl-test-gs/base/gxshade.c
===================================================================
--- branches/chrisl-test-gs/base/gxshade.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxshade.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -388,13 +388,14 @@
     rendering_params.rendering_intent = pis->renderingintent;
     /* Grab the icc link transform that we need now */
     if (pcs->cmm_icc_profile_data != NULL) {
-        pfs->icclink = gsicc_get_link(pis, pcs, NULL, &rendering_params, 
-                                        pis->memory, false);
+        pfs->icclink = gsicc_get_link(pis, pis->trans_device, pcs, NULL, 
+                                        &rendering_params, pis->memory, false);
     } else {
         if (pcs->icc_equivalent != NULL ) {
             /* We have a PS equivalent ICC profile.  We may need to go 
                through special range adjustments in this case */
-            pfs->icclink = gsicc_get_link(pis, pcs->icc_equivalent, NULL, 
+            pfs->icclink = gsicc_get_link(pis, pis->trans_device, 
+                                          pcs->icc_equivalent, NULL, 
                                           &rendering_params, pis->memory, false);
         } else {
             pfs->icclink = NULL;

Modified: branches/chrisl-test-gs/base/gxtype1.c
===================================================================
--- branches/chrisl-test-gs/base/gxtype1.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/gxtype1.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -437,13 +437,16 @@
 	    }
 	    break;
 	case c2_callgsubr:
-	    /* FIXME
-	     * We should process subr and gsubr routines to see if they contain
-	     * a CFF endchar, and if it is a SEAC (deprecated but possible). Sadly
-	     * we don't have a full type 2 parser, and apparently can't handle gsubr
-	     * routines, so if we find one, assume there is no SEAC.
-	     */
-	    return 0;
+	    c = fixed2int_var(*csp) + pdata->gsubrNumberBias;
+	    code = pdata->procs.subr_data
+	        (pfont, c, true, &ipsp[1].cs_data);
+	    if (code < 0)
+		return_error(code);
+	    --csp;
+	    ipsp->ip = cip, ipsp->dstate = state;
+	    ++ipsp;
+	    cip = ipsp->cs_data.bits.data;
+	    goto call;
 	case c_callsubr:
 	    c = fixed2int_var(*csp) + pdata->subroutineNumberBias;
 	    code = pdata->procs.subr_data

Modified: branches/chrisl-test-gs/base/lib.mak
===================================================================
--- branches/chrisl-test-gs/base/lib.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/lib.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -413,7 +413,7 @@
  $(gscompt_h) $(gsdcolor_h) $(gsiparam_h) $(gsmatrix_h)\
  $(gsrefct_h) $(gsropt_h) $(gsstruct_h) $(gstparam_h) $(gsxfont_h)\
  $(gxbitmap_h) $(gxcindex_h) $(gxcvalue_h) $(gxfixed_h)\
- $(gxtext_h) $(gscspace_h) $(gsnamecl_h)
+ $(gxtext_h) $(gscspace_h) $(gsnamecl_h) $(gscms_h)
 gscicach_h=$(GLSRC)gscicach.h $(gxdevcli_h)
 gxdevice_h=$(GLSRC)gxdevice.h $(stdio__h)\
  $(gsfname_h) $(gsmalloc_h) $(gsparam_h) $(gxdevcli_h) $(gxstdio_h)
@@ -460,7 +460,7 @@
 gxcie_h=$(GLSRC)gxcie.h $(gscie_h)
 gxpcolor_h=$(GLSRC)gxpcolor.h\
  $(gspcolor_h) $(gxcspace_h) $(gxdevice_h) $(gxdevmem_h) $(gxpcache_h) $(gxblend_h)\
- $(gxcpath_h) $(gxdcolor_h)
+ $(gxcpath_h) $(gxdcolor_h) $(gxiclass_h) 
 gscolor_h=$(GLSRC)gscolor.h $(gxtmap_h)
 gsstate_h=$(GLSRC)gsstate.h\
  $(gscolor_h) $(gscpm_h) $(gscsel_h) $(gsdevice_h) $(gsht_h) $(gsline_h)
@@ -705,7 +705,8 @@
  $(gsccolor_h) $(gspaint_h)\
  $(gxarith_h) $(gxcmap_h) $(gxcpath_h) $(gxdcolor_h) $(gxdevice_h)\
  $(gxdevmem_h) $(gxfixed_h) $(gxfrac_h) $(gximage_h) $(gxistate_h)\
- $(gxmatrix_h)  $(vdtrace_h)
+ $(gxmatrix_h)  $(vdtrace_h) $(gsicc_h) $(gsicc_cache_h) $(gsicc_littlecms_h)\
+ $(gxcie_h) $(gscie_h)
 	$(GLCC) $(GLO_)gxi12bit.$(OBJ) $(C_) $(GLSRC)gxi12bit.c
 
 $(GLOBJ)gxi16bit.$(OBJ) : $(GLSRC)gxi16bit.c $(GXERR)\
@@ -2514,7 +2515,8 @@
 $(GLOBJ)gsicc_cache.$(OBJ) : $(GLSRC)gsicc_cache.c $(GX) $(stdpre_h)\
  $(gstypes_h) $(gsmemory_h) $(gsstruct_h) $(scommon_h) $(smd5_h)\
  $(gxistate_h) $(gscms_h) $(gsicc_manage_h) $(gsicc_cache_h)\
- $(gserrors_h) $(gsmalloc_h) $(string__h) $(gsicc_profilecache_h)
+ $(gserrors_h) $(gsmalloc_h) $(string__h) $(gsicc_profilecache_h)\
+ $(gzstate_h) 
 	$(GLCC) $(GLO_)gsicc_cache.$(OBJ) $(C_) $(GLSRC)gsicc_cache.c
 	
 $(GLOBJ)gsicc_profilecache.$(OBJ) : $(GLSRC)gsicc_profilecache.c $(GX) $(std_h)\
@@ -2686,7 +2688,7 @@
  $(gsrect_h) $(gzstate_h) $(gdevdevn_h) $(gdevp14_h) $(gsovrc_h) $(gxcmap_h) $(gscolor1_h)\
  $(gstrans_h) $(gsutil_h) $(gxcldev_h) $(gxclpath_h) $(gxdcconv_h) $(vdtrace_h)\
  $(gscolorbuffer_h) $(gsptype2_h) $(gxpcolor_h) $(gsptype1_h) $(gzcpath_h)\
- $(gxpaint_h) $(gsicc_manage_h) $(gxclist_h)
+ $(gxpaint_h) $(gsicc_manage_h) $(gxclist_h) $(gxiclass_h) $(gximage_h) $(gsmatrix_h)
 	$(GLCC) $(GLO_)gdevp14.$(OBJ) $(C_) $(GLSRC)gdevp14.c
 
 translib_=$(GLOBJ)gstrans.$(OBJ) $(GLOBJ)gximag3x.$(OBJ)\
@@ -2865,7 +2867,7 @@
 	$(GLCC) $(GLO_)gp_paper.$(OBJ) $(C_) $(GLSRC)gp_paper.c
 
 # Unix implementation of gp_defaultpapersize.
-$(GLOBJ)gp_upapr.$(OBJ) : $(GLSRC)gp_upapr.c $(AK) $(gp_h)
+$(GLOBJ)gp_upapr.$(OBJ) : $(GLSRC)gp_upapr.c $(malloc__h) $(AK) $(gp_h)
 	$(GLCC) $(GLO_)gp_upapr.$(OBJ) $(C_) $(GLSRC)gp_upapr.c
 
 # File system implementation.

Deleted: branches/chrisl-test-gs/base/libpng.mak
===================================================================
--- branches/chrisl-test-gs/base/libpng.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/libpng.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1,142 +0,0 @@
-#  Copyright (C) 2001-2007 Artifex Software, Inc.
-#  All Rights Reserved.
-#
-#  This software is provided AS-IS with no warranty, either express or
-#  implied.
-#
-#  This software is distributed under license and may not be copied, modified
-#  or distributed except as expressly authorized under the terms of that
-#  license.  Refer to licensing information at http://www.artifex.com/
-#  or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
-#  San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
-#
-# $Id$
-# makefile for PNG (Portable Network Graphics) code.
-# Users of this makefile must define the following:
-#	ZSRCDIR - the zlib source directory
-#	ZGENDIR - the zlib generated intermediate file directory
-#	ZOBJDIR - the zlib object directory
-#	PNGSRCDIR - the source directory
-#	PNGGENDIR - the generated intermediate file directory
-#	PNGOBJDIR - the object directory
-#	SHARE_LIBPNG - 0 to compile libpng, 1 to share
-#	LIBPNG_NAME - if SHARE_LIBPNG=1, the name of the shared library
-
-# This partial makefile compiles the png library for use in the Ghostscript
-# PNG drivers.  You can get the source code for this library from:
-#   http://www.libpng.org/pub/png/src/
-#   ftp://swrinde.nde.swri.edu/pub/png/src/
-#   ftp://ftp.uu.net/graphics/png/src/
-#   http://libpng.sourceforge.net/
-# Please see Ghostscript's `Make.htm' file for instructions about how to
-# unpack these archives.
-#
-# When each version of Ghostscript is released, we copy the associated
-# version of the png library to
-#	ftp://ftp.cs.wisc.edu/ghost/3rdparty/
-# for more convenient access.
-#
-# this makefile should work with libpng versions 0.90 and above
-#
-# NOTE: the archive for libpng 0.95 may be inconsistent: if you have
-# compilation problems, use a newer version.
-#
-# Please see Ghostscript's Make.htm file for instructions about how to
-# unpack these archives.
-#
-# The specification for the PNG file format is available from:
-#   http://www.group42.com/png.htm
-#   http://www.w3.org/pub/WWW/TR/WD-png
-
-# (Rename directories.)
-PNGSRC=$(PNGSRCDIR)$(D)
-PNGGEN=$(PNGGENDIR)$(D)
-PNGOBJ=$(PNGOBJDIR)$(D)
-PNGO_=$(O_)$(PNGOBJ)
-PZGEN=$(ZGENDIR)$(D)
-
-# PI_ and PF_ are defined in gs.mak.
-PNGCC=$(CC_) $(I_)$(PI_)$(_I) $(PF_) $(D_)PNG_NO_ASSEMBLER_CODE$(_D)
-
-# Define the name of this makefile.
-LIBPNG_MAK=$(GLSRC)libpng.mak
-
-png.clean : png.config-clean png.clean-not-config-clean
-
-### WRONG.  MUST DELETE OBJ AND GEN FILES SELECTIVELY.
-png.clean-not-config-clean :
-	$(RM_) $(PNGOBJ)*.$(OBJ)
-
-png.config-clean :
-	$(RM_) $(PNGGEN)lpg*.dev
-
-PDEP=$(AK)
-
-png_1=$(PNGOBJ)png.$(OBJ) $(PNGOBJ)pngmem.$(OBJ) $(PNGOBJ)pngerror.$(OBJ) $(PNGOBJ)pngset.$(OBJ)
-png_2=$(PNGOBJ)pngtrans.$(OBJ) $(PNGOBJ)pngwrite.$(OBJ) $(PNGOBJ)pngwtran.$(OBJ) $(PNGOBJ)pngwutil.$(OBJ) $(PNGOBJ)pngwio.$(OBJ)
-png_3=$(PNGOBJ)pngread.$(OBJ) $(PNGOBJ)pngrutil.$(OBJ) $(PNGOBJ)pngrtran.$(OBJ) $(PNGOBJ)pngrio.$(OBJ) $(PNGOBJ)pngget.$(OBJ)
-
-# libpng modules
-
-$(PNGOBJ)png.$(OBJ) : $(PNGSRC)png.c $(PDEP)
-	$(PNGCC) $(PNGO_)png.$(OBJ) $(C_) $(PNGSRC)png.c
-
-$(PNGOBJ)pngwio.$(OBJ) : $(PNGSRC)pngwio.c $(PDEP)
-	$(PNGCC) $(PNGO_)pngwio.$(OBJ) $(C_) $(PNGSRC)pngwio.c
-
-$(PNGOBJ)pngmem.$(OBJ) : $(PNGSRC)pngmem.c $(PDEP)
-	$(PNGCC) $(PNGO_)pngmem.$(OBJ) $(C_) $(PNGSRC)pngmem.c
-
-$(PNGOBJ)pngerror.$(OBJ) : $(PNGSRC)pngerror.c $(PDEP)
-	$(PNGCC) $(PNGO_)pngerror.$(OBJ) $(C_) $(PNGSRC)pngerror.c
-
-$(PNGOBJ)pngset.$(OBJ) : $(PNGSRC)pngset.c $(PDEP)
-	$(PNGCC) $(PNGO_)pngset.$(OBJ) $(C_) $(PNGSRC)pngset.c
-
-$(PNGOBJ)pngtrans.$(OBJ) : $(PNGSRC)pngtrans.c $(PDEP)
-	$(PNGCC) $(PNGO_)pngtrans.$(OBJ) $(C_) $(PNGSRC)pngtrans.c
-
-$(PNGOBJ)pngwrite.$(OBJ) : $(PNGSRC)pngwrite.c $(PDEP)
-	$(PNGCC) $(PNGO_)pngwrite.$(OBJ) $(C_) $(PNGSRC)pngwrite.c
-
-$(PNGOBJ)pngwtran.$(OBJ) : $(PNGSRC)pngwtran.c $(PDEP)
-	$(PNGCC) $(PNGO_)pngwtran.$(OBJ) $(C_) $(PNGSRC)pngwtran.c
-
-$(PNGOBJ)pngwutil.$(OBJ) : $(PNGSRC)pngwutil.c $(PDEP)
-	$(PNGCC) $(PNGO_)pngwutil.$(OBJ) $(C_) $(PNGSRC)pngwutil.c
-
-$(PNGOBJ)pngread.$(OBJ) : $(PNGSRC)pngread.c $(PDEP)
-	$(PNGCC) $(PNGO_)pngread.$(OBJ) $(C_) $(PNGSRC)pngread.c
-
-$(PNGOBJ)pngrutil.$(OBJ) : $(PNGSRC)pngrutil.c $(PDEP)
-	$(PNGCC) $(PNGO_)pngrutil.$(OBJ) $(C_) $(PNGSRC)pngrutil.c
-
-$(PNGOBJ)pngrtran.$(OBJ) : $(PNGSRC)pngrtran.c $(PDEP)
-	$(PNGCC) $(PNGO_)pngrtran.$(OBJ) $(C_) $(PNGSRC)pngrtran.c
-
-$(PNGOBJ)pngrio.$(OBJ) : $(PNGSRC)pngrio.c $(PDEP)
-	$(PNGCC) $(PNGO_)pngrio.$(OBJ) $(C_) $(PNGSRC)pngrio.c
-
-$(PNGOBJ)pngget.$(OBJ) : $(PNGSRC)pngget.c $(PDEP)
-	$(PNGCC) $(PNGO_)pngget.$(OBJ) $(C_) $(PNGSRC)pngget.c
-
-
-# Define the version of libpng.dev that we are actually using.
-$(PNGGEN)libpng.dev : $(TOP_MAKEFILES) $(PNGGEN)libpng_$(SHARE_LIBPNG).dev
-	$(CP_) $(PNGGEN)libpng_$(SHARE_LIBPNG).dev $(PNGGEN)libpng.dev
-
-# Define the shared version of libpng.
-# Note that it requires libz, which must be searched *after* libpng.
-$(PNGGEN)libpng_1.dev : $(TOP_MAKEFILES) $(LIBPNG_MAK) $(ECHOGS_XE) $(PZGEN)zlibe.dev
-	$(SETMOD) $(PNGGEN)libpng_1 -lib $(LIBPNG_NAME)
-	$(ADDMOD) $(PNGGEN)libpng_1 -include $(PZGEN)zlibe.dev
-
-# Define the non-shared version of libpng.
-$(PNGGEN)libpng_0.dev : $(LIBPNG_MAK) $(ECHOGS_XE) $(png_1) $(png_2) $(png_3)\
- $(PZGEN)zlibe.dev $(PNGOBJ)pngwio.$(OBJ) $(PZGEN)crc32.dev
-	$(SETMOD) $(PNGGEN)libpng_0 $(png_1)
-	$(ADDMOD) $(PNGGEN)libpng_0 $(png_2)
-	$(ADDMOD) $(PNGGEN)libpng_0 $(png_3)
-	$(ADDMOD) $(PNGGEN)libpng_0 $(PNGOBJ)pngwio.$(OBJ)
-	$(ADDMOD) $(PNGGEN)libpng_0 -include $(PZGEN)zlibe.dev $(PZGEN)crc32.dev
-

Deleted: branches/chrisl-test-gs/base/libtiff.mak
===================================================================
--- branches/chrisl-test-gs/base/libtiff.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/libtiff.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1,214 +0,0 @@
-#  Copyright (C) 2001-2007 Artifex Software, Inc.
-#  All Rights Reserved.
-#
-#  This software is provided AS-IS with no warranty, either express or
-#  implied.
-#
-#  This software is distributed under license and may not be copied, modified
-#  or distributed except as expressly authorized under the terms of that
-#  license.  Refer to licensing information at http://www.artifex.com/
-#  or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
-#  San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
-#
-# $Id$
-# makefile for libtiff.
-# Users of this makefile must define the following:
-#	TIFFSRCDIR    - the source directory
-#	TIFFGEN       - the generated intermediate file directory
-#	SHARE_LIBTIFF - 0 to compile libtiff, 1 to share
-#	LIBTIFF_NAME  - if SHARE_LIBTIFF=1, the name of the shared library
-
-# (Rename directories.)
-TIFFSRC=$(TIFFSRCDIR)$(D)
-TIFFGEN=$(TIFFGENDIR)$(D)
-TIFFOBJ=$(TIFFOBJDIR)$(D)
-TIFFO_=$(O_)$(TIFFOBJ)
-JPEGGEN=$(JGENDIR)$(D)
-
-TIFFCONFIG=$(TIFFSRC)libtiff$(D)tif_config$(TIFFCONFIG_SUFFIX).h
-TIFFCONF=$(TIFFSRC)libtiff$(D)tiffconf$(TIFFCONFIG_SUFFIX).h
-
-# Define the name of this makefile.
-LIBTIFF_MAK=$(GLSRC)libtiff.mak
-
-TIFFCC=$(CC_) $(I_)$(TI_) $(II)$(JI_)$(_I) $(PF_)
-
-TIFFDEP = $(AK) $(TIFFGEN)tif_config.h $(TIFFGEN)tiffconf.h
-
-tiff_1=$(TIFFOBJ)tif_aux.$(OBJ) $(TIFFOBJ)tif_close.$(OBJ) $(TIFFOBJ)tif_codec.$(OBJ) $(TIFFOBJ)tif_color.$(OBJ)
-tiff_2=$(TIFFOBJ)tif_compress.$(OBJ) $(TIFFOBJ)tif_dir.$(OBJ) $(TIFFOBJ)tif_dirinfo.$(OBJ) $(TIFFOBJ)tif_dirread.$(OBJ)
-tiff_3=$(TIFFOBJ)tif_dirwrite.$(OBJ) $(TIFFOBJ)tif_dumpmode.$(OBJ) $(TIFFOBJ)tif_error.$(OBJ) $(TIFFOBJ)tif_extension.$(OBJ)
-tiff_4=$(TIFFOBJ)tif_fax3.$(OBJ) $(TIFFOBJ)tif_fax3sm.$(OBJ) $(TIFFOBJ)tif_flush.$(OBJ) $(TIFFOBJ)tif_getimage.$(OBJ)
-tiff_5=$(TIFFOBJ)tif_jbig.$(OBJ) $(TIFFOBJ)tif_jpeg.$(OBJ) $(TIFFOBJ)tif_luv.$(OBJ) $(TIFFOBJ)tif_lzw.$(OBJ)
-tiff_6=$(TIFFOBJ)tif_next.$(OBJ) $(TIFFOBJ)tif_ojpeg.$(OBJ) $(TIFFOBJ)tif_open.$(OBJ) $(TIFFOBJ)tif_packbits.$(OBJ)
-tiff_7=$(TIFFOBJ)tif_pixarlog.$(OBJ) $(TIFFOBJ)tif_predict.$(OBJ) $(TIFFOBJ)tif_print.$(OBJ) $(TIFFOBJ)tif_read.$(OBJ)
-tiff_8=$(TIFFOBJ)tif_strip.$(OBJ) $(TIFFOBJ)tif_swab.$(OBJ) $(TIFFOBJ)tif_thunder.$(OBJ) $(TIFFOBJ)tif_tile.$(OBJ)
-tiff_9=$(TIFFOBJ)tif_$(TIFFPLATFORM).$(OBJ) $(TIFFOBJ)tif_version.$(OBJ) $(TIFFOBJ)tif_warning.$(OBJ) $(TIFFOBJ)tif_write.$(OBJ)
-tiff_10=$(TIFFOBJ)tif_zip.$(OBJ)
-
-$(TIFFSRC)libtiff$(D)tif_config.unix.h : $(TIFFSRC)libtiff$(D)tif_config.h.in
-	cd $(TIFFSRC) && ./configure
-	$(CP_) $(TIFFSRC)libtiff$(D)tif_config.h $(TIFFSRC)libtiff$(D)tif_config.unix.h
-
-$(TIFFSRC)libtiff$(D)tiffconf.unix.h : $(TIFFSRC)libtiff$(D)tiffconf.h.in
-	cd $(TIFFSRC) && ./configure
-	$(CP_) $(TIFFSRC)libtiff$(D)tiffconf.h $(TIFFSRC)libtiff$(D)tiffconf.unix.h
-
-$(TIFFOBJ)tif_aux.$(OBJ) : $(TIFFSRC)/libtiff/tif_aux.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_aux.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_aux.c
-
-$(TIFFOBJ)tif_close.$(OBJ) : $(TIFFSRC)/libtiff/tif_close.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_close.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_close.c
-
-$(TIFFOBJ)tif_codec.$(OBJ) : $(TIFFSRC)/libtiff/tif_codec.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_codec.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_codec.c
-
-$(TIFFOBJ)tif_color.$(OBJ) : $(TIFFSRC)/libtiff/tif_color.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_color.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_color.c
-
-$(TIFFOBJ)tif_compress.$(OBJ) : $(TIFFSRC)/libtiff/tif_compress.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_compress.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_compress.c
-
-$(TIFFOBJ)tif_dir.$(OBJ) : $(TIFFSRC)/libtiff/tif_dir.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_dir.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_dir.c
-
-$(TIFFOBJ)tif_dirinfo.$(OBJ) : $(TIFFSRC)/libtiff/tif_dirinfo.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_dirinfo.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_dirinfo.c
-
-$(TIFFOBJ)tif_dirread.$(OBJ) : $(TIFFSRC)/libtiff/tif_dirread.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_dirread.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_dirread.c
-
-$(TIFFOBJ)tif_dirwrite.$(OBJ) : $(TIFFSRC)/libtiff/tif_dirwrite.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_dirwrite.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_dirwrite.c
-
-$(TIFFOBJ)tif_dumpmode.$(OBJ) : $(TIFFSRC)/libtiff/tif_dumpmode.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_dumpmode.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_dumpmode.c
-
-$(TIFFOBJ)tif_error.$(OBJ) : $(TIFFSRC)/libtiff/tif_error.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_error.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_error.c
-
-$(TIFFOBJ)tif_extension.$(OBJ) : $(TIFFSRC)/libtiff/tif_extension.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_extension.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_extension.c
-
-$(TIFFOBJ)tif_fax3.$(OBJ) : $(TIFFSRC)/libtiff/tif_fax3.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_fax3.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_fax3.c
-
-$(TIFFOBJ)tif_fax3sm.$(OBJ) : $(TIFFSRC)/libtiff/tif_fax3sm.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_fax3sm.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_fax3sm.c
-
-$(TIFFOBJ)tif_flush.$(OBJ) : $(TIFFSRC)/libtiff/tif_flush.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_flush.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_flush.c
-
-$(TIFFOBJ)tif_getimage.$(OBJ) : $(TIFFSRC)/libtiff/tif_getimage.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_getimage.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_getimage.c
-
-$(TIFFOBJ)tif_jbig.$(OBJ) : $(TIFFSRC)/libtiff/tif_jbig.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_jbig.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_jbig.c
-
-$(TIFFOBJ)tif_jpeg.$(OBJ) : $(TIFFSRC)/libtiff/tif_jpeg.c $(TIFFDEP) $(JGENDIR)/jconfig.h
-	$(TIFFCC) $(TIFFO_)tif_jpeg.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_jpeg.c
-
-$(TIFFOBJ)tif_luv.$(OBJ) : $(TIFFSRC)/libtiff/tif_luv.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_luv.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_luv.c
-
-$(TIFFOBJ)tif_lzw.$(OBJ) : $(TIFFSRC)/libtiff/tif_lzw.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_lzw.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_lzw.c
-
-$(TIFFOBJ)tif_next.$(OBJ) : $(TIFFSRC)/libtiff/tif_next.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_next.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_next.c
-
-$(TIFFOBJ)tif_ojpeg.$(OBJ) : $(TIFFSRC)/libtiff/tif_ojpeg.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_ojpeg.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_ojpeg.c
-
-$(TIFFOBJ)tif_open.$(OBJ) : $(TIFFSRC)/libtiff/tif_open.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_open.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_open.c
-
-$(TIFFOBJ)tif_packbits.$(OBJ) : $(TIFFSRC)/libtiff/tif_packbits.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_packbits.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_packbits.c
-
-$(TIFFOBJ)tif_pixarlog.$(OBJ) : $(TIFFSRC)/libtiff/tif_pixarlog.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_pixarlog.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_pixarlog.c
-
-$(TIFFOBJ)tif_predict.$(OBJ) : $(TIFFSRC)/libtiff/tif_predict.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_predict.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_predict.c
-
-$(TIFFOBJ)tif_print.$(OBJ) : $(TIFFSRC)/libtiff/tif_print.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_print.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_print.c
-
-$(TIFFOBJ)tif_read.$(OBJ) : $(TIFFSRC)/libtiff/tif_read.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_read.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_read.c
-
-$(TIFFOBJ)tif_strip.$(OBJ) : $(TIFFSRC)/libtiff/tif_strip.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_strip.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_strip.c
-
-$(TIFFOBJ)tif_swab.$(OBJ) : $(TIFFSRC)/libtiff/tif_swab.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_swab.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_swab.c
-
-$(TIFFOBJ)tif_thunder.$(OBJ) : $(TIFFSRC)/libtiff/tif_thunder.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_thunder.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_thunder.c
-
-$(TIFFOBJ)tif_tile.$(OBJ) : $(TIFFSRC)/libtiff/tif_tile.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_tile.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_tile.c
-
-$(TIFFOBJ)tif_version.$(OBJ) : $(TIFFSRC)/libtiff/tif_version.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_version.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_version.c
-
-$(TIFFOBJ)tif_warning.$(OBJ) : $(TIFFSRC)/libtiff/tif_warning.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_warning.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_warning.c
-
-$(TIFFOBJ)tif_write.$(OBJ) : $(TIFFSRC)/libtiff/tif_write.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_write.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_write.c
-
-$(TIFFOBJ)tif_zip.$(OBJ) : $(TIFFSRC)/libtiff/tif_zip.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_zip.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_zip.c
-
-# tif_win32.c include <windows.h> and needed to be compiled with non-ansi extensions.
-# so it has a different compiler flag compared to other tif_$(TIFFPLATFORM).c .
-# We also have this target before tif_$(TIFFPLATFORM).c for this reason.
-$(TIFFOBJ)tif_win32.$(OBJ) : $(TIFFSRC)/libtiff/tif_win32.c $(TIFFDEP)
-	$(CC) $(I_)$(TI_) $(II)$(JI_)$(_I) $(PF_) $(TIFFO_)tif_win32.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_win32.c
-
-## Generic target:
-## we may need to add targets for openvms, mac classics, os2, etc later. For the time
-## being only win32 and unix (including mac os x) are supported.
-#$(TIFFOBJ)tif_$(TIFFPLATFORM).$(OBJ) : $(TIFFSRC)/libtiff/tif_$(TIFFPLATFORM).c $(TIFFDEP)
-#	$(TIFFCC) $(TIFFO_)tif_$(TIFFPLATFORM).$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_$(TIFFPLATFORM).c
-
-$(TIFFOBJ)tif_unix.$(OBJ) : $(TIFFSRC)/libtiff/tif_unix.c $(TIFFDEP)
-	$(TIFFCC) $(TIFFO_)tif_unix.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_unix.c
-
-$(TIFFGEN)tif_config.h: $(TIFFCONFIG)
-	$(CP_) $(TIFFCONFIG) $(TIFFGEN)tif_config.h
-	
-$(TIFFGEN)tiffconf.h: $(TIFFCONF)
-	$(CP_) $(TIFFCONF) $(TIFFGEN)tiffconf.h
-	
-# Define the version of libtiff.dev that we are actually using.
-$(TIFFGEN)libtiff.dev : $(TOP_MAKEFILES) $(TIFFGEN)libtiff_$(SHARE_LIBTIFF).dev
-	$(CP_) $(TIFFGEN)libtiff_$(SHARE_LIBTIFF).dev $(TIFFGEN)libtiff.dev
-
-
-# Define the shared version.
-$(TIFFGEN)libtiff_1.dev : $(TOP_MAKEFILES) $(LIBTIFF_MAK) $(ECHOGS_XE) $(JPEGGEN)jpegd.dev $(JPEGGEN)jpege.dev
-	$(SETMOD) $(TIFFGEN)libtiff_1 -lib $(LIBTIFF_NAME)
-	$(ADDMOD) $(TIFFGEN)libtiff_1 -include $(JPEGGEN)jpegd.dev
-	$(ADDMOD) $(TIFFGEN)libtiff_1 -include $(JPEGGEN)jpege.dev
-
-# Define the non-shared version.
-$(TIFFGEN)libtiff_0.dev : $(LIBTIFF_MAK) $(ECHOGS_XE) \
-    $(tiff_1) $(tiff_2) $(tiff_3) $(tiff_4) $(tiff_5) \
-    $(tiff_6) $(tiff_7) $(tiff_8) $(tiff_9) $(tiff_10) \
-    $(JPEGGEN)jpegd.dev $(JPEGGEN)jpege.dev
-	$(SETMOD) $(TIFFGEN)libtiff_0 $(tiff_1)
-	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_2)
-	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_3)
-	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_4)
-	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_5)
-	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_6)
-	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_7)
-	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_8)
-	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_9)
-	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_10)
-	$(ADDMOD) $(TIFFGEN)libtiff_0 -include $(JPEGGEN)jpegd.dev
-	$(ADDMOD) $(TIFFGEN)libtiff_0 -include $(JPEGGEN)jpege.dev
-

Modified: branches/chrisl-test-gs/base/macos-mcp.mak
===================================================================
--- branches/chrisl-test-gs/base/macos-mcp.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/macos-mcp.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -93,7 +93,7 @@
 # Define the directory where the PNG library sources are stored,
 # and the version of the library that is stored there.
 # You may need to change this if the libpng version changes.
-# See libpng.mak for more information.
+# See png.mak for more information.
 
 PNGSRCDIR=libpng
 
@@ -224,7 +224,7 @@
 DEVICE_DEVS8=$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcx24b.dev $(DD)pcxcmyk.dev
 DEVICE_DEVS9=$(DD)pbm.dev $(DD)pbmraw.dev $(DD)pgm.dev $(DD)pgmraw.dev $(DD)pgnm.dev $(DD)pgnmraw.dev $(DD)pnm.dev $(DD)pnmraw.dev $(DD)ppm.dev $(DD)ppmraw.dev $(DD)pkm.dev $(DD)pkmraw.dev $(DD)pksm.dev $(DD)pksmraw.dev $(DD)pamcmyk32.dev
 DEVICE_DEVS10=$(DD)tiffcrle.dev $(DD)tiffg3.dev $(DD)tiffg32d.dev $(DD)tiffg4.dev $(DD)tifflzw.dev $(DD)tiffpack.dev
-DEVICE_DEVS11=$(DD)tiff12nc.dev $(DD)tiff24nc.dev $(DD)tiffgray.dev $(DD)tiff32nc.dev $(DD)tiffsep.dev $(DD)tiffsep1.dev
+DEVICE_DEVS11=$(DD)tiff12nc.dev $(DD)tiff24nc.dev $(DD)tiffgray.dev $(DD)tiff32nc.dev $(DD)tiffsep.dev $(DD)tiffsep1.dev $(DD)tiffscaled.dev
 DEVICE_DEVS12=$(DD)psmono.dev $(DD)psgray.dev $(DD)psrgb.dev $(DD)bit.dev $(DD)bitrgb.dev $(DD)bitcmyk.dev
 DEVICE_DEVS13=$(DD)pngmono.dev $(DD)pnggray.dev $(DD)png16.dev $(DD)png256.dev $(DD)png16m.dev
 DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev $(DD)jpegcmyk.dev
@@ -272,9 +272,9 @@
 include $(GLSRCDIR)/lib.mak
 include $(PSSRCDIR)/int.mak
 include $(GLSRCDIR)/jpeg.mak
-# zlib.mak must precede libpng.mak
+# zlib.mak must precede png.mak
 include $(GLSRCDIR)/zlib.mak
-include $(GLSRCDIR)/libpng.mak
+include $(GLSRCDIR)/png.mak
 include $(GLSRCDIR)/jbig2.mak
 include $(GLSRCDIR)/jasper.mak
 include $(GLSRCDIR)/ldf_jb2.mak

Modified: branches/chrisl-test-gs/base/macosx.mak
===================================================================
--- branches/chrisl-test-gs/base/macosx.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/macosx.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -136,7 +136,7 @@
 # Define the directory where the PNG library sources are stored,
 # and the version of the library that is stored there.
 # You may need to change this if the libpng version changes.
-# See libpng.mak for more information.
+# See png.mak for more information.
 
 PNGSRCDIR=libpng
 
@@ -401,9 +401,9 @@
 include $(GLSRCDIR)/lib.mak
 include $(PSSRCDIR)/int.mak
 include $(GLSRCDIR)/jpeg.mak
-# zlib.mak must precede libpng.mak
+# zlib.mak must precede png.mak
 include $(GLSRCDIR)/zlib.mak
-include $(GLSRCDIR)/libpng.mak
+include $(GLSRCDIR)/png.mak
 include $(GLSRCDIR)/jbig2.mak
 include $(GLSRCDIR)/icclib.mak
 include $(GLSRCDIR)/ijs.mak

Modified: branches/chrisl-test-gs/base/mkromfs.c
===================================================================
--- branches/chrisl-test-gs/base/mkromfs.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/mkromfs.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1006,8 +1006,8 @@
                 "                       optimized and no comments form and writes this 'gs_init.ps'\n"
                 "                       to the current -d destination path. This is a space and\n"
                 "                       startup performance improvement, so also this should be\n"
-                "                       BEFORE other stuff in the %rom% list of files (currently\n"
-                "                       we do a sequential search in the %rom% directory).\n"
+                "                       BEFORE other stuff in the %%rom%% list of files (currently\n"
+                "                       we do a sequential search in the %%rom%% directory).\n"
                 "\n"
                 "                       For performance reasons, it is best to turn off compression\n"
                 "                       for the init file. Less frequently accessed files, if they\n"

Modified: branches/chrisl-test-gs/base/msvclib.mak
===================================================================
--- branches/chrisl-test-gs/base/msvclib.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/msvclib.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -131,7 +131,7 @@
 # Define the directory where the PNG library sources are stored,
 # and the version of the library that is stored there.
 # You may need to change this if the libpng version changes.
-# See libpng.mak for more information.
+# See png.mak for more information.
 
 !ifndef PNGSRCDIR
 PNGSRCDIR=libpng

Modified: branches/chrisl-test-gs/base/openvms.mak
===================================================================
--- branches/chrisl-test-gs/base/openvms.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/openvms.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -107,7 +107,7 @@
 # Define the directory where the PNG library sources are stored,
 # and the version of the library that is stored there.
 # You may need to change this if the libpng version changes.
-# See libpng.mak for more information.
+# See png.mak for more information.
 
 PNGSRCDIR=[.libpng]
 
@@ -223,7 +223,7 @@
 DEVICE_DEVS8=$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcx24b.dev $(DD)pcxcmyk.dev
 DEVICE_DEVS9=$(DD)pbm.dev $(DD)pbmraw.dev $(DD)pgm.dev $(DD)pgmraw.dev $(DD)pgnm.dev $(DD)pgnmraw.dev
 DEVICE_DEVS10=$(DD)tiffcrle.dev $(DD)tiffg3.dev $(DD)tiffg32d.dev $(DD)tiffg4.dev $(DD)tifflzw.dev $(DD)tiffpack.dev
-DEVICE_DEVS11=$(DD)tiff12nc.dev $(DD)tiff24nc.dev $(DD)tiffgray.dev $(DD)tiff32nc.dev $(DD)tiffsep.dev $(DD)tiffsep1.dev
+DEVICE_DEVS11=$(DD)tiff12nc.dev $(DD)tiff24nc.dev $(DD)tiffgray.dev $(DD)tiff32nc.dev $(DD)tiffsep.dev $(DD)tiffsep1.dev $(DD)tiffscaled.dev
 DEVICE_DEVS12=$(DD)psmono.dev $(DD)psgray.dev $(DD)psrgb.dev $(DD)bit.dev $(DD)bitrgb.dev $(DD)bitcmyk.dev
 DEVICE_DEVS13=$(DD)pngmono.dev $(DD)pnggray.dev $(DD)png16.dev $(DD)png256.dev $(DD)png16m.dev $(DD)pngalpha.dev
 DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev $(DD)jpegcmyk.dev
@@ -419,9 +419,9 @@
 include $(GLSRCDIR)lib.mak
 include $(PSSRCDIR)int.mak
 include $(GLSRCDIR)jpeg.mak
-# zlib.mak must precede libpng.mak
+# zlib.mak must precede png.mak
 include $(GLSRCDIR)zlib.mak
-include $(GLSRCDIR)libpng.mak
+include $(GLSRCDIR)png.mak
 include $(GLSRCDIR)jbig2.mak
 include $(GLSRCDIR)icclib.mak
 include $(GLSRCDIR)devs.mak

Modified: branches/chrisl-test-gs/base/openvms.mmk
===================================================================
--- branches/chrisl-test-gs/base/openvms.mmk	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/openvms.mmk	2010-10-21 09:19:31 UTC (rev 11833)
@@ -116,7 +116,7 @@
 # Define the directory where the PNG library sources are stored,
 # and the version of the library that is stored there.
 # You may need to change this if the libpng version changes.
-# See libpng.mak for more information.
+# See png.mak for more information.
 
 .ifdef SYSLIB
 PNGSRCDIR=sys$library:
@@ -428,9 +428,9 @@
 .include $(GLSRCDIR)lib.mak
 .include $(PSSRCDIR)int.mak
 .include $(GLSRCDIR)jpeg.mak
-# zlib.mak must precede libpng.mak
+# zlib.mak must precede png.mak
 .include $(GLSRCDIR)zlib.mak
-.include $(GLSRCDIR)libpng.mak
+.include $(GLSRCDIR)png.mak
 JBIG2_EXTRA_OBJS=$(JBIG2OBJDIR)$(D)snprintf.$(OBJ)
 .include $(GLSRCDIR)jbig2.mak
 .include $(GLSRCDIR)icclib.mak

Copied: branches/chrisl-test-gs/base/png.mak (from rev 11832, trunk/gs/base/png.mak)
===================================================================
--- branches/chrisl-test-gs/base/png.mak	                        (rev 0)
+++ branches/chrisl-test-gs/base/png.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -0,0 +1,142 @@
+#  Copyright (C) 2001-2007 Artifex Software, Inc.
+#  All Rights Reserved.
+#
+#  This software is provided AS-IS with no warranty, either express or
+#  implied.
+#
+#  This software is distributed under license and may not be copied, modified
+#  or distributed except as expressly authorized under the terms of that
+#  license.  Refer to licensing information at http://www.artifex.com/
+#  or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
+#  San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
+#
+# $Id$
+# makefile for PNG (Portable Network Graphics) code.
+# Users of this makefile must define the following:
+#	ZSRCDIR - the zlib source directory
+#	ZGENDIR - the zlib generated intermediate file directory
+#	ZOBJDIR - the zlib object directory
+#	PNGSRCDIR - the source directory
+#	PNGGENDIR - the generated intermediate file directory
+#	PNGOBJDIR - the object directory
+#	SHARE_LIBPNG - 0 to compile libpng, 1 to share
+#	LIBPNG_NAME - if SHARE_LIBPNG=1, the name of the shared library
+
+# This partial makefile compiles the png library for use in the Ghostscript
+# PNG drivers.  You can get the source code for this library from:
+#   http://www.libpng.org/pub/png/src/
+#   ftp://swrinde.nde.swri.edu/pub/png/src/
+#   ftp://ftp.uu.net/graphics/png/src/
+#   http://libpng.sourceforge.net/
+# Please see Ghostscript's `Make.htm' file for instructions about how to
+# unpack these archives.
+#
+# When each version of Ghostscript is released, we copy the associated
+# version of the png library to
+#	ftp://ftp.cs.wisc.edu/ghost/3rdparty/
+# for more convenient access.
+#
+# this makefile should work with libpng versions 0.90 and above
+#
+# NOTE: the archive for libpng 0.95 may be inconsistent: if you have
+# compilation problems, use a newer version.
+#
+# Please see Ghostscript's Make.htm file for instructions about how to
+# unpack these archives.
+#
+# The specification for the PNG file format is available from:
+#   http://www.group42.com/png.htm
+#   http://www.w3.org/pub/WWW/TR/WD-png
+
+# (Rename directories.)
+PNGSRC=$(PNGSRCDIR)$(D)
+PNGGEN=$(PNGGENDIR)$(D)
+PNGOBJ=$(PNGOBJDIR)$(D)
+PNGO_=$(O_)$(PNGOBJ)
+PZGEN=$(ZGENDIR)$(D)
+
+# PI_ and PF_ are defined in gs.mak.
+PNGCC=$(CC_) $(I_)$(PI_)$(_I) $(PF_) $(D_)PNG_NO_ASSEMBLER_CODE$(_D)
+
+# Define the name of this makefile.
+LIBPNG_MAK=$(GLSRC)png.mak
+
+png.clean : png.config-clean png.clean-not-config-clean
+
+### WRONG.  MUST DELETE OBJ AND GEN FILES SELECTIVELY.
+png.clean-not-config-clean :
+	$(RM_) $(PNGOBJ)*.$(OBJ)
+
+png.config-clean :
+	$(RM_) $(PNGGEN)lpg*.dev
+
+PDEP=$(AK)
+
+png_1=$(PNGOBJ)png.$(OBJ) $(PNGOBJ)pngmem.$(OBJ) $(PNGOBJ)pngerror.$(OBJ) $(PNGOBJ)pngset.$(OBJ)
+png_2=$(PNGOBJ)pngtrans.$(OBJ) $(PNGOBJ)pngwrite.$(OBJ) $(PNGOBJ)pngwtran.$(OBJ) $(PNGOBJ)pngwutil.$(OBJ) $(PNGOBJ)pngwio.$(OBJ)
+png_3=$(PNGOBJ)pngread.$(OBJ) $(PNGOBJ)pngrutil.$(OBJ) $(PNGOBJ)pngrtran.$(OBJ) $(PNGOBJ)pngrio.$(OBJ) $(PNGOBJ)pngget.$(OBJ)
+
+# libpng modules
+
+$(PNGOBJ)png.$(OBJ) : $(PNGSRC)png.c $(PDEP)
+	$(PNGCC) $(PNGO_)png.$(OBJ) $(C_) $(PNGSRC)png.c
+
+$(PNGOBJ)pngwio.$(OBJ) : $(PNGSRC)pngwio.c $(PDEP)
+	$(PNGCC) $(PNGO_)pngwio.$(OBJ) $(C_) $(PNGSRC)pngwio.c
+
+$(PNGOBJ)pngmem.$(OBJ) : $(PNGSRC)pngmem.c $(PDEP)
+	$(PNGCC) $(PNGO_)pngmem.$(OBJ) $(C_) $(PNGSRC)pngmem.c
+
+$(PNGOBJ)pngerror.$(OBJ) : $(PNGSRC)pngerror.c $(PDEP)
+	$(PNGCC) $(PNGO_)pngerror.$(OBJ) $(C_) $(PNGSRC)pngerror.c
+
+$(PNGOBJ)pngset.$(OBJ) : $(PNGSRC)pngset.c $(PDEP)
+	$(PNGCC) $(PNGO_)pngset.$(OBJ) $(C_) $(PNGSRC)pngset.c
+
+$(PNGOBJ)pngtrans.$(OBJ) : $(PNGSRC)pngtrans.c $(PDEP)
+	$(PNGCC) $(PNGO_)pngtrans.$(OBJ) $(C_) $(PNGSRC)pngtrans.c
+
+$(PNGOBJ)pngwrite.$(OBJ) : $(PNGSRC)pngwrite.c $(PDEP)
+	$(PNGCC) $(PNGO_)pngwrite.$(OBJ) $(C_) $(PNGSRC)pngwrite.c
+
+$(PNGOBJ)pngwtran.$(OBJ) : $(PNGSRC)pngwtran.c $(PDEP)
+	$(PNGCC) $(PNGO_)pngwtran.$(OBJ) $(C_) $(PNGSRC)pngwtran.c
+
+$(PNGOBJ)pngwutil.$(OBJ) : $(PNGSRC)pngwutil.c $(PDEP)
+	$(PNGCC) $(PNGO_)pngwutil.$(OBJ) $(C_) $(PNGSRC)pngwutil.c
+
+$(PNGOBJ)pngread.$(OBJ) : $(PNGSRC)pngread.c $(PDEP)
+	$(PNGCC) $(PNGO_)pngread.$(OBJ) $(C_) $(PNGSRC)pngread.c
+
+$(PNGOBJ)pngrutil.$(OBJ) : $(PNGSRC)pngrutil.c $(PDEP)
+	$(PNGCC) $(PNGO_)pngrutil.$(OBJ) $(C_) $(PNGSRC)pngrutil.c
+
+$(PNGOBJ)pngrtran.$(OBJ) : $(PNGSRC)pngrtran.c $(PDEP)
+	$(PNGCC) $(PNGO_)pngrtran.$(OBJ) $(C_) $(PNGSRC)pngrtran.c
+
+$(PNGOBJ)pngrio.$(OBJ) : $(PNGSRC)pngrio.c $(PDEP)
+	$(PNGCC) $(PNGO_)pngrio.$(OBJ) $(C_) $(PNGSRC)pngrio.c
+
+$(PNGOBJ)pngget.$(OBJ) : $(PNGSRC)pngget.c $(PDEP)
+	$(PNGCC) $(PNGO_)pngget.$(OBJ) $(C_) $(PNGSRC)pngget.c
+
+
+# Define the version of libpng.dev that we are actually using.
+$(PNGGEN)libpng.dev : $(TOP_MAKEFILES) $(PNGGEN)libpng_$(SHARE_LIBPNG).dev
+	$(CP_) $(PNGGEN)libpng_$(SHARE_LIBPNG).dev $(PNGGEN)libpng.dev
+
+# Define the shared version of libpng.
+# Note that it requires libz, which must be searched *after* libpng.
+$(PNGGEN)libpng_1.dev : $(TOP_MAKEFILES) $(LIBPNG_MAK) $(ECHOGS_XE) $(PZGEN)zlibe.dev
+	$(SETMOD) $(PNGGEN)libpng_1 -lib $(LIBPNG_NAME)
+	$(ADDMOD) $(PNGGEN)libpng_1 -include $(PZGEN)zlibe.dev
+
+# Define the non-shared version of libpng.
+$(PNGGEN)libpng_0.dev : $(LIBPNG_MAK) $(ECHOGS_XE) $(png_1) $(png_2) $(png_3)\
+ $(PZGEN)zlibe.dev $(PNGOBJ)pngwio.$(OBJ) $(PZGEN)crc32.dev
+	$(SETMOD) $(PNGGEN)libpng_0 $(png_1)
+	$(ADDMOD) $(PNGGEN)libpng_0 $(png_2)
+	$(ADDMOD) $(PNGGEN)libpng_0 $(png_3)
+	$(ADDMOD) $(PNGGEN)libpng_0 $(PNGOBJ)pngwio.$(OBJ)
+	$(ADDMOD) $(PNGGEN)libpng_0 -include $(PZGEN)zlibe.dev $(PZGEN)crc32.dev
+

Modified: branches/chrisl-test-gs/base/siscale.c
===================================================================
--- branches/chrisl-test-gs/base/siscale.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/siscale.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -61,18 +61,24 @@
     uint dst_offset, dst_size;
     CLIST dst_next_list;	/* for next output value */
     int dst_last_index;		/* highest index used in list */
-    CONTRIB dst_items[MAX_ISCALE_SUPPORT];	/* ditto */
+    /* Vertical filter details */
+    int filter_width;
+    int max_support;
+    double (*filter)(double);
+    double min_scale;
+    CONTRIB *dst_items; /* ditto */
 } stream_IScale_state;
 
-gs_private_st_ptrs5(st_IScale_state, stream_IScale_state,
+gs_private_st_ptrs6(st_IScale_state, stream_IScale_state,
     "ImageScaleEncode/Decode state",
     iscale_state_enum_ptrs, iscale_state_reloc_ptrs,
-    dst, src, tmp, contrib, items);
+    dst, src, tmp, contrib, items, dst_items);
 
 /* ------ Digital filter definition ------ */
 
 /* Mitchell filter definition */
-#define Mitchell_support 2.0
+#define Mitchell_support 2
+#define Mitchell_min_scale ((Mitchell_support * 2) / (MAX_ISCALE_SUPPORT - 1.01))
 #define B (1.0 / 3.0)
 #define C (1.0 / 3.0)
 static double
@@ -98,11 +104,21 @@
 	return 0;
 }
 
-#define filter_support Mitchell_support
-#define filter_proc Mitchell_filter
-#define fproc(t) filter_proc(t)
-#define fWidthIn filter_support
 
+/* Interpolated filter definition */
+#define Interp_support 1
+#define Interp_min_scale 0
+static double
+Interp_filter(double t)
+{
+    if (t < 0)
+        t = -t;
+
+    if (t >= 1)
+        return 0;
+    return 1 + (2*t -3)*t*t;
+}
+
 /*
  * The environment provides the following definitions:
  *      double fproc(double t)
@@ -114,18 +130,22 @@
 
 /* ------ Auxiliary procedures ------ */
 
-/* Define the minimum scale. */
-#define min_scale ((fWidthIn * 2) / (MAX_ISCALE_SUPPORT - 1.01))
-
 /* Calculate the support for a given scale. */
-/* The value is always in the range 1 .. MAX_ISCALE_SUPPORT. */
+/* The value is always in the range 1..max_support (was MAX_ISCALE_SUPPORT). */
 static int
-contrib_pixels(double scale)
+Interp_contrib_pixels(double scale)
 {
-    return (int)(fWidthIn / (scale >= 1.0 ? 1.0 : max(scale, min_scale))
+    return (int)(((float)Interp_support) / (scale >= 1.0 ? 1.0 : scale)
 		 * 2 + 1.5);
 }
 
+static int
+Mitchell_contrib_pixels(double scale)
+{
+    return (int)(((float)Mitchell_support) / (scale >= 1.0 ? 1.0 : max(scale, Mitchell_min_scale))
+                 * 2 + 1.5);
+}
+
 /* Pre-calculate filter contributions for a row or a column. */
 /* Return the highest input pixel index used. */
 static int
@@ -156,7 +176,13 @@
 	/* normally, the number of color components. */
 		     int stride,
 	/* The unit of output is 'rescale_factor' times the unit of input. */
-		     double rescale_factor
+                     double rescale_factor,
+        /* The filters width */
+                     int fWidthIn,
+        /* The filter to use */
+                     double (*fproc)(double),
+        /* minimum scale factor to use */
+                     double min_scale
 )
 {
     double WidthIn, fscale;
@@ -168,12 +194,11 @@
     if_debug1('w', "[w]calculate_contrib scale=%lg\n", scale);
     if (scale < 1.0) {
 	double clamped_scale = max(scale, min_scale);
-
-	WidthIn = fWidthIn / clamped_scale;
+        WidthIn = ((double)fWidthIn) / clamped_scale;
 	fscale = 1.0 / clamped_scale;
 	squeeze = true;
     } else {
-	WidthIn = fWidthIn;
+        WidthIn = (double)fWidthIn;
 	fscale = 1.0;
 	squeeze = false;
     }
@@ -286,7 +311,7 @@
 		          weight += *pp * cp->weight;
 		}
 		pixel = (int)(weight + 0.5);
-		if_debug1('W', " %x", pixel);
+                if_debug1('W', " %g", weight);
 		*tp = (byte)CLAMP(pixel, 0, 255);
 	    }
 	} else {		/* sizeofPixelIn == 2 */
@@ -311,7 +336,7 @@
 		          weight += *pp * cp->weight;
 		}
 		pixel = (int)(weight + 0.5);
-		if_debug1('W', " %x", pixel);
+                if_debug1('W', " %g", weight);
 		*tp = (byte)CLAMP(pixel, 0, 255);
 	    }
 	}
@@ -383,28 +408,29 @@
     calculate_contrib(&ss->dst_next_list, ss->dst_items, 
 		      (double)ss->params.EntireHeightOut / ss->params.EntireHeightIn,
 		      y, ss->src_y_offset, ss->params.EntireHeightOut, ss->params.EntireHeightIn, 
-		      1, ss->params.HeightIn, MAX_ISCALE_SUPPORT, row_size,
-		      (double)ss->params.MaxValueOut / 255 );
+                      1, ss->params.HeightIn, ss->max_support, row_size,
+                      (double)ss->params.MaxValueOut / 255, ss->filter_width,
+                      ss->filter, ss->min_scale);
     int first_index_mod = ss->dst_next_list.first_pixel / row_size;
 
     if_debug2('w', "[W]calculate_dst_contrib for y = %d, y+offset=%d\n", y, y + ss->src_y_offset);
     ss->dst_last_index = last_index;
-    last_index %= MAX_ISCALE_SUPPORT;
+    last_index %= ss->max_support;
     if (last_index < first_index_mod) {		/* Shuffle the indices to account for wraparound. */
-	CONTRIB shuffle[MAX_ISCALE_SUPPORT];
+        CONTRIB *shuffle = &ss->dst_items[ss->max_support];
 	int i;
 
-	for (i = 0; i < MAX_ISCALE_SUPPORT; ++i) {
+        for (i = 0; i < ss->max_support; ++i) {
 	    shuffle[i].weight =
 		(i <= last_index ?
-		 ss->dst_items[i + MAX_ISCALE_SUPPORT - first_index_mod].weight :
+                 ss->dst_items[i + ss->max_support - first_index_mod].weight :
 		 i >= first_index_mod ?
 		 ss->dst_items[i - first_index_mod].weight :
 		 0);
 	    if_debug1('W', " %f", shuffle[i].weight);
 	}
-	memcpy(ss->dst_items, shuffle, MAX_ISCALE_SUPPORT * sizeof(CONTRIB));
-	ss->dst_next_list.n = MAX_ISCALE_SUPPORT;
+        memcpy(ss->dst_items, shuffle, ss->max_support * sizeof(CONTRIB));
+        ss->dst_next_list.n = ss->max_support;
 	ss->dst_next_list.first_pixel = 0;
     }
     if_debug0('W', "\n");
@@ -423,9 +449,18 @@
     ss->items = 0;
 }
 
+typedef struct filter_defn_s {
+    double  (*filter)(double);
+    int     filter_width;
+    int     (*contrib_pixels)(double scale);
+    double  min_scale;
+} filter_defn_s;
+
 /* Initialize the filter. */
 static int
-s_IScale_init(stream_state * st)
+do_init(stream_state        *st,
+        const filter_defn_s *horiz,
+        const filter_defn_s *vert)
 {
     stream_IScale_state *const ss = (stream_IScale_state *) st;
     gs_memory_t *mem = ss->memory;
@@ -442,24 +477,39 @@
     ss->dst_offset = 0;
 
     /* create intermediate image to hold horizontal zoom */
+    ss->max_support  = vert->contrib_pixels((double)ss->params.EntireHeightOut/
+                                            ss->params.EntireHeightIn);
+    ss->filter_width = vert->filter_width;
+    ss->filter       = vert->filter;
+    ss->min_scale    = vert->min_scale;
     ss->tmp = (byte *) gs_alloc_byte_array(mem,
-					   min(ss->params.HeightIn, MAX_ISCALE_SUPPORT),
-			      ss->params.WidthOut * ss->params.Colors * sizeof(byte),
+                                           ss->max_support,
+                                           (ss->params.WidthOut *
+                                            ss->params.Colors * sizeof(float)),
 					       "image_scale tmp");
     ss->contrib = (CLIST *) gs_alloc_byte_array(mem,
-					   max(ss->params.WidthOut, ss->params.HeightOut),
-				      sizeof(CLIST), "image_scale contrib");
-    ss->items = (CONTRIB *) gs_alloc_byte_array(mem,
-				  contrib_pixels((double)ss->params.EntireWidthOut / 
-					ss->params.EntireWidthIn) * ss->params.WidthOut,
-				 sizeof(CONTRIB), "image_scale contrib[*]");
+                                                max(ss->params.WidthOut,
+                                                    ss->params.HeightOut),
+                                                sizeof(CLIST),
+                                                "image_scale contrib");
+    ss->items = (CONTRIB *)
+                    gs_alloc_byte_array(mem,
+                                        (horiz->contrib_pixels(
+                                            (double)ss->params.EntireWidthOut /
+                                            ss->params.EntireWidthIn) *
+                                         ss->params.WidthOut),
+                                         sizeof(CONTRIB),
+                                         "image_scale contrib[*]");
+    ss->dst_items = (CONTRIB *) gs_alloc_byte_array(mem,
+                                                    ss->max_support*2,
+                                                    sizeof(CONTRIB), "image_scale contrib_dst[*]");
     /* Allocate buffers for 1 row of source and destination. */
     ss->dst = gs_alloc_byte_array(mem, ss->params.WidthOut * ss->params.Colors,
 				  ss->sizeofPixelOut, "image_scale dst");
     ss->src = gs_alloc_byte_array(mem, ss->params.WidthIn * ss->params.Colors,
 				  ss->sizeofPixelIn, "image_scale src");
     if (ss->tmp == 0 || ss->contrib == 0 || ss->items == 0 ||
-	ss->dst == 0 || ss->src == 0
+        ss->dst_items == 0 || ss->dst == 0 || ss->src == 0
 	) {
 	s_IScale_release(st);
 	return ERRC;
@@ -470,7 +520,8 @@
 		      (double)ss->params.EntireWidthOut / ss->params.EntireWidthIn,
 		      0, 0, ss->params.WidthOut, ss->params.WidthIn, 
 		      ss->params.WidthOut, ss->params.WidthIn, ss->params.WidthIn,
-		      ss->params.Colors, 255. / ss->params.MaxValueIn);
+                      ss->params.Colors, 255. / ss->params.MaxValueIn,
+                      horiz->filter_width, horiz->filter, horiz->min_scale);
 
     /* Prepare the weights for the first output row. */
     calculate_dst_contrib(ss, 0);
@@ -479,6 +530,40 @@
 
 }
 
+static const filter_defn_s Mitchell_defn =
+{
+    Mitchell_filter,
+    Mitchell_support,
+    Mitchell_contrib_pixels,
+    Mitchell_min_scale
+};
+
+static const filter_defn_s Interp_defn =
+{
+    Interp_filter,
+    Interp_support,
+    Interp_contrib_pixels,
+    Interp_min_scale
+};
+
+static int
+s_IScale_init(stream_state * st)
+{
+    stream_IScale_state *const ss = (stream_IScale_state *) st;
+    const filter_defn_s *horiz = &Mitchell_defn;
+    const filter_defn_s *vert  = &Mitchell_defn;
+
+    /* By default we use the mitchell filter, but if we are scaling down
+     * (either on the horizontal or the vertical axis) then use the simple
+     * interpolation filter for that axis. */
+    if (ss->params.EntireWidthOut < ss->params.EntireWidthIn)
+        horiz = &Interp_defn;
+    if (ss->params.EntireHeightOut < ss->params.EntireHeightIn)
+        vert = &Interp_defn;
+
+    return do_init(st, horiz, vert);
+}
+
 /* Process a buffer.  Note that this handles Encode and Decode identically. */
 static int
 s_IScale_process(stream_state * st, stream_cursor_read * pr,
@@ -555,8 +640,8 @@
 	    }
 	    /* Apply filter to zoom horizontally from src to tmp. */
 	    if_debug2('w', "[w]zoom_x y = %d to tmp row %d\n",
-		      ss->src_y, (ss->src_y % MAX_ISCALE_SUPPORT));
-	    zoom_x(ss->tmp + (ss->src_y % MAX_ISCALE_SUPPORT) *
+                      ss->src_y, (ss->src_y % ss->max_support));
+            zoom_x(ss->tmp + (ss->src_y % ss->max_support) *
 		   ss->params.WidthOut * ss->params.Colors, row,
 		   ss->sizeofPixelIn, ss->params.WidthOut, ss->params.WidthIn,
 		   ss->params.Colors, ss->contrib, ss->items);
@@ -585,6 +670,8 @@
     ss->dst = 0;
     gs_free_object(mem, ss->items, "image_scale contrib[*]");
     ss->items = 0;
+    gs_free_object(mem, ss->items, "image_scale contrib_dst[*]");
+    ss->dst_items = 0;
     gs_free_object(mem, ss->contrib, "image_scale contrib");
     ss->contrib = 0;
     gs_free_object(mem, ss->tmp, "image_scale tmp");

Modified: branches/chrisl-test-gs/base/sjpx.c
===================================================================
--- branches/chrisl-test-gs/base/sjpx.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/sjpx.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -165,7 +165,7 @@
 #endif /* DEBUG */
 
 static int
-copy_row_gray(unsigned char *dest, jas_image_t *image,
+copy_row_gray(byte *dest, jas_image_t *image,
         int x, int y, int bytes)
 {
     int i, p;
@@ -200,7 +200,7 @@
 }
 
 static int
-copy_row_rgb(unsigned char *dest, jas_image_t *image,
+copy_row_rgb(byte *dest, jas_image_t *image,
         int x, int y, int bytes)
 {
     int i, p;
@@ -227,7 +227,7 @@
 }
 
 static int
-copy_row_yuv(unsigned char *dest, jas_image_t *image,
+copy_row_yuv(byte *dest, jas_image_t *image,
         int x, int y, int bytes)
 {
     int i,j;
@@ -286,24 +286,111 @@
     return count;
 }
 
+
+static inline bool 
+is_color_component(jas_image_t *image, int n)
+{
+    int k = jas_image_cmpttype(image, n) & (JAS_IMAGE_CT_UNKNOWN | JAS_IMAGE_CT_OPACITY);
+    return !k;
+}
+
+static int color_cmpts(jas_image_t *image)
+{
+     int cnt = 0;
+     int n = jas_image_numcmpts(image);
+
+     while(--n >= 0) {
+        if (is_color_component(image, n))
+            cnt++;
+    }
+    return cnt;
+}
+
 static int
-copy_row_default(unsigned char *dest, jas_image_t *image,
+copy_row_default(byte *dest, jas_image_t *image,
         int x, int y, int bytes)
 {
-    int i, c,n;
+    int i, c, d, n, clr;
     int count;
 
     n = jas_image_numcmpts(image);
-    count = (bytes/n) * n;
-    for (i = 1; i <= count; i+=n) {
-        for (c = 0; c < n; c++)
-            dest[i+c] = jas_image_readcmptsample(image, c, x, y);
+    clr = color_cmpts(image);
+    count = (bytes/clr) * clr;
+    for (i = 1; i <= count; i += clr) {
+        for (c = d = 0; c < n; c++) {
+            if (is_color_component(image, c)) {
+                dest[i + d++] = jas_image_readcmptsample(image, c, x, y);
+            }
+        }
         x++;
     }
-
     return count;
 }
 
+/* This is really inefficient and needs some work but at least
+   now we will get 16 bit data out correctly when it is in a non standard
+   color space. Note that indexing into dest (stream buffer) starts at +1. */
+static int
+copy_row_default16(byte *dest, jas_image_t *image,
+        int x, int y, int bytes)
+{
+    int c, n, clr;
+    int count;
+    int pixel_width;
+    byte *curr_ptr = dest+1;  /* The offset */
+    int value;
+
+    n = jas_image_numcmpts(image);
+    clr = color_cmpts(image);
+    count = bytes;
+    pixel_width = clr*sizeof(unsigned short);
+
+    while (count >= pixel_width) {
+        for (c = 0; c < n; c++) {
+            if (is_color_component(image, c)) {
+                value = jas_image_readcmptsample(image, c, x, y);
+                /* endian issues here? */
+                *curr_ptr++ = ((value >> 8) & 0xff);
+                *curr_ptr++ = (value & 0xff);
+            }
+        }
+        x++;
+        count =  count - pixel_width;
+    }
+    return bytes-count;
+}
+
+static int
+copy_row_gray16(byte *dest, jas_image_t *image,
+        int x, int y, int bytes, int bits)
+{
+    int count;
+    int pixel_width;
+    byte *curr_ptr = dest+1; /* The offset */
+    int shift;
+    int p, v;
+    unsigned short value;
+
+    v = jas_image_getcmptbytype(image, JAS_IMAGE_CT_GRAY_Y);
+    if (v < 0) return 0; /* no matching component */
+
+    count = bytes;
+    pixel_width = 2;
+    shift = max(16 - bits, 0);
+
+    while (count >= pixel_width) {
+        p = jas_image_readcmptsample(image, v, x, y);
+        value = p << shift;
+        /* endian issues here? */
+        *curr_ptr++ = ((value >> 8) & 0xff);
+        *curr_ptr++ = (value & 0xff);
+        x++;
+        count =  count - pixel_width;
+    }
+    return bytes-count;
+}
+
+
 /* buffer the input stream into our state */
 static int
 s_jpxd_buffer_input(stream_jpxd_state *const state, stream_cursor_read *pr,
@@ -312,10 +399,10 @@
     /* grow internal buffer if necessary */
     if (bytes > state->bufsize - state->buffill) {
         int newsize = state->bufsize;
-        unsigned char *newbuf = NULL;
+        byte *newbuf = NULL;
         while (newsize - state->buffill < bytes)
             newsize <<= 1;
-        newbuf = (unsigned char *)gs_malloc(state->jpx_memory, newsize, 1,
+        newbuf = (byte *)gs_malloc(state->jpx_memory, newsize, 1,
                                             "JPXDecode temp buffer");
         /* TODO: check for allocation failure */
         memcpy(newbuf, state->buffer, state->buffill);
@@ -416,23 +503,30 @@
       }
       if (state->image != NULL) {
         jas_image_t *image = state->image;
-        int numcmpts = jas_image_numcmpts(image);
+        int numcmpts = color_cmpts(image);
         int bits = jas_image_cmptprec(image, 0);
-        int stride = numcmpts*jas_image_width(image);
-        long image_size = stride*jas_image_height(image);
+        int stride, image_size;
         int clrspc = jas_image_clrspc(image);
         int x, y;
         long usable, done;
 
+        stride = numcmpts*jas_image_width(image);
+
+        if (bits > 8)  stride = 2*numcmpts*jas_image_width(image);
         if (bits == 4) stride = (stride + 1)/2;
 
+        image_size = stride*jas_image_height(image);
         /* copy data out of the decoded image data */
         /* be lazy and only write the rest of the current row */
         y = state->offset / stride;
         x = state->offset - y*stride; /* bytes, not samples */
         usable = min(out_size, stride - x);
-        x = x/numcmpts;               /* now samples */
-
+        /* now samples */
+        if (bits > 8) {
+            x = x/(numcmpts*2);               
+        } else {
+            x = x/numcmpts;     
+        }
         /* Make sure we can return a full pixel.
            This can fail if we get the colorspace wrong. */
         if (usable < numcmpts) return ERRC;
@@ -458,10 +552,20 @@
         else /* use the stream's colorspace */
           switch (jas_clrspc_fam(clrspc)) {
                 case JAS_CLRSPC_FAM_GRAY:
+                    if (bits > 8) {
+                        done = copy_row_gray16(pw->ptr, image, x, y, usable, bits);
+                    } else {
                     done = copy_row_gray(pw->ptr, image, x, y, usable);
+                    }
                     break;
                 case JAS_CLRSPC_FAM_RGB:
+                    if (bits == 16) {
+                        /* This will have issues if we have mixed compononents
+                           with different bps. Unlikely, but it could happen */
+                        done = copy_row_default16(pw->ptr, image, x, y, usable);
+                    } else {
                     done = copy_row_rgb(pw->ptr, image, x, y, usable);
+                    }
                     break;
                 case JAS_CLRSPC_FAM_YCBCR:
                     done = copy_row_yuv(pw->ptr, image, x, y, usable);
@@ -470,7 +574,13 @@
                 case JAS_CLRSPC_FAM_LAB:
                 case JAS_CLRSPC_FAM_UNKNOWN:
                 default:
+                    if (bits == 16) {
+                        /* This will have issues if we have mixed compononents
+                           with different bps. Unlikely, but it could happen */
+                        done = copy_row_default16(pw->ptr, image, x, y, usable);
+                    } else {
                     done = copy_row_default(pw->ptr, image, x, y, usable);
+                    }
                     break;
          }
         /* advance pointers for returned data */
@@ -517,6 +627,7 @@
     state->buffill = 0;
     /* the following can be set by the client before calling init() */
     state->colorspace = gs_jpx_cs_unset;
+    state->alpha = false;
 }
 
 

Modified: branches/chrisl-test-gs/base/sjpx.h
===================================================================
--- branches/chrisl-test-gs/base/sjpx.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/sjpx.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -51,6 +51,7 @@
     long bufsize; /* total size of the buffer */
     long buffill; /* number of bytes written into the buffer */
     gs_jpx_cs colorspace; /* external colorspace setting */
+    bool alpha; /* return opacity channel */
 }
 stream_jpxd_state;
 

Modified: branches/chrisl-test-gs/base/sjpx_luratech.c
===================================================================
--- branches/chrisl-test-gs/base/sjpx_luratech.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/sjpx_luratech.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -371,7 +371,10 @@
             state->offset += available;
             pw->ptr += available;
             /* more output to deliver? */
-            if (state->offset == state->stride*state->height) return 1;
+            if (state->offset == state->stride*state->height)
+		return EOFC;
+	    else
+		return 1;
         }
     }
 

Modified: branches/chrisl-test-gs/base/stdint_.h
===================================================================
--- branches/chrisl-test-gs/base/stdint_.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/stdint_.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -57,7 +57,7 @@
    typedef unsigned int            uint32_t;
    typedef unsigned __int64        uint64_t;
 #  define STDINT_TYPES_DEFINED
-# elif defined(__VMS) /* OpenVMS provides these types in inttypes.h */
+# elif defined(__VMS) || defined(__osf__) /* OpenVMS and Tru64 provide these types in inttypes.h */
 #  include <inttypes.h>
 #  define STDINT_TYPES_DEFINED
 # elif defined(__CYGWIN__)

Modified: branches/chrisl-test-gs/base/strmio.h
===================================================================
--- branches/chrisl-test-gs/base/strmio.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/strmio.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -55,7 +55,7 @@
 /*
  * Seek to beginning of the file
  */
-int srewind(stream *s);;
+int srewind(stream *s);
 
 /*
  * Return the current position in the stream or -1 if error.

Copied: branches/chrisl-test-gs/base/tiff.mak (from rev 11832, trunk/gs/base/tiff.mak)
===================================================================
--- branches/chrisl-test-gs/base/tiff.mak	                        (rev 0)
+++ branches/chrisl-test-gs/base/tiff.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -0,0 +1,214 @@
+#  Copyright (C) 2001-2007 Artifex Software, Inc.
+#  All Rights Reserved.
+#
+#  This software is provided AS-IS with no warranty, either express or
+#  implied.
+#
+#  This software is distributed under license and may not be copied, modified
+#  or distributed except as expressly authorized under the terms of that
+#  license.  Refer to licensing information at http://www.artifex.com/
+#  or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
+#  San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
+#
+# $Id$
+# makefile for libtiff.
+# Users of this makefile must define the following:
+#	TIFFSRCDIR    - the source directory
+#	TIFFGEN       - the generated intermediate file directory
+#	SHARE_LIBTIFF - 0 to compile libtiff, 1 to share
+#	LIBTIFF_NAME  - if SHARE_LIBTIFF=1, the name of the shared library
+
+# (Rename directories.)
+TIFFSRC=$(TIFFSRCDIR)$(D)
+TIFFGEN=$(TIFFGENDIR)$(D)
+TIFFOBJ=$(TIFFOBJDIR)$(D)
+TIFFO_=$(O_)$(TIFFOBJ)
+JPEGGEN=$(JGENDIR)$(D)
+
+TIFFCONFIG=$(TIFFSRC)libtiff$(D)tif_config$(TIFFCONFIG_SUFFIX).h
+TIFFCONF=$(TIFFSRC)libtiff$(D)tiffconf$(TIFFCONFIG_SUFFIX).h
+
+# Define the name of this makefile.
+LIBTIFF_MAK=$(GLSRC)tiff.mak
+
+TIFFCC=$(CC_) $(I_)$(TI_) $(II)$(JI_)$(_I) $(PF_)
+
+TIFFDEP = $(AK) $(TIFFGEN)tif_config.h $(TIFFGEN)tiffconf.h
+
+tiff_1=$(TIFFOBJ)tif_aux.$(OBJ) $(TIFFOBJ)tif_close.$(OBJ) $(TIFFOBJ)tif_codec.$(OBJ) $(TIFFOBJ)tif_color.$(OBJ)
+tiff_2=$(TIFFOBJ)tif_compress.$(OBJ) $(TIFFOBJ)tif_dir.$(OBJ) $(TIFFOBJ)tif_dirinfo.$(OBJ) $(TIFFOBJ)tif_dirread.$(OBJ)
+tiff_3=$(TIFFOBJ)tif_dirwrite.$(OBJ) $(TIFFOBJ)tif_dumpmode.$(OBJ) $(TIFFOBJ)tif_error.$(OBJ) $(TIFFOBJ)tif_extension.$(OBJ)
+tiff_4=$(TIFFOBJ)tif_fax3.$(OBJ) $(TIFFOBJ)tif_fax3sm.$(OBJ) $(TIFFOBJ)tif_flush.$(OBJ) $(TIFFOBJ)tif_getimage.$(OBJ)
+tiff_5=$(TIFFOBJ)tif_jbig.$(OBJ) $(TIFFOBJ)tif_jpeg.$(OBJ) $(TIFFOBJ)tif_luv.$(OBJ) $(TIFFOBJ)tif_lzw.$(OBJ)
+tiff_6=$(TIFFOBJ)tif_next.$(OBJ) $(TIFFOBJ)tif_ojpeg.$(OBJ) $(TIFFOBJ)tif_open.$(OBJ) $(TIFFOBJ)tif_packbits.$(OBJ)
+tiff_7=$(TIFFOBJ)tif_pixarlog.$(OBJ) $(TIFFOBJ)tif_predict.$(OBJ) $(TIFFOBJ)tif_print.$(OBJ) $(TIFFOBJ)tif_read.$(OBJ)
+tiff_8=$(TIFFOBJ)tif_strip.$(OBJ) $(TIFFOBJ)tif_swab.$(OBJ) $(TIFFOBJ)tif_thunder.$(OBJ) $(TIFFOBJ)tif_tile.$(OBJ)
+tiff_9=$(TIFFOBJ)tif_$(TIFFPLATFORM).$(OBJ) $(TIFFOBJ)tif_version.$(OBJ) $(TIFFOBJ)tif_warning.$(OBJ) $(TIFFOBJ)tif_write.$(OBJ)
+tiff_10=$(TIFFOBJ)tif_zip.$(OBJ)
+
+$(TIFFSRC)libtiff$(D)tif_config.unix.h : $(TIFFSRC)libtiff$(D)tif_config.h.in
+	cd $(TIFFSRC) && ./configure
+	$(CP_) $(TIFFSRC)libtiff$(D)tif_config.h $(TIFFSRC)libtiff$(D)tif_config.unix.h
+
+$(TIFFSRC)libtiff$(D)tiffconf.unix.h : $(TIFFSRC)libtiff$(D)tiffconf.h.in
+	cd $(TIFFSRC) && ./configure
+	$(CP_) $(TIFFSRC)libtiff$(D)tiffconf.h $(TIFFSRC)libtiff$(D)tiffconf.unix.h
+
+$(TIFFOBJ)tif_aux.$(OBJ) : $(TIFFSRC)/libtiff/tif_aux.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_aux.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_aux.c
+
+$(TIFFOBJ)tif_close.$(OBJ) : $(TIFFSRC)/libtiff/tif_close.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_close.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_close.c
+
+$(TIFFOBJ)tif_codec.$(OBJ) : $(TIFFSRC)/libtiff/tif_codec.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_codec.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_codec.c
+
+$(TIFFOBJ)tif_color.$(OBJ) : $(TIFFSRC)/libtiff/tif_color.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_color.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_color.c
+
+$(TIFFOBJ)tif_compress.$(OBJ) : $(TIFFSRC)/libtiff/tif_compress.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_compress.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_compress.c
+
+$(TIFFOBJ)tif_dir.$(OBJ) : $(TIFFSRC)/libtiff/tif_dir.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_dir.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_dir.c
+
+$(TIFFOBJ)tif_dirinfo.$(OBJ) : $(TIFFSRC)/libtiff/tif_dirinfo.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_dirinfo.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_dirinfo.c
+
+$(TIFFOBJ)tif_dirread.$(OBJ) : $(TIFFSRC)/libtiff/tif_dirread.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_dirread.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_dirread.c
+
+$(TIFFOBJ)tif_dirwrite.$(OBJ) : $(TIFFSRC)/libtiff/tif_dirwrite.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_dirwrite.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_dirwrite.c
+
+$(TIFFOBJ)tif_dumpmode.$(OBJ) : $(TIFFSRC)/libtiff/tif_dumpmode.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_dumpmode.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_dumpmode.c
+
+$(TIFFOBJ)tif_error.$(OBJ) : $(TIFFSRC)/libtiff/tif_error.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_error.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_error.c
+
+$(TIFFOBJ)tif_extension.$(OBJ) : $(TIFFSRC)/libtiff/tif_extension.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_extension.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_extension.c
+
+$(TIFFOBJ)tif_fax3.$(OBJ) : $(TIFFSRC)/libtiff/tif_fax3.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_fax3.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_fax3.c
+
+$(TIFFOBJ)tif_fax3sm.$(OBJ) : $(TIFFSRC)/libtiff/tif_fax3sm.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_fax3sm.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_fax3sm.c
+
+$(TIFFOBJ)tif_flush.$(OBJ) : $(TIFFSRC)/libtiff/tif_flush.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_flush.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_flush.c
+
+$(TIFFOBJ)tif_getimage.$(OBJ) : $(TIFFSRC)/libtiff/tif_getimage.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_getimage.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_getimage.c
+
+$(TIFFOBJ)tif_jbig.$(OBJ) : $(TIFFSRC)/libtiff/tif_jbig.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_jbig.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_jbig.c
+
+$(TIFFOBJ)tif_jpeg.$(OBJ) : $(TIFFSRC)/libtiff/tif_jpeg.c $(TIFFDEP) $(JGENDIR)/jconfig.h
+	$(TIFFCC) $(TIFFO_)tif_jpeg.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_jpeg.c
+
+$(TIFFOBJ)tif_luv.$(OBJ) : $(TIFFSRC)/libtiff/tif_luv.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_luv.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_luv.c
+
+$(TIFFOBJ)tif_lzw.$(OBJ) : $(TIFFSRC)/libtiff/tif_lzw.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_lzw.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_lzw.c
+
+$(TIFFOBJ)tif_next.$(OBJ) : $(TIFFSRC)/libtiff/tif_next.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_next.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_next.c
+
+$(TIFFOBJ)tif_ojpeg.$(OBJ) : $(TIFFSRC)/libtiff/tif_ojpeg.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_ojpeg.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_ojpeg.c
+
+$(TIFFOBJ)tif_open.$(OBJ) : $(TIFFSRC)/libtiff/tif_open.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_open.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_open.c
+
+$(TIFFOBJ)tif_packbits.$(OBJ) : $(TIFFSRC)/libtiff/tif_packbits.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_packbits.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_packbits.c
+
+$(TIFFOBJ)tif_pixarlog.$(OBJ) : $(TIFFSRC)/libtiff/tif_pixarlog.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_pixarlog.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_pixarlog.c
+
+$(TIFFOBJ)tif_predict.$(OBJ) : $(TIFFSRC)/libtiff/tif_predict.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_predict.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_predict.c
+
+$(TIFFOBJ)tif_print.$(OBJ) : $(TIFFSRC)/libtiff/tif_print.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_print.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_print.c
+
+$(TIFFOBJ)tif_read.$(OBJ) : $(TIFFSRC)/libtiff/tif_read.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_read.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_read.c
+
+$(TIFFOBJ)tif_strip.$(OBJ) : $(TIFFSRC)/libtiff/tif_strip.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_strip.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_strip.c
+
+$(TIFFOBJ)tif_swab.$(OBJ) : $(TIFFSRC)/libtiff/tif_swab.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_swab.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_swab.c
+
+$(TIFFOBJ)tif_thunder.$(OBJ) : $(TIFFSRC)/libtiff/tif_thunder.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_thunder.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_thunder.c
+
+$(TIFFOBJ)tif_tile.$(OBJ) : $(TIFFSRC)/libtiff/tif_tile.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_tile.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_tile.c
+
+$(TIFFOBJ)tif_version.$(OBJ) : $(TIFFSRC)/libtiff/tif_version.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_version.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_version.c
+
+$(TIFFOBJ)tif_warning.$(OBJ) : $(TIFFSRC)/libtiff/tif_warning.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_warning.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_warning.c
+
+$(TIFFOBJ)tif_write.$(OBJ) : $(TIFFSRC)/libtiff/tif_write.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_write.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_write.c
+
+$(TIFFOBJ)tif_zip.$(OBJ) : $(TIFFSRC)/libtiff/tif_zip.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_zip.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_zip.c
+
+# tif_win32.c include <windows.h> and needed to be compiled with non-ansi extensions.
+# so it has a different compiler flag compared to other tif_$(TIFFPLATFORM).c .
+# We also have this target before tif_$(TIFFPLATFORM).c for this reason.
+$(TIFFOBJ)tif_win32.$(OBJ) : $(TIFFSRC)/libtiff/tif_win32.c $(TIFFDEP)
+	$(CC) $(I_)$(TI_) $(II)$(JI_)$(_I) $(PF_) $(TIFFO_)tif_win32.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_win32.c
+
+## Generic target:
+## we may need to add targets for openvms, mac classics, os2, etc later. For the time
+## being only win32 and unix (including mac os x) are supported.
+#$(TIFFOBJ)tif_$(TIFFPLATFORM).$(OBJ) : $(TIFFSRC)/libtiff/tif_$(TIFFPLATFORM).c $(TIFFDEP)
+#	$(TIFFCC) $(TIFFO_)tif_$(TIFFPLATFORM).$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_$(TIFFPLATFORM).c
+
+$(TIFFOBJ)tif_unix.$(OBJ) : $(TIFFSRC)/libtiff/tif_unix.c $(TIFFDEP)
+	$(TIFFCC) $(TIFFO_)tif_unix.$(OBJ) $(C_) $(TIFFSRC)/libtiff/tif_unix.c
+
+$(TIFFGEN)tif_config.h: $(TIFFCONFIG)
+	$(CP_) $(TIFFCONFIG) $(TIFFGEN)tif_config.h
+	
+$(TIFFGEN)tiffconf.h: $(TIFFCONF)
+	$(CP_) $(TIFFCONF) $(TIFFGEN)tiffconf.h
+	
+# Define the version of libtiff.dev that we are actually using.
+$(TIFFGEN)libtiff.dev : $(TOP_MAKEFILES) $(TIFFGEN)libtiff_$(SHARE_LIBTIFF).dev
+	$(CP_) $(TIFFGEN)libtiff_$(SHARE_LIBTIFF).dev $(TIFFGEN)libtiff.dev
+
+
+# Define the shared version.
+$(TIFFGEN)libtiff_1.dev : $(TOP_MAKEFILES) $(LIBTIFF_MAK) $(ECHOGS_XE) $(JPEGGEN)jpegd.dev $(JPEGGEN)jpege.dev
+	$(SETMOD) $(TIFFGEN)libtiff_1 -lib $(LIBTIFF_NAME)
+	$(ADDMOD) $(TIFFGEN)libtiff_1 -include $(JPEGGEN)jpegd.dev
+	$(ADDMOD) $(TIFFGEN)libtiff_1 -include $(JPEGGEN)jpege.dev
+
+# Define the non-shared version.
+$(TIFFGEN)libtiff_0.dev : $(LIBTIFF_MAK) $(ECHOGS_XE) \
+    $(tiff_1) $(tiff_2) $(tiff_3) $(tiff_4) $(tiff_5) \
+    $(tiff_6) $(tiff_7) $(tiff_8) $(tiff_9) $(tiff_10) \
+    $(JPEGGEN)jpegd.dev $(JPEGGEN)jpege.dev
+	$(SETMOD) $(TIFFGEN)libtiff_0 $(tiff_1)
+	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_2)
+	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_3)
+	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_4)
+	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_5)
+	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_6)
+	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_7)
+	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_8)
+	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_9)
+	$(ADDMOD) $(TIFFGEN)libtiff_0 $(tiff_10)
+	$(ADDMOD) $(TIFFGEN)libtiff_0 -include $(JPEGGEN)jpegd.dev
+	$(ADDMOD) $(TIFFGEN)libtiff_0 -include $(JPEGGEN)jpege.dev
+

Modified: branches/chrisl-test-gs/base/time_.h
===================================================================
--- branches/chrisl-test-gs/base/time_.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/time_.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -35,7 +35,7 @@
 #  include <sys/time.h>
 #  if defined(Plan9) || defined(M_UNIX) || defined(_IBMR2) || \
       defined(_SEQUENT_) || defined(__GNUC__) || defined(__INTEL_COMPILER) ||\
-      defined(__hpux)
+      defined(__hpux) || defined(__SUNPRO_C)
      /* Plan 9, SCO, AIX and Sequent's DYNIX/ptx need both time.h and
       * sys/time.h! As of version 2.2, at least some glibc
       * installations also require both files. 

Modified: branches/chrisl-test-gs/base/ugcclib.mak
===================================================================
--- branches/chrisl-test-gs/base/ugcclib.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/ugcclib.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -150,9 +150,9 @@
 include $(GLSRCDIR)/gs.mak
 include $(GLSRCDIR)/lib.mak
 include $(GLSRCDIR)/jpeg.mak
-# zlib.mak must precede libpng.mak
+# zlib.mak must precede png.mak
 include $(GLSRCDIR)/zlib.mak
-include $(GLSRCDIR)/libpng.mak
+include $(GLSRCDIR)/png.mak
 include $(GLSRCDIR)/jbig2.mak
 include $(GLSRCDIR)/icclib.mak
 include $(GLSRCDIR)/ijs.mak

Modified: branches/chrisl-test-gs/base/unix-gcc.mak
===================================================================
--- branches/chrisl-test-gs/base/unix-gcc.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/unix-gcc.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -144,7 +144,7 @@
 # Define the directory where the PNG library sources are stored,
 # and the version of the library that is stored there.
 # You may need to change this if the libpng version changes.
-# See libpng.mak for more information.
+# See png.mak for more information.
 
 PNGSRCDIR=libpng
 
@@ -397,7 +397,7 @@
 DEVICE_DEVS8=$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcx24b.dev $(DD)pcxcmyk.dev
 DEVICE_DEVS9=$(DD)pbm.dev $(DD)pbmraw.dev $(DD)pgm.dev $(DD)pgmraw.dev $(DD)pgnm.dev $(DD)pgnmraw.dev $(DD)pnm.dev $(DD)pnmraw.dev $(DD)ppm.dev $(DD)ppmraw.dev $(DD)pkm.dev $(DD)pkmraw.dev $(DD)pksm.dev $(DD)pksmraw.dev
 DEVICE_DEVS10=$(DD)tiffcrle.dev $(DD)tiffg3.dev $(DD)tiffg32d.dev $(DD)tiffg4.dev $(DD)tifflzw.dev $(DD)tiffpack.dev
-DEVICE_DEVS11=$(DD)tiff12nc.dev $(DD)tiff24nc.dev $(DD)tiff48nc.dev $(DD)tiffgray.dev $(DD)tiff32nc.dev $(DD)tiff64nc.dev $(DD)tiffsep.dev $(DD)tiffsep1.dev
+DEVICE_DEVS11=$(DD)tiff12nc.dev $(DD)tiff24nc.dev $(DD)tiff48nc.dev $(DD)tiffgray.dev $(DD)tiff32nc.dev $(DD)tiff64nc.dev $(DD)tiffsep.dev $(DD)tiffsep1.dev $(DD)tiffscaled.dev
 DEVICE_DEVS12=$(DD)psmono.dev $(DD)psgray.dev $(DD)psrgb.dev $(DD)bit.dev $(DD)bitrgb.dev $(DD)bitcmyk.dev
 DEVICE_DEVS13=$(DD)pngmono.dev $(DD)pnggray.dev $(DD)png16.dev $(DD)png256.dev $(DD)png16m.dev $(DD)pngalpha.dev
 DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev $(DD)jpegcmyk.dev
@@ -451,10 +451,10 @@
 include $(PSSRCDIR)/int.mak
 include $(GLSRCDIR)/freetype.mak
 include $(GLSRCDIR)/jpeg.mak
-# zlib.mak must precede libpng.mak
+# zlib.mak must precede png.mak
 include $(GLSRCDIR)/zlib.mak
-include $(GLSRCDIR)/libpng.mak
-include $(GLSRCDIR)/libtiff.mak
+include $(GLSRCDIR)/png.mak
+include $(GLSRCDIR)/tiff.mak
 include $(GLSRCDIR)/jbig2.mak
 include $(GLSRCDIR)/icclib.mak
 include $(GLSRCDIR)/lcms.mak

Modified: branches/chrisl-test-gs/base/unixansi.mak
===================================================================
--- branches/chrisl-test-gs/base/unixansi.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/unixansi.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -129,7 +129,7 @@
 # Define the directory where the PNG library sources are stored,
 # and the version of the library that is stored there.
 # You may need to change this if the libpng version changes.
-# See libpng.mak for more information.
+# See png.mak for more information.
 
 PNGSRCDIR=libpng
 
@@ -342,7 +342,7 @@
 DEVICE_DEVS8=$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcx24b.dev $(DD)pcxcmyk.dev
 DEVICE_DEVS9=$(DD)pbm.dev $(DD)pbmraw.dev $(DD)pgm.dev $(DD)pgmraw.dev $(DD)pgnm.dev $(DD)pgnmraw.dev
 DEVICE_DEVS10=$(DD)tiffcrle.dev $(DD)tiffg3.dev $(DD)tiffg32d.dev $(DD)tiffg4.dev $(DD)tifflzw.dev $(DD)tiffpack.dev
-DEVICE_DEVS11=$(DD)tiff12nc.dev $(DD)tiff24nc.dev $(DD)tiffgray.dev $(DD)tiff32nc.dev $(DD)tiffsep.dev $(DD)tiffsep1.dev
+DEVICE_DEVS11=$(DD)tiff12nc.dev $(DD)tiff24nc.dev $(DD)tiffgray.dev $(DD)tiff32nc.dev $(DD)tiffsep.dev $(DD)tiffsep1.dev $(DD)tiffscaled.dev
 DEVICE_DEVS12=$(DD)psmono.dev $(DD)psgray.dev $(DD)psrgb.dev $(DD)bit.dev $(DD)bitrgb.dev $(DD)bitcmyk.dev
 DEVICE_DEVS13=$(DD)pngmono.dev $(DD)pnggray.dev $(DD)png16.dev $(DD)png256.dev $(DD)png16m.dev $(DD)pngalpha.dev
 DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev $(DD)jpegcmyk.dev
@@ -392,11 +392,11 @@
 include $(PSSRCDIR)/int.mak
 include $(GLSRCDIR)/freetype.mak
 include $(GLSRCDIR)/jpeg.mak
-# zlib.mak must precede libpng.mak
+# zlib.mak must precede png.mak
 include $(GLSRCDIR)/zlib.mak
-include $(GLSRCDIR)/libpng.mak
+include $(GLSRCDIR)/png.mak
 include $(GLSRCDIR)/jbig2.mak
-include $(GLSRCDIR)/libtiff.mak
+include $(GLSRCDIR)/tiff.mak
 include $(GLSRCDIR)/icclib.mak
 include $(GLSRCDIR)/lcms.mak
 include $(GLSRCDIR)/ijs.mak

Modified: branches/chrisl-test-gs/base/unixinst.mak
===================================================================
--- branches/chrisl-test-gs/base/unixinst.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/unixinst.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -54,7 +54,7 @@
 PSEXDIR=$(PSLIBDIR)/../examples
 PSMANDIR=$(PSLIBDIR)/../man
 
-install-data: install-libdata install-resdata install-iccdata install-doc install-man install-examples
+install-data: install-libdata install-resdata$(COMPILE_INITS) install-iccdata$(COMPILE_INITS) install-doc install-man install-examples
 
 # There's no point in providing a complete dependency list: we include
 # one file from each subdirectory just as a sanity check.
@@ -94,7 +94,7 @@
 # install the default resource files
 # copy in every category (directory) but CVS
 RES_CATEGORIES=`ls $(PSRESDIR) | grep -v CVS` 
-install-resdata: $(PSRESDIR)/Decoding/Unicode
+install-resdata0 : $(PSRESDIR)/Decoding/Unicode
 	-mkdir -p $(DESTDIR)$(datadir)
 	-mkdir -p $(DESTDIR)$(gsdir)
 	-mkdir -p $(DESTDIR)$(gsdatadir)/Resource
@@ -107,7 +107,7 @@
 	done'
 
 # install default iccprofiles
-install-iccdata: $(ICCRESDIR)
+install-iccdata0 : $(ICCRESDIR)
 	-mkdir -p $(DESTDIR)$(datadir)
 	-mkdir -p $(DESTDIR)$(gsdir)
 	-mkdir -p $(DESTDIR)$(gsdatadir)/iccprofiles
@@ -115,6 +115,12 @@
 	    if test -f $$file; then $(INSTALL_DATA) $$file $(DESTDIR)$(gsdatadir)/iccprofiles ; fi \
 	done'
 
+#COMPILE_INITS=1 don't need Resources, nor ICC
+
+install-resdata1 :
+
+install-iccdata1 :
+
 # install html documentation
 DOC_PAGES=PUBLIC README index.html gs.css \
 	   API.htm Bug-form.htm Bug-info.htm \

Copied: branches/chrisl-test-gs/base/valgrind.h (from rev 11832, trunk/gs/base/valgrind.h)
===================================================================
--- branches/chrisl-test-gs/base/valgrind.h	                        (rev 0)
+++ branches/chrisl-test-gs/base/valgrind.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -0,0 +1,77 @@
+/* Copyright (C) 2001-2007 Artifex Software, Inc.
+   All Rights Reserved.
+  
+   This software is provided AS-IS with no warranty, either express or
+   implied.
+
+   This software is distributed under license and may not be copied, modified
+   or distributed except as expressly authorized under the terms of that
+   license.  Refer to licensing information at http://www.artifex.com/
+   or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
+   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
+*/
+
+/* $Id:$ */
+/* This header provides stubbed out definitions for the valgrind/memcheck
+ * client requests that do nothing. This allows us to use these requests
+ * in the gs source without requiring that Valgrind is available on our
+ * target platform.
+ *
+ * To enable the macros, simply predefine ENABLE_VALGRIND, whereupon this
+ * file will #include "valgrind/memcheck.h" and get the real versions.
+ *
+ * This mechanism has been chosen over the more traditional "copy memcheck.h
+ * into your code" approach as not all our platforms support valgrind, and
+ * we'd rather avoid the (albeit small) overhead that the client requests
+ * cost at runtime when valgrind is not in use. Also, this protects us from
+ * changes in valgrind/memcheck.h between valgrind releases.
+ */
+
+#ifndef valgrind_INCLUDED
+#  define valgrind_INCLUDED
+
+#ifdef ENABLE_VALGRIND
+
+/* Enabled, so get the real header from the system. */
+#include "valgrind/memcheck.h"
+
+#else
+
+/* Disabled, so just stub the calls out */
+#include "stdpre.h"
+
+/* Stub out the Valgrind memcheck functions here */
+#define VALGRIND_MAKE_MEM_NOACCESS(_qzz_addr,_qzz_len)           \
+    DO_NOTHING
+#define VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr,_qzz_len)          \
+    DO_NOTHING
+#define VALGRIND_MAKE_MEM_DEFINED(_qzz_addr,_qzz_len)            \
+    DO_NOTHING
+#define VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE(_qzz_addr,_qzz_len)     \
+    DO_NOTHING
+#define VALGRIND_CREATE_BLOCK(_qzz_addr,_qzz_len, _qzz_desc)	   \
+    DO_NOTHING
+#define VALGRIND_DISCARD(_qzz_blkindex)                          \
+    DO_NOTHING
+#define VALGRIND_CHECK_MEM_IS_ADDRESSABLE(_qzz_addr,_qzz_len)      \
+    DO_NOTHING
+#define VALGRIND_CHECK_MEM_IS_DEFINED(_qzz_addr,_qzz_len)        \
+    DO_NOTHING
+#define VALGRIND_CHECK_VALUE_IS_DEFINED(__lvalue)                \
+    DO_NOTHING
+#define VALGRIND_DO_LEAK_CHECK                                   \
+    DO_NOTHING
+#define VALGRIND_DO_QUICK_LEAK_CHECK				 \
+    DO_NOTHING
+#define VALGRIND_COUNT_LEAKS(leaked, dubious, reachable, suppressed)     \
+    DO_NOTHING
+#define VALGRIND_COUNT_LEAK_BLOCKS(leaked, dubious, reachable, suppressed) \
+    DO_NOTHING
+#define VALGRIND_GET_VBITS(zza,zzvbits,zznbytes)                     \
+    DO_NOTHING
+#define VALGRIND_SET_VBITS(zza,zzvbits,zznbytes)                     \
+    DO_NOTHING
+
+#endif /* ENABLE_VALGRIND */
+
+#endif /* valgrind_INCLUDED */

Modified: branches/chrisl-test-gs/base/version.mak
===================================================================
--- branches/chrisl-test-gs/base/version.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/version.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -16,10 +16,10 @@
 # Major and minor version numbers.
 # MINOR0 is different from MINOR only if MINOR is a single digit.
 GS_VERSION_MAJOR=9
-GS_VERSION_MINOR=00
-GS_VERSION_MINOR0=00
+GS_VERSION_MINOR=01
+GS_VERSION_MINOR0=01
 # Revision date: year x 10000 + month x 100 + day.
-GS_REVISIONDATE=20100731
+GS_REVISIONDATE=20100914
 # Derived values
 GS_VERSION=$(GS_VERSION_MAJOR)$(GS_VERSION_MINOR0)
 GS_DOT_VERSION=$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR0)

Deleted: branches/chrisl-test-gs/base/watclib.mak
===================================================================
--- branches/chrisl-test-gs/base/watclib.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/watclib.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1,189 +0,0 @@
-#  Copyright (C) 2001-2006 Artifex Software, Inc.
-#  All Rights Reserved.
-#
-#  This software is provided AS-IS with no warranty, either express or
-#  implied.
-#
-#  This software is distributed under license and may not be copied, modified
-#  or distributed except as expressly authorized under the terms of that
-#  license.  Refer to licensing information at http://www.artifex.com/
-#  or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
-#  San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
-#
-# $Id$
-# makefile for MS-DOS / Watcom C/C++ library testing.
-
-libdefault: $(GLOBJ)gslib.exe
-	$(NO_OP)
-
-AROOTDIR=c:/gs
-GSROOTDIR=$(AROOTDIR)/gs$(GS_DOT_VERSION)
-GS_DOCDIR=$(GSROOTDIR)/doc
-GS_LIB_DEFAULT=$(GSROOTDIR)/Resource/Init\;$(GSROOTDIR)/lib\;$(GSROOTDIR)/Resource/Font\;$(AROOTDIR)/fonts
-SEARCH_HERE_FIRST=0
-GS_INIT=gs_init.ps
-
-!ifndef DEBUG
-DEBUG=1
-!endif
-!ifndef TDEBUG
-TDEBUG=1
-!endif
-
-GS=gslib
-
-!ifndef BINDIR
-BINDIR=.\debugobj
-!endif
-!ifndef GLSRCDIR
-GLSRCDIR=.\base
-!endif
-!ifndef PSRESDIR
-PSRESDIR=.\Resource
-!endif
-!ifndef GLGENDIR
-GLGENDIR=.\debugobj
-!endif
-!ifndef GLOBJDIR
-GLOBJDIR=.\debugobj
-!endif
-
-# Do not edit the next group of lines.
-NUL=
-DD=$(GLGENDIR)\$(NUL)
-GLD=$(GLGENDIR)\$(NUL)
-
-!ifndef JSRCDIR
-JSRCDIR=jpeg
-!endif
-
-!ifndef PNGSRCDIR
-PNGSRCDIR=libpng
-!endif
-
-!ifndef ZSRCDIR
-ZSRCDIR=zlib
-!endif
-
-# Define the jbig2dec library and source location.
-# See jbig2.mak for more information.
-
-!ifndef JBIG2_LIB
-JBIG2_LIB=jbig2dec
-!endif
-
-!ifndef JBIG2SRCDIR
-JBIG2SRCDIR=jbig2dec
-!endif
-
-# Define the directory where the lcms source is stored.
-# See lcms.mak for more information
-
-!ifndef LCMSSRCDIR
-LCMSSRCDIR=lcms
-!endif
-
-# Define the directory where the ijs source is stored,
-# and the process forking method to use for the server.
-# See ijs.mak for more information.
-
-!ifndef IJSSRCDIR
-IJSSRCDIR=ijs
-IJSEXECTYPE=win
-!endif
-
-# Define the directory where the imdi library source is stored.
-# See devs.mak for more information
-
-!ifndef IMDISRCDIR
-IMDISRCDIR=imdi
-!endif
-
-CFLAGS=
-
-!ifndef WCVERSION
-WCVERSION=10.0
-!endif
-LIBPATHS=LIBPATH $(%WATCOM)\lib386 LIBPATH $(%WATCOM)\lib386\dos
-STUB=$(%WATCOM)\binb\wstub.exe
-
-!ifndef CPU_TYPE
-CPU_TYPE=386
-!endif
-
-!ifndef SYNC
-SYNC=winsync
-!endif
-
-PLATFORM=watclib_
-MAKEFILE=$(GLSRCDIR)\watclib.mak
-TOP_MAKEFILES=$(MAKEFILE) $(GLSRCDIR)\wccommon.mak
-PLATOPT=
-
-!include $(GLSRCDIR)\wccommon.mak
-
-!ifndef FEATURE_DEVS
-FEATURE_DEVS=$(GLD)patlib.dev $(GLD)path1lib.dev
-!endif
-!ifndef DEVICE_DEVS
-DEVICE_DEVS=$(DD)vga.dev
-!endif
-
-!ifndef COMPILE_INITS
-COMPILE_INITS=0
-!endif
-!ifndef BAND_LIST_STORAGE
-BAND_LIST_STORAGE=file
-!endif
-!ifndef BAND_LIST_COMPRESSOR
-BAND_LIST_COMPRESSOR=zlib
-!endif
-!ifndef FILE_IMPLEMENTATION
-FILE_IMPLEMENTATION=stdio
-!endif
-!ifndef STDIO_IMPLEMENTATION
-STDIO_IMPLEMENTATION=
-!endif
-
-!include $(GLSRCDIR)\wctail.mak
-!include $(GLSRCDIR)\devs.mak
-!include $(GLSRCDIR)\contrib.mak
-
-GLCCWIN=$(GLCC)
-!include $(GLSRCDIR)\winplat.mak
-
-watclib_1=$(GLOBJ)gp_getnv.$(OBJ) $(GLOBJ)gp_paper.$(OBJ) $(GLOBJ)gp_iwatc.$(OBJ)
-!ifeq WAT32 0
-watclib_2=$(GLOBJ)gp_dosfs.$(OBJ) $(GLOBJ)gp_dosfe.$(OBJ) $(GLOBJ)gp_msdos.$(OBJ)
-watclib_inc=
-!else
-watclib_2=
-watclib_inc=$(GLD)winplat.dev
-!endif
-watclib__=$(watclib_1) $(watclib_2)
-$(GLGEN)watclib_.dev: $(watclib__) $(GLGEN)nosync.dev $(watclib_inc)
-	$(SETMOD) $(GLGEN)watclib_ $(watclib_1)
-	$(ADDMOD) $(GLGEN)watclib_ -obj $(watclib_2)
-	$(ADDMOD) $(GLGEN)watclib_ -include $(GLGEN)nosync $(watclib_inc)
-
-$(GLOBJ)gp_iwatc.$(OBJ): $(GLSRC)gp_iwatc.c $(stat__h) $(string__h)\
- $(gx_h) $(gp_h) $(gpmisc_h)
-	$(GLCC) $(GLO_)gp_iwatc.$(OBJ) $(C_) $(GLSRC)gp_iwatc.c
-
-BEGINFILES=*.err
-
-LIB_ONLY=$(GLOBJ)gslib.obj $(GLOBJ)gsnogc.obj $(GLOBJ)gconfig.obj $(GLOBJ)gscdefs.obj $(GLOBJ)gsromfs$(COMPILE_INITS).$(OBJ)
-ll_tr=ll.tr
-$(ll_tr): $(TOP_MAKEFILES)
-	echo OPTION STACK=64k >$(ll_tr)
-!ifeq WAT32 0
-	echo SYSTEM DOS4G >>$(ll_tr)
-	echo OPTION STUB=$(STUB) >>$(ll_tr)
-!endif
-	echo FILE $(GLOBJ)gsromfs$(COMPILE_INITS).$(OBJ) >>$(ll_tr)
-	echo FILE $(GLOBJ)gsnogc.obj >>$(ll_tr)
-	echo FILE $(GLOBJ)gconfig.obj >>$(ll_tr)
-	echo FILE $(GLOBJ)gscdefs.obj >>$(ll_tr)
-
-$(GLOBJ)gslib.exe: $(LIB_ALL) $(LIB_ONLY) $(ld_tr) $(ll_tr)
-	$(LINK) $(LCT) NAME gslib OPTION MAP=gslib FILE $(GLOBJ)gslib @$(ld_tr) @$(ll_tr)

Deleted: branches/chrisl-test-gs/base/watcw32.mak
===================================================================
--- branches/chrisl-test-gs/base/watcw32.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/watcw32.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1,484 +0,0 @@
-#  Copyright (C) 2001-2007 Artifex Software, Inc.
-#  All Rights Reserved.
-#
-#  This software is provided AS-IS with no warranty, either express or
-#  implied.
-#
-#  This software is distributed under license and may not be copied, modified
-#  or distributed except as expressly authorized under the terms of that
-#  license.  Refer to licensing information at http://www.artifex.com/
-#  or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
-#  San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
-#
-# $Id$
-# watcw32.mak
-# makefile for Watcom C++ v??, Windows NT or Windows 95 platform.
-# Created 1997-02-23 by Russell Lang from MSVC++ 4.0 makefile.
-# Major revisions 1999-07-26 by Ray Johnston.
-
-# ------------------------------- Options ------------------------------- #
-
-###### This section is the only part of the file you should need to edit.
-
-# ------ Generic options ------ #
-
-# Define the directory for the final executable, and the
-# source, generated intermediate file, and object directories
-# for the graphics library (GL) and the PostScript/PDF interpreter (PS).
-
-BINDIR=bin
-GLSRCDIR=base
-GLGENDIR=obj
-GLOBJDIR=obj
-PSSRCDIR=psi
-PSLIBDIR=lib
-PSRESDIR=Resource
-PSGENDIR=obj
-PSOBJDIR=obj
-
-# Define the root directory for Ghostscript installation.
-
-AROOTDIR=c:/gs
-GSROOTDIR=$(AROOTDIR)/gs$(GS_DOT_VERSION)
-
-# Define the directory that will hold documentation at runtime.
-
-GS_DOCDIR=$(GSROOTDIR)/doc
-
-# Define the default directory/ies for the runtime
-# initialization, resource and font files.  Separate multiple directories with \;.
-# Use / to indicate directories, not a single \.
-
-GS_LIB_DEFAULT=$(GSROOTDIR)/Resource/Init\;$(GSROOTDIR)/lib\;$(GSROOTDIR)/Resource/Font\;$(AROOTDIR)/fonts
-
-# Define whether or not searching for initialization files should always
-# look in the current directory first.  This leads to well-known security
-# and confusion problems, but users insist on it.
-
-SEARCH_HERE_FIRST=0
-
-# Define the name of the interpreter initialization file.
-# (There is no reason to change this.)
-
-GS_INIT=gs_init.ps
-
-# Choose generic configuration options.
-
-# Setting DEBUG=1 includes debugging features (-Z switch) in the code.
-# Code runs substantially slower even if no debugging switches are set,
-# and also takes about another 25K of memory.
-
-DEBUG=0
-
-# Setting TDEBUG=1 includes symbol table information for the debugger,
-# and also enables stack checking.  Code is substantially slower and larger.
-
-TDEBUG=0
-
-# Define the name of the executable file.
-
-GS=gswin32
-GSCONSOLE=gswin32c
-GSDLL=gsdll32
-
-# To build two small executables and a large DLL use MAKEDLL=1
-# To build two large executables use MAKEDLL=0
-
-MAKEDLL=1
-
-# Define the directory where the IJG JPEG library sources are stored,
-# and the major version of the library that is stored there.
-# You may need to change this if the IJG library version changes.
-# See jpeg.mak for more information.
-
-JSRCDIR=jpeg
-
-# Define the directory where the PNG library sources are stored,
-# and the version of the library that is stored there.
-# You may need to change this if the libpng version changes.
-# See libpng.mak for more information.
-
-PNGSRCDIR=libpng
-
-# Define the directory where the zlib sources are stored.
-# See zlib.mak for more information.
-
-ZSRCDIR=zlib
-
-# Define the jbig2dec library source location.
-# See jbig2.mak for more information.
-
-!ifndef JBIG2_LIB
-JBIG2_LIB=jbig2dec
-!endif
-
-!ifndef JBIG2SRCDIR
-JBIG2SRCDIR=jbig2dec
-!endif
-
-# Define the directory where the lcms source is stored.
-# See lcms.mak for more information
-
-!ifndef LCMSSRCDIR
-LCMSSRCDIR=lcms
-!endif
-
-# Define the directory where the ijs source is stored,
-# and the process forking method to use for the server.
-# See ijs.mak for more information.
-
-IJSSRCDIR=ijs
-IJSEXECTYPE=win
-
-# Define the directory where the imdi source are stored.
-# See imdi.mak for more information
-
-!ifndef IMDISRCDIR
-IMDISRCDIR=imdi
-!endif
-
-# Define any other compilation flags.
-
-CFLAGS=
-
-# ------ Platform-specific options ------ #
-
-# Define the drive, directory, and compiler name for the Watcom C files.
-# COMPDIR contains the compiler and linker.
-# INCDIR contains the include files.
-# LIBDIR contains the library files.
-# COMP is the full C compiler path name.
-# COMPCPP is the full C++ compiler path name.
-# COMPAUX is the compiler name for DOS utilities.
-# RCOMP is the resource compiler name.
-# LINK is the full linker path name.
-# Note that INCDIR and LIBDIR are always followed by a \,
-#   so if you want to use the current directory, use an explicit '.'.
-
-COMPBASE=$(%WATCOM)
-COMPDIR=$(COMPBASE)\binnt
-INCDIR=$(COMPBASE)\h -i$(COMPBASE)\h\nt
-LIBDIR=$(COMPBASE)\lib386;$(COMPBASE)\lib386\nt
-COMP=$(COMPDIR)\wcc386
-COMPCPP=$(COMPDIR)\wpp386
-COMPAUX=$(COMPDIR)\wcc386
-RCOMP=$(COMPDIR)\wrc
-LINK=$(COMPDIR)\wlink
-
-# Define the processor architecture. (always i386)
-CPU_FAMILY=i386
-
-# Define the processor (CPU) type.  (386, 486 or 586)
-CPU_TYPE=486
-
-# Define the math coprocessor (FPU) type.
-# Options are -1 (optimize for no FPU), 0 (optimize for FPU present,
-# but do not require a FPU), 87, 287, or 387.
-# If you have a 486 or Pentium CPU, you should normally set FPU_TYPE to 387,
-# since most of these CPUs include the equivalent of an 80387 on-chip;
-# however, the 486SX and the Cyrix 486SLC do not have an on-chip FPU, so if
-# you have one of these CPUs and no external FPU, set FPU_TYPE to -1 or 0.
-# An xx87 option means that the executable will run only if a FPU
-# of that type (or higher) is available: this is NOT currently checked
-# at runtime.
-
-FPU_TYPE=387
-
-# Define the .dev module that implements thread and synchronization
-# primitives for this platform.  Don't change this unless you really know
-# what you're doing.
-
-SYNC=winsync
-
-# Do not edit the next group of lines.
-NUL=
-DD=$(GLGENDIR)\$(NUL)
-GLD=$(GLGENDIR)\$(NUL)
-PSD=$(PSGENDIR)\$(NUL)
-
-# ------ Devices and features ------ #
-
-# Choose the language feature(s) to include.  See gs.mak for details.
-
-FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)ttfont.dev $(PSD)epsf.dev
-
-# Choose whether to compile the .ps initialization files into the executable.
-# See gs.mak for details.
-
-COMPILE_INITS=0
-
-# Choose whether to store band lists on files or in memory.
-# The choices are 'file' or 'memory'.
-
-BAND_LIST_STORAGE=file
-
-# Choose which compression method to use when storing band lists in memory.
-# The choices are 'lzw' or 'zlib'.
-
-BAND_LIST_COMPRESSOR=zlib
-
-# Choose the implementation of file I/O: 'stdio', 'fd', or 'both'.
-# See gs.mak and sfxfd.c for more details.
-
-FILE_IMPLEMENTATION=stdio
-
-# Choose the implementation of stdio: '' for file I/O and 'c' for callouts
-# See gs.mak and ziodevs.c/ziodevsc.c for more details.
-
-STDIO_IMPLEMENTATION=c
-
-# Choose the device(s) to include.  See devs.mak for details,
-# devs.mak and contrib.mak for the list of available devices.
-
-DEVICE_DEVS=$(DD)display.dev $(DD)mswindll.dev $(DD)mswinpr2.dev
-DEVICE_DEVS2=$(DD)epson.dev $(DD)eps9high.dev $(DD)eps9mid.dev $(DD)epsonc.dev $(DD)ibmpro.dev
-DEVICE_DEVS3=$(DD)deskjet.dev $(DD)djet500.dev $(DD)laserjet.dev $(DD)ljetplus.dev $(DD)ljet2p.dev
-DEVICE_DEVS4=$(DD)cdeskjet.dev $(DD)cdjcolor.dev $(DD)cdjmono.dev $(DD)cdj550.dev
-DEVICE_DEVS5=$(DD)djet500c.dev $(DD)declj250.dev $(DD)lj250.dev $(DD)jetp3852.dev $(DD)r4081.dev $(DD)lbp8.dev $(DD)uniprint.dev
-DEVICE_DEVS6=$(DD)st800.dev $(DD)stcolor.dev $(DD)bj10e.dev $(DD)bj200.dev $(DD)m8510.dev $(DD)necp6.dev $(DD)bjc600.dev $(DD)bjc800.dev
-DEVICE_DEVS7=$(DD)t4693d2.dev $(DD)t4693d4.dev $(DD)t4693d8.dev $(DD)tek4696.dev
-DEVICE_DEVS8=$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcx24b.dev $(DD)pcxcmyk.dev
-DEVICE_DEVS9=$(DD)pbm.dev $(DD)pbmraw.dev $(DD)pgm.dev $(DD)pgmraw.dev $(DD)pgnm.dev $(DD)pgnmraw.dev $(DD)pnm.dev $(DD)pnmraw.dev $(DD)ppm.dev $(DD)ppmraw.dev $(DD)pamcmyk32.dev
-DEVICE_DEVS10=$(DD)tiffcrle.dev $(DD)tiffg3.dev $(DD)tiffg32d.dev $(DD)tiffg4.dev $(DD)tifflzw.dev $(DD)tiffpack.dev
-DEVICE_DEVS11=$(DD)bmpmono.dev $(DD)bmp16.dev $(DD)bmp256.dev $(DD)bmp16m.dev $(DD)tiff12nc.dev $(DD)tiff24nc.dev $(DD)tiffgray.dev $(DD)tiff32nc.dev $(DD)tiffsep.dev $(DD)tiffsep1.dev
-DEVICE_DEVS12=$(DD)psmono.dev $(DD)bit.dev $(DD)bitrgb.dev $(DD)bitcmyk.dev
-DEVICE_DEVS13=$(DD)pngmono.dev $(DD)pnggray.dev $(DD)png16.dev $(DD)png256.dev $(DD)png16m.dev $(DD)pngalpha.dev
-DEVICE_DEVS14=$(DD)jpeg.dev $(DD)jpeggray.dev $(DD)jpegcmyk.dev
-DEVICE_DEVS15=$(DD)pdfwrite.dev $(DD)pswrite.dev $(DD)ps2write.dev $(DD)epswrite.dev $(DD)txtwrite.dev $(DD)pxlmono.dev $(DD)pxlcolor.dev
-# Overflow for DEVS3,4,5,6,9
-DEVICE_DEVS16=$(DD)ljet3.dev $(DD)ljet3d.dev $(DD)ljet4.dev $(DD)ljet4d.dev
-DEVICE_DEVS17=$(DD)pj.dev $(DD)pjxl.dev $(DD)pjxl300.dev
-DEVICE_DEVS18=
-DEVICE_DEVS19=
-DEVICE_DEVS20=
-
-# ---------------------------- End of options ---------------------------- #
-
-# Define the name of the makefile -- used in dependencies.
-
-MAKEFILE=$(PSSRCDIR)\watcw32.mak
-TOP_MAKEFILES=$(MAKEFILE) $(GLSRCDIR)\winlib.mak $(PSSRCDIR)\winint.mak
-
-# Define the executable and shell invocations.
-
-D=\\
-
-EXP=
-SH=
-
-# Define the arguments for genconf.
-
-CONFILES=-e ~ -p FILE~s~ps
-CONFLDTR=-o
-
-# Define the generic compilation flags.
-
-PLATOPT=
-
-# Make sure we get the right default target for make.
-
-dosdefault: default
-
-# Define the compilation flags.
-
-!ifeq CPU_TYPE 586
-CPFLAGS=-5s
-!else
-!ifeq CPU_TYPE 486
-CPFLAGS=-4s
-!else
-!ifeq CPU_TYPE 386
-CPFLAGS=-3s
-!else
-CPFLAGS=
-!endif
-!endif
-!endif
-
-!ifeq FPU_TYPE 586
-FPFLAGS=-fp5
-!else
-!ifeq FPU_TYPE 486
-FPFLAGS=-fp4
-!else
-!ifeq FPU_TYPE 386
-FPFLAGS=-fp3
-!else
-FPFLAGS=
-!endif
-!endif
-!endif
-
-
-!ifneq DEBUG 0
-CD=-dDEBUG
-!else
-CD=
-!endif
-
-!ifneq TDEBUG 0
-# What options should WATCOM use for $(CT) when debugging?
-CT=-d2
-LCT=DEBUG ALL
-COMPILE_FULL_OPTIMIZED=    # no optimization when debugging
-COMPILE_WITH_FRAMES=    # no optimization when debugging
-COMPILE_WITHOUT_FRAMES=    # no optimization when debugging
-!else
-CT=-d1
-LCT=DEBUG LINES
-COMPILE_FULL_OPTIMIZED=-oilmre -s
-COMPILE_WITH_FRAMES=-of+
-COMPILE_WITHOUT_FRAMES=-s
-!endif
-
-!ifneq DEBUG 0
-CS=
-!else
-CS=-s
-!endif
-
-# Specify function prolog type
-COMPILE_FOR_DLL=-bd
-COMPILE_FOR_EXE=
-COMPILE_FOR_CONSOLE_EXE=
-
-GENOPT=-d+ $(CD) $(CT) $(CS) -zq -zp8
-
-CCFLAGS=$(PLATOPT) $(FPFLAGS) $(CPFLAGS) $(CFLAGS) $(XCFLAGS)
-CC=$(COMP) $(CCFLAGS) @$(GLGENDIR)\ccf32.tr
-CPP=$(COMPCPP) $(CCFLAGS) @$(GLGENDIR)\ccf32.tr
-!ifneq MAKEDLL 0
-WX=$(COMPILE_FOR_DLL)
-!else
-WX=$(COMPILE_FOR_EXE)
-!endif
-CC_WX=$(CC) $(WX)
-CC_=$(CC_WX) $(COMPILE_FULL_OPTIMIZED)
-CC_NO_WARN=$(CC_)
-CC_SHARED=$(CC_)
-
-# No additional flags are needed for Windows compilation.
-CCWINFLAGS=
-
-# Compiler for auxiliary programs
-
-CCAUX=$(COMPAUX) -I$(INCDIR) -otexan
-
-# Define the files to be removed by `make clean'.
-# nmake expands macros when encountered, not when used,
-# so this must precede the !include statements.
-
-BEGINFILES2=gsdll32.rex gswin32.rex gswin32c.rex
-
-# Define the switches for the compilers.
-
-C_=
-O_=-fo=
-RO_=$(O_)
-
-# Include the generic makefiles.
-
-!include $(GLSRCDIR)\version.mak
-# psromfs.mak must precede lib.mak
-!include $(PSSRCDIR)\psromfs.mak
-!include $(GLSRCDIR)\winlib.mak
-!include $(PSSRCDIR)\winint.mak
-
-# -------------------------- Auxiliary programs --------------------------- #
-
-$(GLGENDIR)\ccf32.tr: $(TOP_MAKEFILES)
-	echo $(GENOPT) -I$(INCDIR) -DCHECK_INTERRUPTS -D_Windows -D__WIN32__ -D_WATCOM_ > $(GLGENDIR)\ccf32.tr
-
-$(ECHOGS_XE): $(GLSRC)echogs.c
-	$(CCAUX) $(GLSRC)echogs.c $(O_)$(GLOBJ)echogs.obj 
-	$(LINK) FILE $(GLOBJ)echogs.obj NAME $(ECHOGS_XE)
-
-# Don't create genarch if it's not needed
-!ifdef GENARCH_XE
-$(GENARCH_XE): $(GLSRC)genarch.c $(GENARCH_DEPS) $(GLGENDIR)\ccf32.tr
-	$(CCAUX) $(GLSRC)genarch.c @$(GLGENDIR)\ccf32.tr $(O_)$(GLOBJ)genarch.obj 
-	$(LINK) FILE $(GLOBJ)genarch.obj NAME $(GENARCH_XE)
-!endif
-
-$(GENCONF_XE): $(GLSRC)genconf.c $(GENCONF_DEPS)
-	$(CCAUX) $(GLSRC)genconf.c $(O_)$(GLOBJ)genconf.obj 
-	$(LINK) FILE $(GLOBJ)genconf.obj NAME $(GENCONF_XE)
-
-$(GENDEV_XE): $(GLSRC)gendev.c $(GENDEV_DEPS)
-	$(CCAUX) $(GLSRC)gendev.c $(O_)$(GLOBJ)gendev.obj 
-	$(LINK) FILE $(GLOBJ)gendev.obj NAME $(GENDEV_XE)
-
-$(GENHT_XE): $(GLSRC)genht.c $(GENHT_DEPS)
-	$(CCAUX) $(GENHT_CFLAGS) $(GLSRC)genht.c $(O_)$(GLOBJ)genht.obj 
-	$(LINK) FILE $(GLOBJ)genht.obj NAME $(GENHT_XE)
-
-# -------------------------------- Library -------------------------------- #
-
-# make sure the target directories exist - use special Watcom .BEFORE
-# (This is not the best way to do this, but we will have to wait until
-# the makefiles get disentangled to do it better.)
-.BEFORE
-	@if not exist $(GLGENDIR) mkdir $(GLGENDIR)
-	@if not exist $(GLOBJDIR) mkdir $(GLOBJDIR)
-	@if not exist $(PSGENDIR) mkdir $(PSGENDIR)
-	@if not exist $(PSOBJDIR) mkdir $(PSOBJDIR)
-	@if not exist $(BINDIR) mkdir $(BINDIR)
-
-# See winlib.mak
-
-# ---------------------------- Watcom objects ----------------------------- #
-
-$(GLOBJ)gp_mktmp.$(OBJ): $(GLSRC)gp_mktmp.c $(stat__h) $(string__h)
-	$(GLCC) $(GLO_)gp_mktmp.$(OBJ) $(C_) $(GLSRC)gp_mktmp.c
-
-# ----------------------------- Main program ------------------------------ #
-
-#LIBCTR=libc32.tr
-LIBCTR=
-
-GSCONSOLE_XE=$(BINDIR)\$(GSCONSOLE).exe
-GSDLL_DLL=$(BINDIR)\$(GSDLL).dll
-
-DWOBJLINK=$(PSOBJ)dwdll.obj, $(GLOBJ)dwimg.obj, $(PSOBJ)dwmain.obj, $(GLOBJ)dwtext.obj, $(PSOBJ)gscdefw.obj, $(PSOBJ)gp_wgetw.obj
-DWOBJNOLINK= $(PSOBJ)dwnodll.obj, $(GLOBJ)dwimg.obj, $(PSOBJ)dwmain.obj, $(GLOBJ)dwtext.obj
-OBJCLINK=$(PSOBJ)dwmainc.obj, $(PSOBJ)dwdllc.obj, $(PSOBJ)gscdefw.obj, $(PSOBJ)gp_wgetw.obj
-OBJCNOLINK=$(PSOBJ)dwmainc.obj, $(PSOBJ)dwnodllc.obj
-
-!ifneq MAKEDLL 0
-
-# The non DLL compiles of the some modules also in the DLL
-$(GLOBJ)gp_wgetw.$(OBJ): $(GLSRC)gp_wgetv.c $(AK) $(gscdefs_h)
-	$(CC) $(COMPILE_FOR_CONSOLE_EXE) $(GLCCFLAGS) $(CCWINFLAGS) $(I_)$(GLI_)$(_I) $(GLF_) $(GLO_)gp_wgetw.$(OBJ) $(C_) $(GLSRC)gp_wgetv.c
-
-$(GLOBJ)gscdefw.$(OBJ): $(GLGEN)gscdefs.c $(AK) $(gscdefs_h)
-	$(CC) $(COMPILE_FOR_CONSOLE_EXE) $(GLCCFLAGS) $(CCWINFLAGS) $(I_)$(GLI_)$(_I) $(GLF_) $(GLO_)gscdefw.$(OBJ) $(C_) $(GLGEN)gscdefs.c
-
-# The graphical small EXE loader
-$(GS_XE): $(GSDLL_DLL) $(PSOBJ)$(GSDLL).lib $(DWOBJ) $(GSCONSOLE_XE) $(PSOBJ)$(GS).res \
-		$(GLOBJ)gp_wgetw.obj $(GLOBJ)gscdefw.obj
-	$(LINK) system nt_win $(LCT) Name $(GS_XE) File $(DWOBJLINK) Library $(PSOBJ)$(GSDLL).lib
-
-# The console mode small EXE loader
-$(GSCONSOLE_XE): $(OBJC) $(PSOBJ)$(GS).res $(PSSRCDIR)\dw32c.def \
-		$(GLOBJ)gp_wgetw.obj $(GLOBJ)gscdefw.obj
-	$(LINK) system nt option map $(LCT) Name $(GSCONSOLE_XE) File $(OBJCLINK) Library $(PSOBJ)$(GSDLL).lib
-
-# The big DLL
-$(GSDLL_DLL): $(GS_ALL) $(DEVS_ALL) $(PSOBJ)gsdll.$(OBJ) $(GLOBJ)gp_mktmp.obj $(PSOBJ)$(GSDLL).res $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ)
-	$(LINK) system nt_dll initinstance terminstance $(LCT) Name $(GSDLL_DLL) File $(GLOBJ)gsdll.obj $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ) $(GLOBJ)gp_mktmp.obj @$(ld_tr) @$(PSSRC)gsdll32w.lnk
-
-$(PSOBJ)$(GSDLL).lib: $(GSDLL_DLL)
-	erase $(PSOBJ)$(GSDLL).lib
-	wlib $(PSOBJ)$(GSDLL) +$(GSDLL_DLL)
-
-!else
-# The big graphical EXE
-$(GS_XE): $(GSCONSOLE_XE) $(GS_ALL) $(DEVS_ALL) $(PSOBJ)gsdll.$(OBJ) $(GLOBJ)gp_mktmp.obj $(DWOBJNO) $(PSOBJ)$(GS).res $(PSOBJ)dwmain32.def $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ)
-	$(LINK) option map $(LCT) Name $(GS) File $(GLOBJ)gsdll,$(OBJ) $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ) gp_mktmp.obj $(DWOBJNOLINK) @$(ld_tr) 
-
-# The big console mode EXE
-$(GSCONSOLE_XE):  $(GS_ALL) $(DEVS_ALL) $(PSOBJ)gsdll.$(OBJ) $(GLOBJ)gp_mktmp.obj $(OBJCNO) $(PSOBJ)$(GS).res $(PSSRCDIR)\dw32c.def $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ)
-	$(LINK) option map $(LCT) Name $(GSCONSOLE_XE) File $(GLOBJ)gsdll,$(OBJ) $(PSOBJ)gsromfs$(COMPILE_INITS).$(OBJ) $(GLOBJ)gp_mktmp.obj $(OBJCNOLINK) @$(ld_tr) 
-!endif
-
-# end of makefile

Deleted: branches/chrisl-test-gs/base/wccommon.mak
===================================================================
--- branches/chrisl-test-gs/base/wccommon.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/wccommon.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1,210 +0,0 @@
-#  Copyright (C) 2001-2006 Artifex Software, Inc.
-#  All Rights Reserved.
-#
-#  This software is provided AS-IS with no warranty, either express or
-#  implied.
-#
-#  This software is distributed under license and may not be copied, modified
-#  or distributed except as expressly authorized under the terms of that
-#  license.  Refer to licensing information at http://www.artifex.com/
-#  or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
-#  San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
-#
-# $Id$
-# wccommon.mak
-# Section of Watcom C/C++ makefile common to MS-DOS and MS Windows.
-# We strongly recommend that you read the Watcom section of Make.htm
-# before attempting to build Ghostscript with the Watcom compiler.
-
-# This file is used by watc.mak, watcwin.mak, and watclib.mak.
-# Those files supply the following parameters:
-#   Configuration, public:
-#	GS_LIB_DEFAULT, SEARCH_HERE_FIRST, GS_INIT, FEATURE_DEVS,
-#	DEVICE_DEVS*, COMPILE_INITS, BAND_LIST_*
-#   Configuration, internal, generic:
-#	PLATFORM, MAKEFILE, AK, CC*, DEBUG, CP_, RM_, RMN_
-#   Configuration, internal, specific to DOS/Windows:
-#	TDEBUG, COMPDIR, LIBPATHS,
-#	CPU_TYPE,
-
-# We want Unix-compatible behavior.  This is part of it.
-
-.NOCHECK
-
-# Define additional extensions to keep `make' happy
-
-.EXTENSIONS: .be .z
-
-# Define the auxiliary program dependency. We don't use this.
-
-AK=
-
-# Note that built-in third-party libraries aren't available.
-
-SHARE_JPEG=0
-SHARE_LIBPNG=0
-SHARE_ZLIB=0
-SHARE_JBIG2=0
-SHARE_JPX=0
-
-# Define the extensions for command, object, and executable files.
-
-NULL=
-
-C_=
-CMD=.bat
-D_=-D
-_D_=$(NULL)=
-_D=
-I_=-i=
-II=-i=
-_I=
-NO_OP=%null
-O_=-fo=
-OBJ=obj
-Q=
-RO_=$(O_)
-XE=.exe
-XEAUX=.exe
-
-# Define the executable and shell invocations.
-
-D=\\
-
-EXP=
-SH=
-
-# Define generic commands.
-
-CP_=call $(GLSRCDIR)\cp.bat
-RM_=call $(GLSRCDIR)\rm.bat
-RMN_=call $(GLSRCDIR)\rm.bat
-
-# Define the arguments for genconf.
-
-# wmake interprets & as calling for background execution, and ^ fails on
-# Windows NT.
-CONFILES=-e ~ -p FILE~s~ps
-CONFLDTR=-ol
-
-# Define the names of the Watcom C files.
-# See the comments in watc.mak and watcwin.mak regarding WCVERSION.
-
-!ifeq WCVERSION 11.0
-# 11.0 is currently the same as 10.5.
-COMP=$(%WATCOM)\binw\wcc386
-LINK=$(%WATCOM)\binw\wlink
-STUB=$(%WATCOM)\binw\wstub.exe
-WRC=$(%WATCOM)\binw\wrc.exe
-!endif
-
-!ifeq WCVERSION 10.5
-COMP=$(%WATCOM)\binw\wcc386
-LINK=$(%WATCOM)\binw\wlink
-STUB=$(%WATCOM)\binw\wstub.exe
-WRC=$(%WATCOM)\binw\wrc.exe
-!endif
-
-!ifeq WCVERSION 10.0
-COMP=$(%WATCOM)\binb\wcc386
-LINK=$(%WATCOM)\bin\wlink
-STUB=$(%WATCOM)\binb\wstub.exe
-WRC=$(%WATCOM)\binb\wrc.exe
-!endif
-
-!ifeq WCVERSION 9.5
-COMP=$(%WATCOM)\bin\wcc386
-LINK=$(%WATCOM)\bin\wlinkp
-STUB=$(%WATCOM)\binb\wstub.exe
-WRC=$(%WATCOM)\binb\wrc.exe
-!endif
-
-# 95/NT Watcom compiler versions
-# 10.695 is 10.6 under Windows 95 or NT (32 bit hosted tools)
-!ifeq WCVERSION 10.695
-COMP=$(%WATCOM)\binnt\wcc386
-LINK=$(%WATCOM)\binnt\wlink
-STUB=$(%WATCOM)\binw\wstub.exe
-WRC=$(%WATCOM)\binnt\wrc.exe
-WAT32=1
-!endif
-
-# Defaults
-!ifndef COMP
-COMP=$(%WATCOM)\bin\wcc386p
-LINK=$(%WATCOM)\bin\wlinkp
-STUB=$(%WATCOM)\binb\wstub.exe
-WRC=$(%WATCOM)\binb\rc.exe
-!endif
-!ifndef WAT32
-WAT32=0
-!endif
-
-!ifeq WAT32 0
-INCDIRS=$(%WATCOM)\h
-!else
-INCDIRS=$(%WATCOM)\h;$(%WATCOM)\h\nt
-!endif
-WBIND=$(%WATCOM)\binb\wbind.exe
-
-# Define the generic compilation flags.
-
-!ifeq CPU_TYPE 586
-!ifeq FPU_TYPE 0
-FPU_TYPE=387
-!endif
-!else
-!ifeq CPU_TYPE 486
-!ifeq FPU_TYPE 0
-FPU_TYPE=387
-!endif
-!endif
-!endif
-
-!ifeq FPU_TYPE 387
-FPFLAGS=-fpi87
-!else
-!ifeq FPU_TYPE 287
-FPFLAGS=-fpi287
-!else
-!ifeq FPU_TYPE -1
-FPFLAGS=-fpc
-!else
-FPFLAGS=-fpi
-!endif
-!endif
-!endif
-
-# Make sure we get the right default target for make.
-
-dosdefault: default
-	$(NO_OP)
-
-# Define the compilation flags.
-
-# Run-time debugging and stack checking
-!ifneq DEBUG 0
-CD=-dDEBUG
-CS=
-!else
-CD=
-CS=-oeilnt -s
-!endif
-
-# Debugger symbols
-!ifneq TDEBUG 0
-CT=-d2
-LCT=DEBUG ALL
-!else
-CT=-d1
-LCT=DEBUG LINES
-!endif
-
-GENOPT=$(CD) $(CT) $(CS)
-
-CCOPT=-d+ -i=$(INCDIRS) -zq -zp8 -ei
-CCFLAGS=$(CCOPT) $(GENOPT) $(PLATOPT) $(FPFLAGS) $(CFLAGS) $(XCFLAGS)
-CC=$(COMP) -oi $(CCFLAGS)
-CCAUX=$(COMP) -oi $(CCOPT) $(FPFLAGS)
-CC_=$(CC)
-CC_NO_WARN=$(CC_)

Deleted: branches/chrisl-test-gs/base/wctail.mak
===================================================================
--- branches/chrisl-test-gs/base/wctail.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/wctail.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1,75 +0,0 @@
-#  Copyright (C) 2001-2006 Artifex Software, Inc.
-#  All Rights Reserved.
-#
-#  This software is provided AS-IS with no warranty, either express or
-#  implied.
-#
-#  This software is distributed under license and may not be copied, modified
-#  or distributed except as expressly authorized under the terms of that
-#  license.  Refer to licensing information at http://www.artifex.com/
-#  or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
-#  San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
-#
-# $Id$
-# wctail.mak
-# Last part of Watcom C/C++ makefile common to MS-DOS and MS Windows.
-
-# Define the name of this makefile.
-WCTAIL_MAK=$(GLSRCDIR)\wctail.mak
-
-# Include the generic makefiles, except for devs.mak, contrib.mak, int.mak
-#!include $(COMMONDIR)/watcdefs.mak
-#!include $(COMMONDIR)/pcdefs.mak
-#!include $(COMMONDIR)/generic.mak
-!include $(GLSRCDIR)\version.mak
-!include $(GLSRCDIR)\gs.mak
-!include $(GLSRCDIR)\lib.mak
-!include $(GLSRCDIR)\jpeg.mak
-# zlib.mak must precede libpng.mak
-!include $(GLSRCDIR)\zlib.mak
-!include $(GLSRCDIR)\libpng.mak
-!include $(GLSRCDIR)\jbig2.mak
-!include $(GLSRCDIR)\icclib.mak
-!include $(GLSRCDIR)\ijs.mak
-
-# -------------------------- Auxiliary programs --------------------------- #
-
-temp_tr=$(GLOBJ)_temp_.tr
-
-$(ECHOGS_XE): $(AUXGEN)echogs.$(OBJ)
-	echo OPTION STUB=$(STUB) >$(temp_tr)
-	echo $(LIBPATHS) >>$(temp_tr)
-	$(LINK) @$(temp_tr) FILE $(AUXGEN)echogs
-
-$(AUXGEN)echogs.$(OBJ): $(GLSRC)echogs.c
-	$(CCAUX) $(GLSRC)echogs.c $(O_)$(AUXGEN)echogs.$(OBJ)
-
-$(GENARCH_XE): $(AUXGEN)genarch.$(OBJ)
-	echo $(LIBPATHS) >$(temp_tr)
-	$(LINK) @$(temp_tr) FILE $(AUXGEN)genarch
-
-$(AUXGEN)genarch.$(OBJ): $(GLSRC)genarch.c $(stdpre_h)
-	$(CCAUX) $(GLSRC)genarch.c $(O_)$(AUXGEN)genarch.$(OBJ)
-
-$(GENCONF_XE): $(AUXGEN)genconf.$(OBJ)
-	echo OPTION STUB=$(STUB) >$(temp_tr)
-	echo OPTION STACK=8k >>$(temp_tr)
-	echo $(LIBPATHS) >>$(temp_tr)
-	$(LINK) @$(temp_tr) FILE $(AUXGEN)genconf
-
-$(AUXGEN)genconf.$(OBJ): $(GLSRC)genconf.c $(stdpre_h)
-	$(CCAUX) $(GLSRC)genconf.c $(O_)$(AUXGEN)genconf.$(OBJ)
-
-$(GENDEV_XE): $(AUXGEN)gendev.$(OBJ)
-	echo OPTION STUB=$(STUB) >$(temp_tr)
-	echo OPTION STACK=8k >>$(temp_tr)
-	echo $(LIBPATHS) >>$(temp_tr)
-	$(LINK) @$(temp_tr) FILE $(AUXGEN)gendev
-
-$(AUXGEN)gendev.$(OBJ): $(GLSRC)gendev.c $(stdpre_h)
-	$(CCAUX) $(GLSRC)gendev.c $(O_)$(AUXGEN)gendev.$(OBJ)
-
-# No special gconfig_.h is needed.
-# Watcom `make' supports output redirection.
-$(gconfig__h): $(WCTAIL_MAK)
-	echo /* This file deliberately left blank. */ >$(gconfig__h)

Copied: branches/chrisl-test-gs/base/whitelst.c (from rev 11832, trunk/gs/base/whitelst.c)
===================================================================
--- branches/chrisl-test-gs/base/whitelst.c	                        (rev 0)
+++ branches/chrisl-test-gs/base/whitelst.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -0,0 +1,547 @@
+/* Copyright (C) 2001-2006 Artifex Software, Inc.
+   All Rights Reserved.
+  
+   This software is provided AS-IS with no warranty, either express or
+   implied.
+
+   This software is distributed under license and may not be copied, modified
+   or distributed except as expressly authorized under the terms of that
+   license.  Refer to licensing information at http://www.artifex.com/
+   or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
+   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
+*/
+
+/* $Id: whitelst.c 11608 2010-08-06 11:11:40Z ken $ */
+/* The following font names are taken from the Adobe webs site
+   (http://www.adobe.com/type/browser/legal/embeddingeula.html)
+   and comprise a list of font names for which permission is granted to embed
+   either for preview and print or fully editable. These names are used to 
+   override the embedding flags in TrueType fonts for pdfwrite and ps2write.
+   
+   Its not entirely clear whether the font names should include TM and R
+   characters or not, and the only example font we have contains neither. For
+   the moment the fonts are stored without TM and R characters but this may
+   need to be altered.
+ */
+#include "whitelst.h"
+
+#define WHITE_LIST_SIZE 463
+
+static const char EmbeddingWhiteList[][WHITE_LIST_SIZE] = {
+"Aachen",
+"Adobe Arabic",
+"Adobe Caslon",
+"Adobe Garamond",
+"Adobe Hebrew",
+"Adobe Jenson",
+"Adobe Pi",
+"Adobe Thai",
+"Adobe Wood Type",
+"Albertus",
+"Aldus",
+"Alexa",
+"Americana",
+"Amigo",
+"Andreas",
+"Antique Olive",
+"Apollo",
+"Arcadia",
+"Arcana",
+"Ariadne",
+"Arno",
+"Arnold Böcklin",
+"Ashley Script",
+"Astrology Pi",
+"Audio Pi",
+"Auriol",
+"Avenir",
+"Baker",
+"Balzano",
+"Banco",
+"Banshee",
+"Baskerville Cyrillic",
+"Bauer Bodoni",
+"Bell",
+"Bell Centennial",
+"Bell Gothic",
+"Belwe",
+"Bembo",
+"Berling",
+"Bermuda",
+"Bernhard",
+"Bernhard Modern",
+"Bickham Script",
+"Biffo",
+"Birch",
+"Blackoak",
+"Blue Island",
+"Bodoni",
+"Border Pi",
+"Briem Akademi",
+"Briem Script",
+"Brioso",
+"Bruno",
+"Brush Script",
+"Bulmer",
+"Bundesbahn Pi",
+"Caflisch Script",
+"Caflisch Script Web",
+"Calcite",
+"Caliban",
+"Calvert",
+"Candida",
+"Cantoria",
+"Caravan Borders",
+"Carolina",
+"Carta",
+"Cascade Script",
+"Caslon 3",
+"Caslon 540",
+"Caslon Open Face",
+"Castellar",
+"Caxton",
+"Centaur",
+"Century Expanded",
+"Century Old Style",
+"Chaparral",
+"Charlemagne",
+"Charme",
+"Cheq",
+"Clairvaux",
+"Clarendon",
+"Clearface Gothic",
+"Cloister",
+"Club Type Mercurius",
+"Cochin",
+"Conga Brava",
+"Conga Brava Std Stencil",
+"Cooper Black",
+"Copal",
+"Copperplate Gothic",
+"Coriander",
+"Corona",
+"Coronet",
+"Cottonwood",
+"Courier",
+"Critter",
+"Cronos",
+"Cutout",
+"Dante",
+"Decoration Pi",
+"Delphin",
+"DIN Schriften",
+"Diotima",
+"Diskus",
+"Dom Casual",
+"Dorchester Script",
+"Doric",
+"Duc de Berry",
+"Eccentric",
+"Egyptienne F",
+"Ehrhardt",
+"Electra",
+"Ellington",
+"Else NPL",
+"Engravers",
+"European Pi",
+"Eurostile",
+"Ex Ponto",
+"Excelsior",
+"Excelsior Cyrillic",
+"Fairfield",
+"Falstaff",
+"Fette Fraktur",
+"Flood",
+"Florens",
+"Flyer",
+"Folio",
+"Forte",
+"Fournier",
+"Franklin Gothic",
+"Freestyle Script",
+"Friz Quadrata",
+"Frutiger",
+"Fusaka",
+"Futura",
+"Galahad",
+"Game Pi",
+"Garamond 3",
+"Garamond Premier",
+"Garth Graphic",
+"Gazette",
+"Giddyup",
+"Giddyup Web",
+"Gill Floriated Capitals",
+"Gill Sans",
+"Glypha",
+"Gothic 13",
+"Goudy",
+"Goudy Text",
+"Granjon",
+"Graphite",
+"Guardi",
+"Hadriano",
+"Hardwood",
+"Heisei Kaku Gothic",
+"Heisei Maru Gothic",
+"Heisei Mincho",
+"Helvetica",
+"Helvetica Cyrillic",
+"Helvetica Inserat",
+"Helvetica Inserat Cyrillic",
+"Helvetica Neue",
+"Helvetica Rounded",
+"Herculanum",
+"Hiroshige",
+"Hobo",
+"Holiday Pi",
+"Horley Old Style",
+"HY Gothic",
+"HY GungSo",
+"HY Kak Headline Std",
+"HY Rounded Gothic",
+"Hypatia",
+"Immi 505",
+"Impact",
+"Impressum",
+"Industria",
+"Inflex",
+"Insignia",
+"Ironwood",
+"Isabella",
+"Italia",
+"ITC American Typewriter",
+"ITC Anna",
+"ITC Avant Garde Gothic",
+"ITC Bauhaus",
+"ITC Beesknees",
+"ITC Benguiat",
+"ITC Benguiat Gothic",
+"ITC Berkeley Oldstyle",
+"ITC Bookman",
+"ITC Caslon 224",
+"ITC Century",
+"ITC Century Handtooled",
+"ITC Cerigo",
+"ITC Cheltenham",
+"ITC Cheltenham Handtooled",
+"ITC Clearface",
+"ITC Cushing",
+"ITC Eras",
+"ITC Esprit",
+"ITC Fenice",
+"ITC Flora",
+"ITC Franklin Gothic",
+"ITC Galliard",
+"ITC Garamond",
+"ITC Garamond Handtooled",
+"ITC Giovanni",
+"ITC Goudy Sans",
+"ITC Highlander",
+"ITC Isadora",
+"ITC Kabel",
+"ITC Korinna",
+"ITC Leawood",
+"ITC Legacy Sans",
+"ITC Legacy Serif",
+"ITC Lubalin Graph",
+"ITC Machine",
+"ITC Mendoza Roman",
+"ITC Mona Lisa",
+"ITC Motter Corpus",
+"ITC New Baskerville",
+"ITC Novarese",
+"ITC Officina Sans",
+"ITC Officina Serif",
+"ITC Ozwald",
+"ITC Quorum",
+"ITC Serif Gothic",
+"ITC Slimbach",
+"ITC Souvenir",
+"ITC Stone Informal",
+"ITC Stone Sans",
+"ITC Stone Serif",
+"ITC Symbol",
+"ITC Tiepolo",
+"ITC Tiffany",
+"ITC Usherwood",
+"ITC Veljovic",
+"ITC Weidemann",
+"ITC Zapf Chancery",
+"ITC Zapf Dingbats",
+"Janson Text",
+"Jimbo",
+"Joanna",
+"Juniper",
+"Kabel",
+"Kaufmann",
+"Kepler",
+"Khaki",
+"Kigali",
+"Kinesis",
+"Kino",
+"Klang",
+"Koch Antiqua",
+"Kolo",
+"Kompakt",
+"Kozuka Gothic",
+"Kozuka Mincho",
+"Künstler Script",
+"Latin",
+"Legault",
+"Letter Gothic",
+"Life",
+"LinoLetter",
+"Linoscript",
+"Linotext",
+"Linotype Centennial",
+"Linotype Didot",
+"Lithos",
+"LogoArl",
+"LogoCut",
+"LogoLine",
+"Lucida",
+"Lucida Math",
+"Lucida Sans",
+"Lucida Sans Typewriter",
+"Lucida Typewriter",
+"Madrone",
+"Manito",
+"Marigold",
+"Mathematical Pi",
+"Matura",
+"Maximus",
+"Medici Script",
+"Melior",
+"Memphis",
+"Mercurius",
+"Meridien",
+"Mesquite",
+"Mezz",
+"Mezz Web",
+"MICR",
+"Minion",
+"Minion Cyrillic",
+"Minion Web",
+"Minister",
+"Mistral",
+"Mojo",
+"Monoline Script",
+"Monotype Goudy Modern",
+"Monotype Grotesque",
+"Monotype Italian Old Style",
+"Monotype Modern",
+"Monotype Old Style",
+"Monotype Scotch Roman",
+"Monotype Script",
+"Montara",
+"Moonglow",
+"MVB Bossa Nova",
+"MVB Celestia Antiqua",
+"MVB Emmascript",
+"MVB Greymantle",
+"MVB Magnesium",
+"MVB Magnolia",
+"Myriad",
+"Myriad Web",
+"Mythos",
+"National Codes",
+"National Codes Pi",
+"Neue Hammer Unziale",
+"Neuland",
+"Neuzeit S",
+"New Aster",
+"New Berolina",
+"New Caledonia",
+"New Century Schoolbook",
+"News Gothic",
+"Notre Dame",
+"Nueva",
+"Nuptial Script",
+"Nyx",
+"Ocean Sans",
+"OCR-A",
+"OCR-B",
+"Octavian",
+"Old Claude",
+"Old Style 7",
+"Olympian",
+"Omnia",
+"Ondine",
+"Onyx",
+"Optima",
+"Orator",
+"Orgánica GMM",
+"Origami",
+"Ouch!",
+"Oxford",
+"Palace Script",
+"Palatino",
+"Parisian",
+"Park Avenue",
+"Peignot",
+"Pelican",
+"Penumbra",
+"Penumbra Flare",
+"Penumbra Half Serif",
+"Penumbra Sans",
+"Penumbra Serif",
+"Penumbra Web",
+"Pepita",
+"Pepperwood",
+"Perpetua",
+"Photina",
+"Plantin",
+"PMN Caecilia",
+"Poetica",
+"Pompeia",
+"Pompeijana",
+"Ponderosa",
+"Poplar",
+"Postino",
+"Present",
+"Prestige Elite",
+"Quake",
+"Rad",
+"Raleigh",
+"Raphael",
+"Reliq",
+"Reporter",
+"Revue",
+"Rockwell",
+"Romic",
+"Rosewood",
+"Rotation",
+"Rotis Sans Serif",
+"Rotis Semi Sans",
+"Rotis Semi Serif",
+"Rotis Serif",
+"Ruling Script",
+"Runic",
+"Russell Oblique",
+"Russell Square",
+"Rusticana",
+"Ruzicka Freehand",
+"Ryo Display",
+"Ryo Gothic",
+"Ryo Text",
+"Sabon",
+"San Marco",
+"Sanvito",
+"Sassafras",
+"Sava",
+"Serifa",
+"Serlio",
+"Serpentine",
+"Shannon",
+"Shelley",
+"Sho",
+"Shuriken Boy",
+"Silentium",
+"Simoncini Garamond",
+"Smaragd",
+"SMGothic",
+"SMMyungjo",
+"Snell Roundhand",
+"Sonata",
+"Spartan",
+"Spectrum",
+"Spring",
+"Spumoni",
+"Stempel Garamond",
+"Stempel Schneidler",
+"Stencil",
+"Strayhorn",
+"Strumpf",
+"Studz",
+"Symbol",
+"Syntax",
+"Tekton",
+"Tempo",
+"Times",
+"Times Europa",
+"Times New Roman",
+"Times Ten",
+"Times Ten Cyrillic",
+"Toolbox",
+"Trade Gothic",
+"Trajan",
+"Trump Mediäval",
+"Umbra",
+"Univers",
+"Universal",
+"University",
+"Utopia",
+"VAG Rounded",
+"Vectora",
+"Versailles",
+"Verve",
+"Visigoth",
+"Viva",
+"Voluta Script",
+"Warning Pi",
+"Warnock",
+"Waters Titling",
+"Weiss",
+"Wendy",
+"Wiesbaden Swing",
+"Wilhelm Klingspor Gotisch",
+"Wilke",
+"Willow",
+"Wittenberger Fraktur",
+"Zebrawood",
+"Zipty Do"
+};
+
+static int whitelist_strncmp(const char *s1, const char *s2, int length)
+{
+    int s1_index, s2_index, result = 0;
+
+    s1_index = s2_index = 0;
+
+    while (s2_index < length && s1[s1_index] != 0x00) {
+	while (s1[s1_index] == ' ')
+	    s1_index++;
+	while (s2[s2_index] == ' ' && s2_index < length)
+	    s2_index++;
+	if (s2_index > length) {
+	    if (s1[s1_index] == 0x00)
+		return 0;
+	    return 1;
+	}
+	if (s1[s1_index] == 0x00) {
+	    if (s2_index > length)
+		return 0;
+	    return -1;
+	}
+	if (s1[s1_index] == s2[s2_index]) {
+	    s1_index++;
+	    s2_index++;
+	    continue;
+	}
+	if(s1[s1_index] < s2[s2_index])
+	    return -1;
+	if(s1[s1_index] > s2[s2_index])
+	    return 1;
+    }
+    return result;
+}
+
+int IsInWhiteList (const char *Name, int size)
+{
+    int low = 0, mid, high = WHITE_LIST_SIZE, test;
+
+    while (low < high) {
+	/* bisect current range */
+	mid = (low + high) / 2;
+	test = whitelist_strncmp(EmbeddingWhiteList[mid], Name, size);
+	if (test == 0)
+	    return 1;
+	/* Not a match, select either upper or lower group and try again */
+	if(test < 0)
+	    low = mid + 1;
+	else
+	high = mid - 1;
+    }
+    return 0;
+}

Copied: branches/chrisl-test-gs/base/whitelst.h (from rev 11832, trunk/gs/base/whitelst.h)
===================================================================
--- branches/chrisl-test-gs/base/whitelst.h	                        (rev 0)
+++ branches/chrisl-test-gs/base/whitelst.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -0,0 +1,22 @@
+/* Copyright (C) 2001-2006 Artifex Software, Inc.
+   All Rights Reserved.
+  
+   This software is provided AS-IS with no warranty, either express or
+   implied.
+
+   This software is distributed under license and may not be copied, modified
+   or distributed except as expressly authorized under the terms of that
+   license.  Refer to licensing information at http://www.artifex.com/
+   or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
+   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
+*/
+
+/* $Id: whitelst.h 11099 2010-04-21 19:51:07Z robin $ */
+/* Declare routine for testing white listing of font names */
+
+#ifndef whitelst_INCLUDED
+#  define whitelst_INCLUDED
+
+int IsInWhiteList (const char *Name, int size);
+
+#endif /* whitelst_INCLUDED */

Modified: branches/chrisl-test-gs/base/winlib.mak
===================================================================
--- branches/chrisl-test-gs/base/winlib.mak	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/base/winlib.mak	2010-10-21 09:19:31 UTC (rev 11833)
@@ -102,10 +102,10 @@
 !include $(GLSRCDIR)\lib.mak
 !include $(GLSRCDIR)\freetype.mak
 !include $(GLSRCDIR)\jpeg.mak
-# zlib.mak must precede libpng.mak
+# zlib.mak must precede png.mak
 !include $(GLSRCDIR)\zlib.mak
-!include $(GLSRCDIR)\libpng.mak
-!include $(GLSRCDIR)\libtiff.mak
+!include $(GLSRCDIR)\png.mak
+!include $(GLSRCDIR)\tiff.mak
 !include $(GLSRCDIR)\jbig2.mak
 !include $(GLSRCDIR)\jasper.mak
 !include $(GLSRCDIR)\ldf_jb2.mak

Modified: branches/chrisl-test-gs/contrib/gdevbjc_.h
===================================================================
--- branches/chrisl-test-gs/contrib/gdevbjc_.h	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/contrib/gdevbjc_.h	2010-10-21 09:19:31 UTC (rev 11833)
@@ -140,7 +140,7 @@
     {  (int) 255,           /* White  paper  */        \
        (int) 255,           /*               */        \
        (int) 255 }          /*               */        \
-};
+}
 
 
 #define bjc_device(procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page, def_ink)\

Modified: branches/chrisl-test-gs/cups/gdevcups.c
===================================================================
--- branches/chrisl-test-gs/cups/gdevcups.c	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/cups/gdevcups.c	2010-10-21 09:19:31 UTC (rev 11833)
@@ -304,7 +304,9 @@
    NULL,				/* ret_devn_params */
    NULL,				/* fillpage */
    NULL,				/* push_transparency_state */
-   NULL					/* pop_transparency_state */
+   NULL,				/* pop_transparency_state */
+   NULL,                                /* put_image */
+
 };
 
 #define prn_device_body_copies(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_pages)\
@@ -442,8 +444,12 @@
 private int
 cups_close(gx_device *pdev)		/* I - Device info */
 {
+#ifdef DEBUG
   dprintf1("DEBUG2: cups_close(%p)\n", pdev);
+#endif /* DEBUG */
 
+  dprintf("INFO: Rendering completed\n");
+
   if (cups->stream != NULL)
   {
     cupsRasterClose(cups->stream);
@@ -738,7 +744,9 @@
 cups_get_matrix(gx_device *pdev,	/* I - Device info */
                 gs_matrix *pmat)	/* O - Physical transform matrix */
 {
+#ifdef DEBUG
   dprintf2("DEBUG2: cups_get_matrix(%p, %p)\n", pdev, pmat);
+#endif /* DEBUG */
 
  /*
   * Set the raster width and height...
@@ -756,7 +764,9 @@
    /*
     * Do landscape orientation...
     */
+#ifdef DEBUG
     dprintf("DEBUG2: Landscape matrix: XX=0 XY=+1 YX=+1 YY=0\n");
+#endif /* DEBUG */
     pmat->xx = 0.0;
     pmat->xy = (float)cups->header.HWResolution[1] / 72.0;
     pmat->yx = (float)cups->header.HWResolution[0] / 72.0;
@@ -769,7 +779,9 @@
    /*
     * Do portrait orientation...
     */
+#ifdef DEBUG
     dprintf("DEBUG2: Portrait matrix: XX=+1 XY=0 YX=0 YY=-1\n");
+#endif /* DEBUG */
     pmat->xx = (float)cups->header.HWResolution[0] / 72.0;
     pmat->xy = 0.0;
     pmat->yx = 0.0;
@@ -791,6 +803,7 @@
   }
 #endif /* CUPS_RASTER_SYNCv1 */
 
+#ifdef DEBUG
   dprintf2("DEBUG2: width = %d, height = %d\n", cups->header.cupsWidth,
 	   cups->header.cupsHeight);
   dprintf4("DEBUG2: PageSize = [ %d %d ], HWResolution = [ %d %d ]\n",
@@ -801,6 +814,7 @@
 	   pdev->HWMargins[3]);
   dprintf6("DEBUG2: matrix = [ %.3f %.3f %.3f %.3f %.3f %.3f ]\n",
 	   pmat->xx, pmat->xy, pmat->yx, pmat->yy, pmat->tx, pmat->ty);
+#endif /* DEBUG */
 }
 
 
@@ -821,18 +835,24 @@
   bool			b;		/* Temporary boolean value */
 
 
+#ifdef DEBUG
   dprintf2("DEBUG2: cups_get_params(%p, %p)\n", pdev, plist);
+#endif /* DEBUG */
 
  /*
   * First process the "standard" page device parameters...
   */
 
+#ifdef DEBUG
   dprintf("DEBUG2: before gdev_prn_get_params()\n");
+#endif /* DEBUG */
 
   if ((code = gdev_prn_get_params(pdev, plist)) < 0)
     return (code);
 
+#ifdef DEBUG
   dprintf("DEBUG2: after gdev_prn_get_params()\n");
+#endif /* DEBUG */
 
  /*
   * Then write the CUPS parameters...
@@ -1020,7 +1040,9 @@
     return (code);
 #endif /* CUPS_RASTER_SYNCv1 */
 
+#ifdef DEBUG
   dprintf("DEBUG2: Leaving cups_get_params()\n");
+#endif /* DEBUG */
 
   return (0);
 }
@@ -1041,7 +1063,9 @@
 	cache_units[255];		/* Cache size units */
 
 
+#ifdef DEBUG
   dprintf2("DEBUG2: cups_get_space_params(%p, %p)\n", pdev, space_params);
+#endif /* DEBUG */
 
   if ((cache_env = getenv("RIP_MAX_CACHE")) != NULL)
   {
@@ -1070,7 +1094,9 @@
   if (cache_size == 0)
     return;
 
+#ifdef DEBUG
   dprintf1("DEBUG2: cache_size = %.0f\n", cache_size);
+#endif /* DEBUG */
 
   space_params->MaxBitmap   = (long)cache_size;
   space_params->BufferSpace = (long)cache_size;
@@ -2081,7 +2107,9 @@
 #  endif /* CUPS_RASTER_HAVE_COLORIMETRIC */
   }
 
+#ifdef DEBUG
   dprintf3("DEBUG2: RGB values: %d,%d,%d\n", prgb[0], prgb[1], prgb[2]);
+#endif /* DEBUG */
 
   return (0);
 }
@@ -2649,9 +2677,11 @@
 {
   int	code;				/* Return status */
 
-
+#ifdef DEBUG
   dprintf1("DEBUG2: cups_open(%p)\n", pdev);
+#endif /* DEBUG */
 
+  dprintf("INFO: Start rendering...\n");
   cups->printer_procs.get_space_params = cups_get_space_params;
 
   if (cups->page == 0)
@@ -2693,8 +2723,10 @@
 
   (void)fp; /* reference unused file pointer to prevent compiler warning */
 
+#ifdef DEBUG
   dprintf3("DEBUG2: cups_print_pages(%p, %p, %d)\n", pdev, fp,
           num_copies);
+#endif /* DEBUG */
 
  /*
   * Figure out the number of bytes per line...
@@ -2730,9 +2762,11 @@
 
   srcbytes = gdev_prn_raster(pdev);
 
+#ifdef DEBUG
   dprintf4("DEBUG2: cupsBitsPerPixel = %d, cupsWidth = %d, cupsBytesPerLine = %d, srcbytes = %d\n",
 	   cups->header.cupsBitsPerPixel, cups->header.cupsWidth,
 	   cups->header.cupsBytesPerLine, srcbytes);
+#endif /* DEBUG */
 
   src = (unsigned char *)gs_malloc(pdev->memory->non_gc_memory, srcbytes, 1, "cups_print_pages");
 
@@ -2761,7 +2795,9 @@
   {
     RasterVersion = ppdFindAttr(cups->PPD, "cupsRasterVersion", NULL); 
     if (RasterVersion) {
+#ifdef DEBUG
       dprintf1("DEBUG2: cupsRasterVersion = %s\n", RasterVersion->value);
+#endif /* DEBUG */
       cups->cupsRasterVersion = atoi(RasterVersion->value);
       if ((cups->cupsRasterVersion != 2) &&
 	  (cups->cupsRasterVersion != 3)) {
@@ -2793,9 +2829,11 @@
     num_copies = 1;
   }
 
+#ifdef DEBUG
   dprintf3("DEBUG2: cupsWidth = %d, cupsHeight = %d, cupsBytesPerLine = %d\n",
 	   cups->header.cupsWidth, cups->header.cupsHeight,
 	   cups->header.cupsBytesPerLine);
+#endif /* DEBUG */
 
   for (copy = num_copies; copy > 0; copy --)
   {
@@ -2873,7 +2911,9 @@
                         yflip = 0;
   int                   found = 0;
 
+#ifdef DEBUG
   dprintf2("DEBUG2: cups_put_params(%p, %p)\n", pdev, plist);
+#endif /* DEBUG */
 
  /*
   * Process other options for CUPS...
@@ -2889,8 +2929,6 @@
   } \
   else if (code == 0) \
   { \
-    dprintf2("DEBUG: Setting %s to \"%s\"...\n", sname, \
-             (char *)(stringval.data));			     \
     strncpy(cups->header.name, (const char *)(stringval.data),	\
             stringval.size); \
     cups->header.name[stringval.size] = '\0'; \
@@ -2905,7 +2943,6 @@
   } \
   else if (code == 0) \
   { \
-    dprintf2("DEBUG: Setting %s to %d...\n", sname, (int)intval); \
     cups->header.name = (type)intval; \
   }
 
@@ -2918,7 +2955,6 @@
   } \
   else if (code == 0) \
   { \
-    dprintf2("DEBUG: Setting %s to %.4f...\n", sname, (float)floatval);	\
     cups->header.name = (float)floatval; \
   }
 
@@ -2936,7 +2972,6 @@
   } \
   else if (code == 0) \
   { \
-    dprintf2("DEBUG: Setting %s to %d...\n", sname, (int)boolval); \
     cups->header.name = (cups_bool_t)boolval; \
   }
 
@@ -2951,19 +2986,15 @@
     } \
     if (code == 0) \
     { \
-      dprintf1("DEBUG: Setting %s to zero\n", sname); \
       for (i = 0; i < count; i ++) \
 	cups->header.name[i] = 0; \
     } \
   } \
   else if (code == 0) \
   { \
-    dprintf1("DEBUG: Setting %s to", sname); \
     for (i = 0; i < count; i ++) { \
-      dprintf1(" %d", (unsigned)(arrayval.data[i])); \
       cups->header.name[i] = (unsigned)(arrayval.data[i]); \
     } \
-    dprintf("...\n"); \
   }
 
   size_set    = param_read_float_array(plist, ".MediaSize", &arrayval) == 0 ||
@@ -3083,8 +3114,10 @@
     * Compute the page margins...
     */
 
+#ifdef DEBUG
     dprintf2("DEBUG: Updating PageSize to [%.0f %.0f]...\n",
 	     cups->MediaSize[0], cups->MediaSize[1]);
+#endif /* DEBUG */
 
     memset(margins, 0, sizeof(margins));
 
@@ -3092,23 +3125,31 @@
 
     if (cups->PPD != NULL)
     {
+#ifdef DEBUG
       dprintf1("DEBUG2: cups->header.Duplex = %d\n", cups->header.Duplex);
       dprintf1("DEBUG2: cups->header.Tumble = %d\n", cups->header.Tumble);
       dprintf1("DEBUG2: cups->page = %d\n", cups->page);
       dprintf1("DEBUG2: cups->PPD = %p\n", cups->PPD);
+#endif /* DEBUG */
 
       backside = ppdFindAttr(cups->PPD, "cupsBackSide", NULL); 
       if (backside) {
+#ifdef DEBUG
 	dprintf1("DEBUG2: cupsBackSide = %s\n", backside->value);
+#endif /* DEBUG */
 	cups->PPD->flip_duplex = 0;
       }
+#ifdef DEBUG
       dprintf1("DEBUG2: cups->PPD->flip_duplex = %d\n", cups->PPD->flip_duplex);
+#endif /* DEBUG */
 
       backsiderequiresflippedmargins =
 	ppdFindAttr(cups->PPD, "APDuplexRequiresFlippedMargin", NULL);
+#ifdef DEBUG
       if (backsiderequiresflippedmargins)
 	dprintf1("DEBUG2: APDuplexRequiresFlippedMargin = %s\n",
 		 backsiderequiresflippedmargins->value);
+#endif /* DEBUG */
 
       if (cups->header.Duplex &&
 	  (cups->header.Tumble &&
@@ -3118,10 +3159,14 @@
 	xflip = 1;
 	if (backsiderequiresflippedmargins &&
 	    !strcasecmp(backsiderequiresflippedmargins->value, "False")) {
+#ifdef DEBUG
 	  dprintf("DEBUG2: (1) Flip: X=1 Y=0\n");
+#endif /* DEBUG */
 	  yflip = 0;
 	} else {
+#ifdef DEBUG
 	  dprintf("DEBUG2: (1) Flip: X=1 Y=1\n");
+#endif /* DEBUG */
 	  yflip = 1;
 	}
       }
@@ -3133,10 +3178,14 @@
 	xflip = 0;
 	if (backsiderequiresflippedmargins &&
 	    !strcasecmp(backsiderequiresflippedmargins->value, "False")) {
+#ifdef DEBUG
 	  dprintf("DEBUG2: (2) Flip: X=0 Y=1\n");
+#endif /* DEBUG */
 	  yflip = 1;
 	} else {
+#ifdef DEBUG
 	  dprintf("DEBUG2: (2) Flip: X=0 Y=0\n");
+#endif /* DEBUG */
 	  yflip = 0;
 	}
       }
@@ -3151,16 +3200,22 @@
 	xflip = 1;
 	if (backsiderequiresflippedmargins &&
 	    !strcasecmp(backsiderequiresflippedmargins->value, "True")) {
+#ifdef DEBUG
 	  dprintf("DEBUG2: (3) Flip: X=1 Y=0\n");
+#endif /* DEBUG */
 	  yflip = 0;
 	} else {
+#ifdef DEBUG
 	  dprintf("DEBUG2: (3) Flip: X=1 Y=1\n");
+#endif /* DEBUG */
 	  yflip = 1;
 	}
       }
       else
       {
+#ifdef DEBUG
 	dprintf("DEBUG2: (4) Flip: X=0 Y=0\n");
+#endif /* DEBUG */
 	xflip = 0;
 	yflip = 0;
       }
@@ -3181,8 +3236,10 @@
 	  }
 	if (found == 0) cups->header.cupsPageSizeName[0] = '\0';
       }
+#ifdef DEBUG
       dprintf1("DEBUG2: cups->header.cupsPageSizeName = %s\n", cups->header.cupsPageSizeName);
-#endif
+#endif /* DEBUG */
+#endif /* CUPS_RASTER_SYNCv1 */
 
      /*
       * Find the matching page size...
@@ -3219,7 +3276,9 @@
 	* Standard size...
 	*/
 
+#ifdef DEBUG
 	dprintf1("DEBUG: size = %s\n", size->name);
+#endif /* DEBUG */
 
 	gx_device_set_media_size(pdev, size->width, size->length);
 
@@ -3276,7 +3335,9 @@
 	  * Standard size in landscape orientation...
 	  */
 
+#ifdef DEBUG
 	  dprintf1("DEBUG: landscape size = %s\n", size->name);
+#endif /* DEBUG */
 
 	  gx_device_set_media_size(pdev, size->length, size->width);
 
@@ -3301,7 +3362,9 @@
 	  * Custom size...
 	  */
 
+#ifdef DEBUG
 	  dprintf("DEBUG: size = Custom\n");
+#endif /* DEBUG */
 
           cups->landscape = 0;
 
@@ -3318,8 +3381,10 @@
 	}
       }
 
+#ifdef DEBUG
       dprintf4("DEBUG: margins[] = [ %f %f %f %f ]\n",
 	       margins[0], margins[1], margins[2], margins[3]);
+#endif /* DEBUG */
     }
 
    /*
@@ -3340,8 +3405,17 @@
     * does not keep track of the margins in the bitmap size...
     */
 
+    /* We set the old dimensions to -1 if we have a color depth change, so
+       that memory reallocation gets forced. This is perhaps not the correct
+       approach to preven crashes like in bug 690435. We keep it for the
+       time being until we decide finally */
+    if (color_set) {
+      width_old = -1;
+      height_old = -1;
+    } else {
     width_old = pdev->width;
     height_old = pdev->height;
+    }
     if (cups->landscape)
     {
       width  = (pdev->MediaSize[1] - pdev->HWMargins[1] - pdev->HWMargins[3]) *
@@ -3379,8 +3453,10 @@
       * Device is open and size has changed, so reallocate...
       */
 
+#ifdef DEBUG
       dprintf4("DEBUG2: Reallocating memory, [%.0f %.0f] = %dx%d pixels...\n",
 	       pdev->MediaSize[0], pdev->MediaSize[1], width, height);
+#endif /* DEBUG */
 
       sp = ((gx_device_printer *)pdev)->space_params;
 
@@ -3389,8 +3465,10 @@
 						cups->page_uses_transparency))
 	  < 0)
 	return (code);
+#ifdef DEBUG
       dprintf4("DEBUG2: Reallocated memory, [%.0f %.0f] = %dx%d pixels...\n",
 	       pdev->MediaSize[0], pdev->MediaSize[1], width, height);
+#endif /* DEBUG */
     }
     else
     {
@@ -3398,8 +3476,10 @@
       * Device isn't yet open, so just save the new width and height...
       */
 
+#ifdef DEBUG
       dprintf4("DEBUG: Setting initial media size, [%.0f %.0f] = %dx%d pixels...\n",
 	       pdev->MediaSize[0], pdev->MediaSize[1], width, height);
+#endif /* DEBUG */
 
       pdev->width  = width;
       pdev->height = height;
@@ -3505,9 +3585,11 @@
   cups->header.cupsWidth  = cups->width;
   cups->header.cupsHeight = cups->height;
 
+#ifdef DEBUG
   dprintf1("DEBUG2: ppd = %p\n", cups->PPD);
   dprintf2("DEBUG2: PageSize = [ %.3f %.3f ]\n",
 	   pdev->MediaSize[0], pdev->MediaSize[1]);
+  if (size_set)
   dprintf4("DEBUG2: margins = [ %.3f %.3f %.3f %.3f ]\n",
 	   margins[0], margins[1], margins[2], margins[3]);
   dprintf2("DEBUG2: HWResolution = [ %.3f %.3f ]\n",
@@ -3517,6 +3599,7 @@
   dprintf4("DEBUG2: HWMargins = [ %.3f %.3f %.3f %.3f ]\n",
 	   pdev->HWMargins[0], pdev->HWMargins[1],
 	   pdev->HWMargins[2], pdev->HWMargins[3]);
+#endif /* DEBUG */
 
   return (0);
 }
@@ -3538,7 +3621,9 @@
   ppd_profile_t	*profile;		/* Color profile information */
 
 
+#ifdef DEBUG
   dprintf1("DEBUG2: cups_set_color_info(%p)\n", pdev);
+#endif /* DEBUG */
 
 #ifndef GX_COLOR_INDEX_TYPE
   if (cups->header.cupsBitsPerColor > 8)
@@ -3795,13 +3880,16 @@
 #endif /* DEBUG */
   }
 
+#ifdef DEBUG
   dprintf1("DEBUG2: cups->EncodeLUT[0] = %d\n", (int)cups->EncodeLUT[0]);
   dprintf2("DEBUG2: cups->EncodeLUT[%d] = %d\n", gx_max_color_value,
 	   (int)cups->EncodeLUT[gx_max_color_value]);
+#endif /* DEBUG */
 
   for (i = 0; i < cups->color_info.dither_grays; i ++)
     cups->DecodeLUT[i] = gx_max_color_value * i / max_lut;
 
+#ifdef DEBUG
   dprintf2("DEBUG: num_components = %d, depth = %d\n",
 	   cups->color_info.num_components, cups->color_info.depth);
   dprintf2("DEBUG: cupsColorSpace = %d, cupsColorOrder = %d\n",
@@ -3812,6 +3900,7 @@
 	   cups->color_info.max_gray, cups->color_info.dither_grays);
   dprintf2("DEBUG: max_color = %d, dither_colors = %d\n",
 	   cups->color_info.max_color, cups->color_info.dither_colors);
+#endif /* DEBUG */
 
  /*
   * Set the color profile as needed...
@@ -3825,7 +3914,9 @@
   if (cups->Profile && cups->header.cupsBitsPerColor == 8)
 #endif /* dev_t_proc_encode_color */
   {
+#ifdef DEBUG
     dprintf1("DEBUG: Using user-defined profile \"%s\"...\n", cups->Profile);
+#endif /* DEBUG */
 
     if (sscanf(cups->Profile, "%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f", &d, &g,
                m[0] + 0, m[0] + 1, m[0] + 2,
@@ -3880,7 +3971,9 @@
 
     if (i < cups->PPD->num_profiles)
     {
+#ifdef DEBUG
       dprintf("DEBUG: Using color profile in PPD file!\n");
+#endif /* DEBUG */
 
       cups->HaveProfile = 1;
 
@@ -3899,9 +3992,11 @@
 	{
           cups->Matrix[i][j][k] = (int)((float)k * m[i][j] + 0.5);
 
+#ifdef DEBUG
           if ((k & 4095) == 0)
             dprintf4("DEBUG2: cups->Matrix[%d][%d][%d] = %d\n",
 		     i, j, k, cups->Matrix[i][j][k]);
+#endif /* DEBUG */
         }
 
 
@@ -3911,8 +4006,10 @@
 	                     pow((float)k / (float)CUPS_MAX_VALUE, g) +
 			     0.5);
 
+#ifdef DEBUG
       if ((k & 4095) == 0)
         dprintf2("DEBUG2: cups->Density[%d] = %d\n", k, cups->Density[k]);
+#endif /* DEBUG */
     }
   }
   else
@@ -3959,15 +4056,19 @@
                 ystart, yend, ystep;    /* Loop control for scanline order */   
   ppd_attr_t    *backside = NULL;
 
+#ifdef DEBUG
   dprintf1("DEBUG2: cups->header.Duplex = %d\n", cups->header.Duplex);
   dprintf1("DEBUG2: cups->header.Tumble = %d\n", cups->header.Tumble);
   dprintf1("DEBUG2: cups->page = %d\n", cups->page);
   dprintf1("DEBUG2: cups->PPD = %p\n", cups->PPD);
+#endif /* DEBUG */
 
   if (cups->PPD) {
     backside = ppdFindAttr(cups->PPD, "cupsBackSide", NULL);
     if (backside) {
+#ifdef DEBUG
       dprintf1("DEBUG2: cupsBackSide = %s\n", backside->value);
+#endif /* DEBUG */
       cups->PPD->flip_duplex = 0;
     }
   }
@@ -4001,8 +4102,10 @@
     ystep = 1;
   }
 
+#ifdef DEBUG
   dprintf3("DEBUG: cups_print_chunked: xflip = %d, yflip = %d, height = %d\n",
 	   xflip, yflip, cups->height);
+#endif /* DEBUG */
 
  /*
   * Loop through the page bitmap and write chunked pixels, reversing as
@@ -4180,15 +4283,19 @@
                 ystart, yend, ystep;    /* Loop control for scanline order */   
   ppd_attr_t    *backside = NULL;
 
+#ifdef DEBUG
   dprintf1("DEBUG2: cups->header.Duplex = %d\n", cups->header.Duplex);
   dprintf1("DEBUG2: cups->header.Tumble = %d\n", cups->header.Tumble);
   dprintf1("DEBUG2: cups->page = %d\n", cups->page);
   dprintf1("DEBUG2: cups->PPD = %p\n", cups->PPD);
+#endif /* DEBUG */
 
   if (cups->PPD) {
     backside = ppdFindAttr(cups->PPD, "cupsBackSide", NULL);
     if (backside) {
+#ifdef DEBUG
       dprintf1("DEBUG2: cupsBackSide = %s\n", backside->value);
+#endif /* DEBUG */
       cups->PPD->flip_duplex = 0;
     }
   }
@@ -4222,8 +4329,10 @@
     ystep = 1;
   }
 
+#ifdef DEBUG
   dprintf3("DEBUG: cups_print_chunked: xflip = %d, yflip = %d, height = %d\n",
 	   xflip, yflip, cups->height);
+#endif /* DEBUG */
 
  /*
   * Loop through the page bitmap and write banded pixels...  We have

Modified: branches/chrisl-test-gs/cups/pstoraster.in
===================================================================
--- branches/chrisl-test-gs/cups/pstoraster.in	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/cups/pstoraster.in	2010-10-21 09:19:31 UTC (rev 11833)
@@ -31,7 +31,7 @@
 export GS_LIB
 
 # Options we use with Ghostscript...
-gsopts="-dQUIET -dDEBUG -dPARANOIDSAFER -dNOPAUSE -dBATCH"
+gsopts="-dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH"
 gsopts="$gsopts -dNOMEDIAATTRS -sDEVICE=cups -sstdout=%stderr"
 
 # See if we have a profile=n,n,n,n,n,n,n,n,n,n,n option...


Property changes on: branches/chrisl-test-gs/doc
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/gs_2_colors/doc:10650-10937
/branches/gs_extendgraphic/doc:10114-10199
/branches/smask_work/doc:9134-9665
/tags/ghostscript-9.00/doc:11638-11656
/trunk/gs/doc:11533-11832

Modified: branches/chrisl-test-gs/doc/API.htm
===================================================================
--- branches/chrisl-test-gs/doc/API.htm	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/doc/API.htm	2010-10-21 09:19:31 UTC (rev 11833)
@@ -760,7 +760,7 @@
 San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
 
 <p>
-<small>Ghostscript version 8.71, 10 February 2010
+<small>Ghostscript version 9.00, 14 September 2010
 
 
 <!-- [3.0 end visible trailer] ============================================= -->

Modified: branches/chrisl-test-gs/doc/AUTHORS
===================================================================
--- branches/chrisl-test-gs/doc/AUTHORS	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/doc/AUTHORS	2010-10-21 09:19:31 UTC (rev 11833)
@@ -32,3 +32,4 @@
 stefan911:Stefan Kemper
 thomasd:thomasd
 uid22160:uid22160
+chrisl:Chris Liddell

Modified: branches/chrisl-test-gs/doc/C-style.htm
===================================================================
--- branches/chrisl-test-gs/doc/C-style.htm	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/doc/C-style.htm	2010-10-21 09:19:31 UTC (rev 11833)
@@ -1578,7 +1578,7 @@
 San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
 
 <p>
-<small>Ghostscript version 8.71, 10 February 2010
+<small>Ghostscript version 9.00, 14 September 2010
 
 <!-- [3.0 end visible trailer] ============================================= -->
 

Modified: branches/chrisl-test-gs/doc/Changes.htm
===================================================================
--- branches/chrisl-test-gs/doc/Changes.htm	2010-10-21 08:22:47 UTC (rev 11832)
+++ branches/chrisl-test-gs/doc/Changes.htm	2010-10-21 09:19:31 UTC (rev 11833)
@@ -8,5185 +8,8238 @@
 </head>
 <body>
 
-<p><strong><a name="2010-02-09T161339.643382Z"></a>
-2010-02-09T16:13:39.643382Z Ralph Giles</strong></p>
+<p><strong><a name="2010-09-13T150940.310889Z"></a>
+2010-09-13T15:09:40.310889Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Clean up some typos in the release notes, and mention the reduced memory
-footprint of the halftone cache from r10006.
+Commit the missing header changes from the previous checkin.
 </pre>
-<p>[doc/News.htm]</p>
+<p>[psi/ifapi.h]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-08T221030.586772Z"></a>
-2010-02-08T22:10:30.586772Z Ralph Giles</strong></p>
+<p><strong><a name="2010-09-13T145346.788657Z"></a>
+2010-09-13T14:53:46.788657Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Update the change logs for the second 8.71 release candidate.
+Another revision of the FAPI code. Due to a problem in Freetype which needs
+further investigation, we cannot produce an outline, then decide to produce
+a bitmap if it is small enough. We work around this by producing a bitmap,
+and if it is too large, dispose of it, and retry with an outline, thus although
+we still risk larger than ideal memory use, it is very short lived. A glyph
+too large to be cached (for which we will now usually use an outline) does
+not suffer from the Freetype issue mentioned above.
+
+The maximum allowable bit for Freetype to produce is now 1.5 x the maximum
+cache bitmap as set in the Postscript state - it is set larger than the
+cache bitmap since it is *vital* that if GS expects a bitmap to be cache
+we supply a bitmap. Given that the bounding boxes arrived at the GS cache
+device and the Freetype rendering code arrived at slightly differently, there
+would be the chance of edge cases where FAPI would produce an outline, when
+the cache expects a bitmap. Allowing FAPI plenty of leeway avoids that.
+
+The calculation to convert a quadratic to a cubic spline in the
+Freetype interface code was slightly wrong.
+
+Also, FAPI now sets the fill adjust to 0 for filling outline glyph, instead
+of inhereting the value from the originating graphics state, which gives
+*much* more consistent output between the bitmap and outline cases, and
+addresses the slightly excessive boldness observed for outline glyphs since
+the adoption of Freetype/FAPI as the default font scaler/renderer.
+
+Finally, support for the existing Ghostscrit text anti-aliasing
+capability is improved.
+
+Bug 691604 
+
 </pre>
-<p>[doc/Changes.htm doc/History8.htm doc/News.htm doc/Details8.htm doc/Details.htm]</p>
+<p>[psi/fapi_ft.c psi/zfapi.c psi/fapiufst.c psi/fapibstm.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-08T220322.755385Z"></a>
-2010-02-08T22:03:22.755385Z Ralph Giles</strong></p>
+<p><strong><a name="2010-09-13T102534.372202Z"></a>
+2010-09-13T10:25:34.372202Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Add some notes on what's new in the 8.71 release.
+Revert revisions 11690 and later from the FAPI code (and revert version no. to 9.00)
+to get a &quot;good&quot; base version, in preparation for a corrected version of the changes
+in 11690 (and subsequent changes in the FAPI code).
+
 </pre>
-<p>[doc/News.htm]</p>
+<p>[psi/fapi_ft.c psi/zfapi.c base/version.mak Resource/Init/gs_init.ps psi/ifapi.h psi/fapiufst.c psi/fapibstm.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-08T200658.778484Z"></a>
-2010-02-08T20:06:58.778484Z Ralph Giles</strong></p>
+<p><strong><a name="2010-09-09T135148.502020Z"></a>
+2010-09-09T13:51:48.502020Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Update the the release dates for the second 8.71 release candidate.
+Fix a case where /Width attribute was not checked for null.
+Bug 691602, customer 700.
 </pre>
-<p>[doc/History7.htm doc/Projects.htm doc/History8.htm man/dvipdf.1 base/gscdef.c man/ps2ascii.1 doc/Use.htm doc/Readme.htm doc/Source.htm doc/Deprecated.htm man/ps2epsi.1 doc/Install.htm doc/API.htm doc/Issues.htm doc/DLL.htm doc/Drivers.htm man/pfbtopfa.1 doc/Release.htm doc/Commprod.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm man/gs.1 man/pf2afm.1 doc/Fonts.htm doc/Ps2ps2.htm man/printafm.1 doc/Ps2pdf.htm doc/Develop.htm doc/Helpers.htm man/pdf2dsc.1 doc/Psfiles.htm doc/Lib.htm doc/gs-vms.hlp man/font2c.1 man/gsnd.1 base/version.mak man/pdfopt.1 doc/News.htm man/pdf2ps.1 man/ps2pdf.1 doc/Make.htm doc/Details8.htm doc/Unix-lpr.htm doc/C-style.htm doc/Ps-style.htm doc/History1.htm doc/History2.htm man/gslp.1 man/wftopfa.1 doc/History3.htm man/ps2ps.1 doc/Ps2epsi.htm doc/History4.htm man/ps2pdfwr.1 doc/History5.htm doc/History6.htm]</p>
+<p>[Resource/Init/pdf_font.ps]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-08T173532.033134Z"></a>
-2010-02-08T17:35:32.033134Z Robin Watts</strong></p>
+<p><strong><a name="2010-09-09T072652.042155Z"></a>
+2010-09-09T07:26:52.042155Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Update Visual Studio solutions to use the DEVSTUDIO= form of makefile
-invocation, rather than MSVC_STUDIO=8 version. This should isolate the
-solution/projects entirely from the version of visual studio in use.
+Fix broken version number in gs_init.ps in trunk
+</pre>
+<p>[Resource/Init/gs_init.ps]</p>
+</blockquote>
 
-Simplify the ReadMe.txt file accordingly.
+<p><strong><a name="2010-09-09T062654.427296Z"></a>
+2010-09-09T06:26:54.427296Z Chris Liddell</strong></p>
+<blockquote>
+<pre>
+Add a couple of &quot;.0&quot;s to ensure we get floating point division
+to arrive at intermediate values for the conic to cubic
+spline conversion.
 
-Take the opportunity to add the resource files to the list in the
-ghostscript.vcproj file. This makes no difference to the project in
-terms of building, but enables easy navigation/editing of files
-within VS.
-
 </pre>
-<p>[/trunk/ghostpdl/win32/ReadMe.txt /trunk/ghostpdl/win32/xps.vcproj ghostscript.vcproj /trunk/ghostpdl/win32/pcl.vcproj /trunk/ghostpdl/win32/svg.vcproj /trunk/ghostpdl/win32/language_switch.vcproj]</p>
+<p>[psi/fapi_ft.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-08T164547.345828Z"></a>
-2010-02-08T16:45:47.345828Z Ken Sharp</strong></p>
+<p><strong><a name="2010-09-09T034512.738999Z"></a>
+2010-09-09T03:45:12.738999Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Fix (pdfwrite) bug #691101 (part 2 of 2)
+Fix for compiler complaint from commit of rev 11700</pre>
+<p>[base/gdevpdfb.c base/devs.mak]</p>
+</blockquote>
 
-The revisions 10474 and 10476 were intended to address an indeterminism but actually
-introduced a fairly serious regression. The code was changed to return any error value
-from the glyph_info method before testing the members of the 'info' structure passed to
-the method. Previously one of the member could be examined when an error had meant that
-the member was still uniinitialised.
+<p><strong><a name="2010-09-08T232036.969829Z"></a>
+2010-09-08T23:20:36.969829Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Fix to enable proper mask filling with patterns that have transparency.  Major change is in gdevp14.c where begin_type_image and mask_fill procedures now will (if we are filling with a pattern that has transparency) push a transparency group.  When we are finished processing the image, the group is popped which enables proper blending.  There remains an issue with a special file that Ken created when it is run in c-list mode.  A new bug will be opened for this issue.  Thanks to Ray for helping with this project and finding a bounding box issue in the creation of the transparency group during c-list reading.</pre>
+<p>[base/gdevp14.c base/gxclimag.c base/gsptype1.c base/lib.mak base/gxpcmap.c base/gdevpdfb.c base/gsptype1.h base/gstrans.c base/gxpcolor.h base/gxblend1.c base/gxp1fill.c base/gxp1impl.h base/gdevpdfi.c]</p>
+</blockquote>
 
-However, these revision missed the fact that the glyph_info method can return a
-'rangecheck' error when they require a CDevProc to be executed. Because the error code
-was tested before checking for a CDevProc, the pdfwrite code never executed the
-CDevproc.
+<p><strong><a name="2010-09-08T162242.112334Z"></a>
+2010-09-08T16:22:42.112334Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Fix (pdfwrite) : incorrect pattern matrix calculation
 
-This resulted in a (very) few regressions, this is because the PDF interpreter uses
-a CDevProc to alter the widths of glyphs if a /W array is present in a PDF file.
+Bug #690504 &quot;ps2write does not work with asymmetric resolutions, like 600x1200dpi &quot;
 
-The code now initialises the member of the structure to 0, which we then test before
-checking the return code. If we need to run a CDevProc we now do so.
+The problem was caused by frankly totally incorrect calculations when generating the 
+/Matrix for a pattern. Because we always see the CTM including the resolution scaling
+but need to output a matrix with this removed, we scale the CTM by the inverse of the
+resolution scaling.
 
-Part 2 of this commit explains some further issues with CDevProcs.
+But the calculation simply divided the CTM through by the scale factors, which is
+totally incorrect and fails badly if the matrix involves rotation. The code now
+correctly creates and multiplies a scale matrix. Note, the order of multiplication is
+important here.
 
+No differences expected.
 </pre>
-<p>[base/gdevpdtt.c]</p>
+<p>[base/gdevpdfv.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-08T164518.598274Z"></a>
-2010-02-08T16:45:18.598274Z Ken Sharp</strong></p>
+<p><strong><a name="2010-09-08T083015.885002Z"></a>
+2010-09-08T08:30:15.885002Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Fix (pdfwrite) bug #691101 (part 1 of 2)
+Slight refinement in the how the FAPI character generation detects we are
+producing anti-aliased glyphs.
 
-The revision 10603 fixed a number of issues relating to FontMatrix and descendant fonts
-of CIDFonts. However part of the fix, in CIDWProc, used 'currentfont' to address the
-font dictionary instead of 'currentdict', as is done in the rest of the routine.
+Also, it seems that when assigning variable value to a second, larger data
+type, whilst gcc promotes the data type before the assignment, MSVC promotes
+the variable later, so shifting a 32 bit integer up during an assignment to
+a 64 bit integer variable works find on gcc, but MSVC loses the most
+significant bits. So we need to force the promotion to happen with a cast.
 
-For rendering devices this works well, but for pdfwrite the two dictionaries are not 
-the same, and this causes PostScript errors.
+Bug 691588
 
-This error was initially hidden by the revisions 10474 and 10476 which inadvertently 
-caused all CDevProc routines not to execute when using pdfwrite.
+</pre>
+<p>[psi/fapi_ft.c psi/zfapi.c]</p>
+</blockquote>
 
-This patch alters the CIDWProc to use currentdict instead of currentfont, there are no
-differences with rendering devices but with pdfwrite this causes the CDevProc to 
-execute properly, eliminating a number of errors (when the faulty revisiions 10474
-and 10476 are rolled back)
+<p><strong><a name="2010-09-07T165136.404533Z"></a>
+2010-09-07T16:51:36.404533Z Chris Liddell</strong></p>
+<blockquote>
+<pre>
+Add a further header to ifapi.h required for Unix/Linux builds, and
+add the two additional headers to ifapi.h's dependencies.
 
 </pre>
-<p>[Resource/Init/pdf_font.ps]</p>
+<p>[psi/ifapi.h psi/int.mak]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-04T174757.663462Z"></a>
-2010-02-04T17:47:57.663462Z Lars Uebernickel</strong></p>
+<p><strong><a name="2010-09-07T162646.989782Z"></a>
+2010-09-07T16:26:46.989782Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Changed MaxStripSize for TIFF devices to default to 8 KB.
+Pull in gp.h in ifapi.h for the int64_t type - it seems to be required on Windows.</pre>
+<p>[psi/ifapi.h]</p>
+</blockquote>
 
-This is necessary, because libtiff keeps a whole strip in memory at a time,
-which resulted in very large buffers for big files.  Support of MaxStripSize for
-all TIFF devices which didn't have it before was also added.
+<p><strong><a name="2010-09-07T153217.143998Z"></a>
+2010-09-07T15:32:17.143998Z Chris Liddell</strong></p>
+<blockquote>
+<pre>
+Some fairly substantial changes to the FAPI code to get very high resolutions and
+anti-aliased text working reliably.
 
+For AA text, we now make *sure* to produce outlines for non-cached glyphs, thus
+the GS path code can anti-alias correctly (for cached glyphs, the &quot;show&quot; machinery
+does the anti-aliasing from the cache bitmap).
+
+The high res problems were highlighted by the bbox device (which runs at 4000 dpi).
+To resolve these the width and height parameters for Freetype had to have value
+overflow compensation added, to match the existing underflow compensation.
+
+FAPI/Freetype also now will only create a glyph bitmap if the bitmap size is smaller
+than the allowable glyph cache bitmap. It may still produce a bitmap for a non-cached
+glyph, if the cache is full, but the individual glyph bitmap is not larger than the
+allowable glyph item - this is allow for better consistency when we're near the limit
+of the total cache size.
+
+Finally, the FAPI outline retrieval code now requires 32.32 fixed point variables (rather
+than the previous 16.16), which prevents overflow, and improves accuracy. If also provides
+us with the opportunity to check for overflow/underflow of the GS internal fixed point
+variables, before calling the GS path code.
+
+There are quite a few cluster changes. I have checked them all, and one is a progression
+(missing glyphs now render) and the rest are the pixel level differences expected by
+having GS render a path, rather than Freetype - most are due to Freetype grid fitting to
+the glyph bitmap, and GS grid fitting to the page raster.
+
+Bug 691592 - bbox issue
+Bug 691588 - anti-aliasing
+	
+
+
+
 </pre>
-<p>[base/gdevtifs.c base/gdevtifs.h tiff/libtiff/tif_config.vc.h base/gdevtsep.c doc/Devices.htm base/gdevtfnx.c base/gdevtfax.c]</p>
+<p>[psi/fapi_ft.c psi/zfapi.c psi/ifapi.h psi/fapiufst.c psi/fapibstm.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-04T033854.455593Z"></a>
-2010-02-04T03:38:54.455593Z Ralph Giles</strong></p>
+<p><strong><a name="2010-09-06T101425.582663Z"></a>
+2010-09-06T10:14:25.582663Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Update change logs for the 8.71 release candidate.
+Fix (pdfwrite) : string not being re-encoded
+
+Bug #690441 &quot; Files render properly with gs, but are misformatted by ps2pdf&quot;
+
+A Coverity fix in revision 9072 prevented a crash, but also circumvented code that was
+essential to run under some conditions. (This is described by comments in the code as a
+'trick'). The routine created a text string with the encoded text for a font with a
+custom encoding derived from a CIDFont with an unusual CMap.
+
+In order to avoid the potential crash, but still re-encode the string, which is
+essential, the relevant portion of the code has been copied and is exercised instead of
+executing 'pdf_reserve_char_code_in_pdfont()'. This produces the reencoded string we
+need, but if the encoding fails, where we would have caused a crash by dereferencing a
+NULL pointer, we instead return an error.
+
+No differences expected, we obviously don't have a test case in the regression suite.
 </pre>
-<p>[doc/Changes.htm doc/History8.htm doc/Details8.htm doc/Details.htm]</p>
+<p>[base/gdevpdtt.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-03T224615.528358Z"></a>
-2010-02-03T22:46:15.528358Z Ralph Giles</strong></p>
+<p><strong><a name="2010-09-03T154954.010009Z"></a>
+2010-09-03T15:49:54.010009Z Ray Johnston</strong></p>
 <blockquote>
 <pre>
-Remove the list of open bugs.
+Fix for hang condition in the stream logic for the luratech JPXDecode.
+We need to return EOFC with the final bit of data. Found with PDF 1.7 FTS.
+</pre>
+<p>[base/sjpx_luratech.c]</p>
+</blockquote>
 
-It's grown long enough to be unhelpful to track explicitly in each release.
+<p><strong><a name="2010-09-03T083132.767708Z"></a>
+2010-09-03T08:31:32.767708Z Chris Liddell</strong></p>
+<blockquote>
+<pre>
+A Type 0 font dictionary in a PDF which contained a spurious FontDescriptor
+object confused the interpreter, which resulted in creating a Font resource
+directly, rather than instantiating the DescendantFonts for the Type 0.
+
+We'll now remove the spurious entry from the Type 0 dictionary, to prevent
+any on-going confusion.
+
+No cluster differences expected.
+
+Bug 691589
+
 </pre>
-<p>[doc/News.htm]</p>
+<p>[Resource/Init/pdf_font.ps]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-03T224250.644387Z"></a>
-2010-02-03T22:42:50.644387Z Ralph Giles</strong></p>
+<p><strong><a name="2010-09-03T072106.059509Z"></a>
+2010-09-03T07:21:06.059509Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Update release date for the 8.71 release candidate.
+typo, misplaced quote in revision 11684
 </pre>
-<p>[doc/History7.htm doc/Projects.htm doc/History8.htm man/dvipdf.1 base/gscdef.c man/ps2ascii.1 doc/Use.htm doc/Readme.htm doc/Source.htm doc/Deprecated.htm man/ps2epsi.1 doc/Install.htm doc/API.htm doc/Issues.htm doc/DLL.htm doc/Drivers.htm man/pfbtopfa.1 doc/Release.htm doc/Commprod.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm man/gs.1 man/pf2afm.1 doc/Fonts.htm doc/Ps2ps2.htm man/printafm.1 doc/Ps2pdf.htm doc/Develop.htm doc/Helpers.htm man/pdf2dsc.1 doc/Psfiles.htm doc/Lib.htm doc/gs-vms.hlp man/font2c.1 man/gsnd.1 base/version.mak man/pdfopt.1 doc/News.htm man/pdf2ps.1 man/ps2pdf.1 doc/Make.htm doc/Details8.htm doc/Unix-lpr.htm doc/C-style.htm doc/Ps-style.htm doc/History1.htm doc/History2.htm man/gslp.1 man/wftopfa.1 doc/History3.htm man/ps2ps.1 doc/Ps2epsi.htm doc/History4.htm man/ps2pdfwr.1 doc/History5.htm doc/History6.htm]</p>
+<p>[lib/lpgs.bat]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-03T223942.033100Z"></a>
-2010-02-03T22:39:42.033100Z Ralph Giles</strong></p>
+<p><strong><a name="2010-09-03T071933.619992Z"></a>
+2010-09-03T07:19:33.619992Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Document the location of the new vcproj file, and exclude it from the
-extraneous files test.
+Typo, misplaced quote in revision 11684
 </pre>
-<p>[doc/Develop.htm toolbin/tests/check_dirs.py]</p>
+<p>[lib/pdfopt.bat]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-03T222934.129817Z"></a>
-2010-02-03T22:29:34.129817Z Ralph Giles</strong></p>
+<p><strong><a name="2010-09-03T065244.087509Z"></a>
+2010-09-03T06:52:44.087509Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Bump the copyright date for the windows metadata.
+More Windows batch file madness. 
+
+Guard all path expansion with quotes, since the Windows command shell processor is too
+stupid to do so, even when expanding variables/arguments itself.
+
+Add a trailing separator to the %TEMP% variable before specifying the filename, as
+apparently some setups don't get a trailing separator by default. A paired separator
+(ie \\) doesn't seem to cause a problem so this ought to be safe even if the setup
+does have a trailing separator.
+
 </pre>
-<p>[psi/dwsetup.rc psi/winint.mak]</p>
+<p>[lib/pf2afm.bat lib/gsdj500.bat lib/ps2ascii.bat lib/ps2pdfxx.bat lib/lpr2.bat lib/gsndt.bat lib/gstt.bat lib/eps2eps.bat lib/pdf2dsc.bat lib/gsbj.bat lib/ps2epsi.bat lib/gsdj.bat lib/dumphint.bat lib/ps2ps2.bat lib/gsnd.bat lib/font2c.bat lib/pdfopt.bat lib/gst.bat lib/pdf2ps.bat lib/ps2pdf.bat lib/gslj.bat lib/bdftops.bat lib/pfbtopfa.bat lib/ps2pdf12.bat lib/ps2pdf13.bat lib/ps2pdf14.bat lib/lpgs.bat lib/gslp.bat lib/ps2ps.bat lib/pftogsf.bat]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-02T224855.363996Z"></a>
-2010-02-02T22:48:55.363996Z Ralph Giles</strong></p>
+<p><strong><a name="2010-09-02T155750.419060Z"></a>
+2010-09-02T15:57:50.419060Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Update our included copy of the libpng source to 1.2.42.
+Remove a couple of duplicated font names form the embedding white list, and reduce the
+list length #define appropriately.</pre>
+<p>[base/whitelst.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-09-02T141539.116953Z"></a>
+2010-09-02T14:15:39.116953Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Include the header file purely to get the prototype for the function, otherwise gcc
+complains.
 </pre>
-<p>[libpng]</p>
+<p>[base/whitelst.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-02T224555.167908Z"></a>
-2010-02-02T22:45:55.167908Z Ralph Giles</strong></p>
+<p><strong><a name="2010-09-02T135013.043694Z"></a>
+2010-09-02T13:50:13.043694Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Remove the in-tree copy of the libpng source to make way for a newer release.
+pdfwrite enhancement
+
+The addition of code to test and honour the 'embedding flags' in TrueType fonts has
+led to problems because PostScript producers are embedding type 42 fonts in the
+PostScript which are non-embeddable and worse use a custom non-reversible encoding,
+so that the  resulting PDF file has garbage text when a normally encoded font is used
+as a replacement.
+
+It seems that Adobe has published a 'white list' of fonts which have been granted
+at least some embeddable rights. It isn't obvious if these are fonts which were type
+1 (and therefore could be converted to TrueType and get incorrect embedding rights) or
+if the fonts were originally released as TrueType with the wrong embedding rights.
+
+In any event, this list has now been added to pdfwrite; if a font is encountered which
+has restricted embedding, then its name will be checked against this list, if it is
+found in the list then it will be considered as embeddable. We have already 
+encountered one font on this list which has a slightly different name to the original
+(a space was removed) so spaces in the font names are ignored. 
+
+This list will have to change over time, and we may find other examples of characters
+which we want to handle specially (eg oumlaut treated as o and e)
+
+No differences expected as this is not tested in the current regression suite.
 </pre>
-<p>[libpng]</p>
+<p>[base/whitelst.c base/gdevpdtf.c base/devs.mak base/whitelst.h]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-02T193015.986507Z"></a>
-2010-02-02T19:30:15.986507Z Ralph Giles</strong></p>
+<p><strong><a name="2010-09-01T184752.658366Z"></a>
+2010-09-01T18:47:52.658366Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Update jbig2dec with the 0.11 release source.
+Update the release notes, dates etc for a second 9.00 release candidate
 </pre>
-<p>[jbig2dec/aclocal.m4 jbig2dec/jbig2_metadata.c jbig2dec/install-sh jbig2dec/jbig2.c jbig2dec/mkinstalldirs jbig2dec/jbig2_image.c jbig2dec/configure jbig2dec/Makefile.in jbig2dec/jbig2_text.c jbig2dec/jbig2_metadata.h jbig2dec/jbig2_priv.h jbig2dec/depcomp jbig2dec/compile jbig2dec/jbig2dec.c jbig2dec/config.guess jbig2dec/jbig2_refinement.c jbig2dec/ltmain.sh jbig2dec/config.sub jbig2dec/README jbig2dec/jbig2_halftone.c jbig2dec/config.h.in jbig2dec/jbig2_segment.c jbig2dec/configure.ac jbig2dec/jbig2dec.1 jbig2dec/CHANGES jbig2dec/COPYING jbig2dec/Makefile.am jbig2dec/missing jbig2dec/jbig2_page.c]</p>
+<p>[doc/History7.htm doc/Projects.htm doc/History8.htm doc/History9.htm man/dvipdf.1 man/ps2ascii.1 doc/Use.htm doc/Readme.htm doc/Source.htm doc/Deprecated.htm man/ps2epsi.1 doc/Install.htm doc/API.htm doc/Issues.htm doc/DLL.htm doc/Drivers.htm man/pfbtopfa.1 doc/Release.htm doc/Commprod.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm man/gs.1 man/pf2afm.1 doc/Ps2ps2.htm doc/Fonts.htm man/printafm.1 doc/Ps2pdf.htm doc/Develop.htm doc/Helpers.htm man/pdf2dsc.1 doc/Psfiles.htm doc/Lib.htm doc/gs-vms.hlp man/font2c.1 man/gsnd.1 base/version.mak man/pdfopt.1 man/pdf2ps.1 man/ps2pdf.1 doc/Make.htm doc/Details8.htm doc/Details9.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]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-02T181437.922390Z"></a>
-2010-02-02T18:14:37.922390Z Hin-Tak Leung</strong></p>
+<p><strong><a name="2010-09-01T174918.515475Z"></a>
+2010-09-01T17:49:18.515475Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Set rc.exe location according to MSSDK variable - fix build problem with windows 7 SDK - bug 691062.</pre>
-<p>[psi/msvc32.mak]</p>
+Update the release notes for the second 9.00 release candidate.
+</pre>
+<p>[doc/History9.htm doc/News.htm doc/Details9.htm doc/Details.htm]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-02T072357.821537Z"></a>
-2010-02-02T07:23:57.821537Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-09-01T135934.488373Z"></a>
+2010-09-01T13:59:34.488373Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Re-implement optional content support to avoid dependence on proper nesting
-of optional content and q..Q blocks. Check for the visibility flag and skip
-most graphic operations when needed. Skip test rendering operations by
-installing nullpage device to minimize changes in a rather complicated code.
-Bug 691076, customers 531, 850.
+Silence some compiler warnings. 
+
+Altered a static function to 'void' from 'int' as it returns no values and the callers
+don't test any putative return value.
+
+#ifdef a boolean declaration, as the code which uses it has been #ifdef'ed
+
+Add some parameters to two functions, so that they match the prototypes, the 
+parameters are not used in these functions.
+
 </pre>
-<p>[Resource/Init/pdf_ops.ps Resource/Init/pdf_main.ps Resource/Init/pdf_draw.ps]</p>
+<p>[base/gdevpdfk.c base/gdevpdfc.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-01T194149.001947Z"></a>
-2010-02-01T19:41:49.001947Z Ray Johnston</strong></p>
+<p><strong><a name="2010-09-01T060851.456140Z"></a>
+2010-09-01T06:08:51.456140Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Fix Windows UninstallString registry entry to use &quot; &quot; around the path and
-uninistgs.exe so that (the usual) spaces in the path don't cause problems.
-Thanks to Stefan Kanthak for pointing this out.
+Fix to avoid issues with subtractive monochrome devices when we have transparency.  The gray device pdf14 prototype is used in this case.  VERY limited testing indicates that this fixes a crash with the cups device with its default settings and gives proper rendering.  More complete testing is required to ensure that proper blending is being performed and to investigate the other process color models that the cups device supports (e.g. cmy).  </pre>
+<p>[base/gdevp14.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-08-31T232115.562664Z"></a>
+2010-08-31T23:21:15.562664Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Revert back to having pdfwrite handle what to do with PS color spaces instead of using the V4 profile that gsicc_create generates.  Also, fix a few issues that existed with pdfwrites handling of those spaces, in particular adjustments are made for non D50 white points.  D50 is the required white point for the ICC profile.  About 189 pdfwrite test files will report differences.  I went through them with bmpcmp.    Since the profiles that were generated differ between gsicc_create and pdfwrite minor color differences exist.  In addition, there were some regressions that existed, which this revision will fix.  </pre>
+<p>[psi/zcolor.c base/gdevpdfk.c psi/zimage.c base/gdevpdfc.c base/gsciemap.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-08-31T153427.935572Z"></a>
+2010-08-31T15:34:27.935572Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Fix (pdfwrite) : linewidth corruption when Tr is 1
+
+Bug #690436 &quot; (regression) re-distilling pdf causes R graphics to go block-single-color.&quot;
+
+The problem was cause din the pdfwrite-specific text rendering routines. When the text
+render mode is 1 (stroke), the linewidth is adjusted by the current text matrix. However
+the routine to do this is called each time any element of the text 'graphics state'
+changes. So if multiple calls to (eg) Td were made, the linewidth would be altered
+even though there had been no change in 'w'.
+
+Fixed by getting the current linewidth before the text rendering routine, and setting
+it back to this value after the text rendering routine.
+
+No expected differences. However z400454b01d4-1.pdf seems to exhibit some minor
+differences which I am unable to reproduce locally. They are so minor that bmpcmp
+ignores them, and on my tests the PDF files are identical bar the date/time stamps
+and other metadata. I don't believe this is a real difference.
 </pre>
-<p>[psi/dwinst.cpp]</p>
+<p>[Resource/Init/pdf_ops.ps]</p>
 </blockquote>
 
-<p><strong><a name="2010-02-01T000204.763835Z"></a>
-2010-02-01T00:02:04.763835Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-08-28T220455.196791Z"></a>
+2010-08-28T22:04:55.196791Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Patch font resource category for CET testing to always return the font
-memory usage as unknown (-1) to avoid differences between hosts.
-Bug 691057.
+Implement rendering of /Highlight annotation. Acrobat always uses transparency
+and ignores appearance streams. Bug 691572, customer 532.
+
+Progressions or minor differences (when the annotation has an appearance
+stream) are observed in annots.pdf, CATX1385.pdf, CATX6166.pdf, CATX6508.pdf,
+CATX7659.pdf, CATX8255.pdf, IA3Z4030.pdf, fts_32_3225.pdf
 </pre>
-<p>[Resource/Init/gs_cet.ps]</p>
+<p>[Resource/Init/pdf_main.ps Resource/Init/pdf_draw.ps]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-31T203013.616671Z"></a>
-2010-01-31T20:30:13.616671Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-08-27T135414.847396Z"></a>
+2010-08-27T13:54:14.847396Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Use the sum of local and global VM usage for the value reported by
-&quot;/Font resourcestatus&quot;. This gives better estimation of memory consumption
-and makes the result independent of the global state when the font was
-loaded. With this patch CET case 23-33.PS shows different values for
-&quot;/Font resourcestatus&quot;.
+Fix (pdfwrite) : faulty matrix transformations for Pattern dictionaries
+
+Bug #690398 &quot;Geometric issue with pattern&quot;
+The problem is the definition of the default co-ordinate space. When a Pattern is at the
+page level or drawn inside a form, we need to remove our 0.1 scaling in order to return
+to the 'default co-ordinate space'. However, when painted on a form nested inside a
+form, the default co-ordinate space is the parent form, so we don't need to undo
+the scaling. 
+
+This is the same problem addressed for shading dictionaries in revision 11347.
+
 </pre>
-<p>[Resource/Init/gs_res.ps]</p>
+<p>[base/gdevpdfv.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-31T004638.360004Z"></a>
-2010-01-31T00:46:38.360004Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-08-27T121054.938774Z"></a>
+2010-08-27T12:10:54.938774Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Add a check whether the current layer is visible to Do operator.
-This is a first step to replace implementation that relies on installation
-of an non-rendering output device (nullpage) with an implementation
-that uses direct checks. Bug 691059.
+Fix (pdfwrite) : FormDepth not tracked properly.
+
+Part of the fix for Bug#690398. In order to know whether a pattern matrix should be
+converted to the top level CTM, or to an enclosing Form CTM, we track the Form Depth
+by noting when transparency groups begin and end (currently this is the only way to get
+a form output by pdfwrite).
+
+There was a problem with mask groups, because although pdf_begin_transparency_mask calls
+pdf_begin_transparency_group, pdf_end_transparency_mask doe snot call
+pdf_end_transparency_group. This resulted in the depth being incremented at the start
+of the mask, but not decremented at the end, so patterns could be emitted at the page
+level but with the CTM for a Form level, leading to missing content.
+
+Fixed by decrementing the FormDepth appropriately.
+ 
 </pre>
-<p>[Resource/Init/pdf_draw.ps]</p>
+<p>[base/gdevpdft.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-30T202519.240406Z"></a>
-2010-01-30T20:25:19.240406Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-08-27T120246.764612Z"></a>
+2010-08-27T12:02:46.764612Z regression</strong></p>
 <blockquote>
 <pre>
-Fix 'undefined' error in 29-07C.PS CET test file that was happening because
-.selectmedia procedure in gs_setpd.ps was building an error information
-dictionary ('&lt;failed&gt;' in its comment) with many keys those doesn't exist in
-&lt;request&gt; dictionary, such as /LeadinEdge or /InsertSheet.  This draws the
-policy 0 procedure (line 544) to 'get' non-existant keys from &lt;merged&gt;
-dictionary. Thanks to Masaki Ushizaka for the patch. Bug 691065.
+Added the ability to specify which regression test files will only be
+run during nightly regression testing (i.e. not for commit regression
+tests).  To skip files add them, one per line, to the nightly_only.lst
+file in the corresponding directory (creating this file if none exists).
+See tests_private/customer_tests/nightly_only.lst for an example.
+
 </pre>
-<p>[Resource/Init/gs_setpd.ps]</p>
+<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/readlog.pl toolbin/localcluster/build.pl toolbin/localcluster/run.pl toolbin/localcluster/compare.pl]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-30T065014.586165Z"></a>
-2010-01-30T06:50:14.586165Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-08-26T233428.641761Z"></a>
+2010-08-26T23:34:28.641761Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Preserve /F and /BS attributes of /Link annotation during PDF to PDF
-conversion. Thanks to Ken for the patch. Bug 691092, customer 1.
+Implement rendering of /Squiggly annotation without an appearance stream.
+Bug 691572, customer 532.
 </pre>
-<p>[Resource/Init/pdf_main.ps]</p>
+<p>[Resource/Init/pdf_draw.ps]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-29T214045.586239Z"></a>
-2010-01-29T21:40:45.586239Z regression</strong></p>
+<p><strong><a name="2010-08-26T154951.752958Z"></a>
+2010-08-26T15:49:51.752958Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Added highres option to clusterpush.pl (opposite of lowres).
+Remove an unused local variable (gcc compiler warning)
+
+No differences expected
 </pre>
-<p>[toolbin/localcluster/build.pl toolbin/localcluster/clusterpush.pl toolbin/localcluster/run.pl]</p>
+<p>[base/gdevpdf.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-28T214337.243405Z"></a>
-2010-01-28T21:43:37.243405Z Marcos H. Woehrmann</strong></p>
+<p><strong><a name="2010-08-24T213729.611143Z"></a>
+2010-08-24T21:37:29.611143Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Fixed typo in clusterpush.pl.
+Merge a couple of corrections from the 9.00 tag.
 </pre>
-<p>[toolbin/localcluster/clusterpush.pl]</p>
+<p>[doc doc/History9.htm doc/News.htm doc/Details9.htm]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-28T193419.913293Z"></a>
-2010-01-28T19:34:19.913293Z regression</strong></p>
+<p><strong><a name="2010-08-24T203140.602213Z"></a>
+2010-08-24T20:31:40.602213Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Added a new option to clusterpush.pl: lowres.  This option can appear
-anywhere on the comand line and signals the local cluster regression to
-only run lowres (72 and 75 dpi) output, for example:
+Merge doc changes from 9.00 and bump version number to 9.01
+</pre>
+<p>[doc/Projects.htm man/dvipdf.1 man/ps2ascii.1 doc/Use.htm man/ps2epsi.1 doc/DLL.htm doc/Drivers.htm doc/Release.htm man/gs.1 doc/Ps2pdf.htm man/printafm.1 psi/psromfs.mak psi/dxmain.c toolbin/tests/check_dirs.py doc/Helpers.htm psi/dxmainc.c man/gsnd.1 man/pdfopt.1 base/version.mak Resource/Init/gs_init.ps man/ps2pdf.1 man/pdf2ps.1 doc/News.htm doc/Details8.htm doc/Make.htm doc/Unix-lpr.htm doc/Details9.htm doc/History1.htm doc/History2.htm man/wftopfa.1 doc/History3.htm doc/History4.htm doc/Details.htm man/ps2ps.1 doc/History5.htm doc/History6.htm doc/History7.htm doc/History8.htm doc/History9.htm doc/Readme.htm doc/Source.htm doc/Deprecated.htm /trunk/gs doc/Install.htm doc/Changes.htm doc/API.htm doc/Issues.htm man/pfbtopfa.1 doc/Commprod.htm doc/Xfonts.htm doc/Devices.htm doc/Language.htm psi/dmmain.c doc/Fonts.htm doc/Ps2ps2.htm man/pf2afm.1 doc/Develop.htm man/pdf2dsc.1 psi/dmmain.r doc/Psfiles.htm doc/Lib.htm doc/gs-vms.hlp man/font2c.1 doc/C-style.htm doc/Ps-style.htm man/gslp.1 doc/Ps2epsi.htm man/ps2pdfwr.1]</p>
+</blockquote>
 
-  clusterpush.pl pcl lowres
+<p><strong><a name="2010-08-24T134629.931715Z"></a>
+2010-08-24T13:46:29.931715Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Enhancement - Font copying (pdfwrite)
 
-or
+Bug #691573 &quot; invalidfont in xshow&quot;. The file does in fact contain an invalidfont, the
+type 42 embedded fonts are defined by adding /.notdef to the CharStrings dictionary as 
+if it were the Encoding array. The key /.notdef is added 256 times with values ranging
+from 0 to 255. Of course only the last one is actually defined.
 
-  clusterpush.pl lowres &quot;gs pcl&quot; henrys
+This means that when we come to copy the /.notdef glyph for our font copy, the type 42
+GID is 255. However the font does not contain a glyph with GID 255, so the copy of the
+font fails.
 
-Note that this will fail if we ever hire an engineer with the name lowres
-or use that as an internal product name.  Also, there currently aren't
-any 75 dpi baseline md5sums for the pcl product, so until the next pcl
-svn commit it doens't make sense to run with this option.
+Although this is an illegal font, Adobe Acrobat Distiller does produce a PDF file from
+it. In order to duplicate this, code has been added when copying a font. If we fail to
+copy a glyph, and the glyph is /.notdef and the GID is non-zero, we try to copy a glyph
+with GID 0 instead. If that fails we error out, otherwise we use the glyph with GID 0.
+(TrueType font /.notdef glyph has GID 0)
 
-Also added partial support for generating bitmaps with changes and running them through bmpcmp.
+This works for the supplied file but is not, of course, a guaranteed solution since 
+another badly formed font may not contain a glyph with GID 0.
 
+No Expected Differences
 </pre>
-<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/build.pl toolbin/localcluster/clusterpush.pl toolbin/localcluster/run.pl]</p>
+<p>[base/gxfcopy.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-28T151836.842224Z"></a>
-2010-01-28T15:18:36.842224Z Robin Watts</strong></p>
+<p><strong><a name="2010-08-24T122959.958275Z"></a>
+2010-08-24T12:29:59.958275Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Squash a warning about %d and size_t spotted by Marcos. Thanks.
+In preparation for the release, add my username to real name mapping
+in AUTHORS, add an initially empty History9.htm, and update News.htm
+to point to it.
 
 </pre>
-<p>[toolbin/bmpcmp.c]</p>
+<p>[doc/History9.htm doc/News.htm doc/AUTHORS]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-28T151305.688649Z"></a>
-2010-01-28T15:13:05.688649Z Robin Watts</strong></p>
+<p><strong><a name="2010-08-23T164947.032287Z"></a>
+2010-08-23T16:49:47.032287Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Fix free of incorrect pointer in bmpcmp.
-Also tweak pnm reading so that no seeks are used, so we can use the
+Fix (pdfwrite) : errors in XMP metadata parsing
 
-  bmpcmp &lt; (zcat foo.pnm.gz)  &lt; (zcat bar.pnm.gz) ...
+Bug #691562 &quot;ERROR -15 closing pdfwrite device&quot;.
 
-trick if required (bmps still seek!).
+This use of a DOCINFO pdfmark exposed 3 separate bugs in pdfwrite's handling of XMP
+metadata.
 
+1) Decoding an escaped PostScript string. Unescaped characters and octal escapes worked
+correctly, but non-octal escapes moved the index into the string one place too many.
+
+2) The escape '\b' (backspace) wasn't handled and returned incorrect data. Although not
+tested by this issue, the form feed (\f) also wasn't handled.
+
+3) When converting UTF16 data to UTF-8, the end of the destination (UTF-8) buffer was
+calculated incorrectly, causing a spurious buffer overrun error.
+
+The code now handles the missing escapes, does not advance the character position after
+decoding a non-octal escape and correctly defines the end of buffer. After this the
+Title string displays the same in Acrobat as the same pdfmark sent through Adobe
+Distiller.
+
+No expected differences as this only affects the document metadata.
 </pre>
-<p>[toolbin/bmpcmp.c]</p>
+<p>[base/gdevpdfe.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-28T144422.110825Z"></a>
-2010-01-28T14:44:22.110825Z Ken Sharp</strong></p>
+<p><strong><a name="2010-08-21T080346.086781Z"></a>
+2010-08-21T08:03:46.086781Z Lars Uebernickel</strong></p>
 <blockquote>
 <pre>
-Remove accidental stupid inclusion of a C++ style comment ....
+Remove unnecessary version checks for libtiff in configure.ac.
+
+Since the local copy is preferred over the system's (see r11635), comparing the
+version of the two libraries is unnecessary.
+
 </pre>
-<p>[psi/zfapi.c]</p>
+<p>[base/configure.ac]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-28T143252.354649Z"></a>
-2010-01-28T14:32:52.354649Z Ken Sharp</strong></p>
+<p><strong><a name="2010-08-20T160722.239869Z"></a>
+2010-08-20T16:07:22.239869Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI)
+When we produce a glyph uncached, and it's to be filled with a
+pattern colour space *and* there is PDF transparency involved
+force FAPI to (try to) produce an outline (for lower level
+code to use as a clip) instead of a bitmap (to use as a
+mask).
 
-Bit complex here. The FAPI code needs to tell the font rendering engine how much to
-scale the font in order to get properly sized bitmaps. It does this by looking at the 
-FontMatrix, comparing it with the 'original' FontMatrix and determining the scale from
-there. 
+This does produce some pixel level differences in a few
+cluster files, but improves a load of PDF 1.7 FTS jobs.
 
-The problem is that the 'original' FontMatrix was being retrieved from a copy of the 
-font stored when it is defined, intended for use by pdfwrite. When we define a font we
-check to see if it has an /OrigFont entry, and simply use the one which is present if
-we do.
+Bug 691550
 
-This causes us problems if we make a new scaled font by taking an existing font and 
-changing its FontMatrix. We don't write the new FontMatrix into the OrigFont dict, and
-so when we come to determine the font scale we divide the FontMatrix by the 'original'
-stored matrix. This effectively results in any scale factor built into the FotnMatrix
-being applied twice, once by FreeType because the FontMatrix isn't the default, and 
-once by the FAPI when it divides the FotnMatrix by the original.
+</pre>
+<p>[psi/zfapi.c]</p>
+</blockquote>
 
-I didn't want to modify the OrigFont entry, as that would probably break pdfwrite, so
-I've modified the FAPI code to take a copy of the FontMatrix at the time the font is
-defined and store it in its own structure. We then use this to determine how much to
-scale the font by dividing the current FontMatrix by the matrix at the time the font
-was defined.
+<p><strong><a name="2010-08-19T040105.188148Z"></a>
+2010-08-19T04:01:05.188148Z henrys</strong></p>
+<blockquote>
+<pre>
+Fix bug #691564.  The assignment of the target device did not use the
+proper reference counting assignment procedure resulting in a lost
+reference to the target device.
+</pre>
+<p>[base/gxpcmap.c]</p>
+</blockquote>
 
-This fixes my hand-crafter test file and improves the output of Bug687615.ps and 
-two_encodings.ps. The output is now the correct size, but the spacing is wrong in 
-bug687615.ps and many glyphs are missing from two_encodings.ps.
+
+<p><strong><a name="2010-08-17T143158.354019Z"></a>
+2010-08-17T14:31:58.354019Z Alex Cherepanov</strong></p>
+<blockquote>
+<pre>
+Skip opacity and unknown components during reading of JPX image data. This
+improves image quality (compared to the previous state that interpreted an
+opacity channel as yet another data sample) and serves as a transition to full
+support of opacity in JPX images. Bug 691489, customer 532.
 </pre>
-<p>[psi/fapi_ft.c psi/zfapi.c psi/ifapi.h psi/fapiufst.c]</p>
+<p>[base/sjpx.h psi/zfjpx.c base/sjpx.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-27T190807.958712Z"></a>
-2010-01-27T19:08:07.958712Z Robin Watts</strong></p>
+<p><strong><a name="2010-08-17T012218.729560Z"></a>
+2010-08-17T01:22:18.729560Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Updated version of bmpcmp.c to support maxdiffs parameter. Also, bitmaps
-are output numbered 00000, 00001, etc rather than 0, 1, etc to tidy
-directory listings.
+Don't include opacity channels in the number-of-components count.
+Recognize general ICC profile (type 3) and construct a corresponding
+ICC-based color space. Bug 691470, customer 532.
+</pre>
+<p>[Resource/Init/pdf_draw.ps]</p>
+</blockquote>
 
-Updated htmldiff.pl file to cope with the rejigged number formats.
+<p><strong><a name="2010-08-15T094903.044306Z"></a>
+2010-08-15T09:49:03.044306Z Chris Liddell</strong></p>
+<blockquote>
+<pre>
+Ensure we only check the compatibility of the system libtiff
+if we're actually going to use it.
 
+No cluster differences expected.
+
+Bug 691548
 </pre>
-<p>[toolbin/bmpcmp.c toolbin/htmldiff.pl]</p>
+<p>[base/configure.ac]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-27T145555.064385Z"></a>
-2010-01-27T14:55:55.064385Z Robin Watts</strong></p>
+<p><strong><a name="2010-08-15T094221.565047Z"></a>
+2010-08-15T09:42:21.565047Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Introduce new gs_currentdevicecolor function (and inline macro version) to
-retrieve the current device color from the graphics state. Use this in the
-2 places in pl that require it. This restricts all the knowledge of the
-way colors are stored in the graphics state to being within the gs code.
+The &quot;shortcut&quot; for rendering masks use by the FAPI code for uncached
+glyph bitmaps (gx_image_fill_masked) is only safe, in the general case
+when drawing &quot;plain&quot; colours to the output. For complex colour spaces
+(like patterns) we must use the &quot;long hand&quot; version.
 
-This is done as a precursor to the work to support 2 color's in the graphics
-state to enable a branch to be taken on gs only.
+This causes minor pixel level differences in some cluster tests (due
+to rounding differences), and some (very small) progressions: there
+are differences in about 20 cluster jobs.
 
-Regression tests predict 128 changes, but local testing with htmldiff.pl shows
-none.
+Bug 691549.
 
 </pre>
-<p>[base/gscolor2.c base/gscolor2.h /trunk/ghostpdl/pl/plchar.c /trunk/ghostpdl/pl/pldraw.c base/gzstate.h]</p>
+<p>[psi/zfapi.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-26T011546.612807Z"></a>
-2010-01-26T01:15:46.612807Z Michael Vrhel</strong></p>
+<p><strong><a name="2010-08-14T211029.198491Z"></a>
+2010-08-14T21:10:29.198491Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Fix for memory leak reported in bug 690754.  The memory leak occurred when processing xps transparency files.  The softmask group buffer was not being deallocated properly.  We now properly deallocate an old soft mask buffer that will no longer be used when new one is coming in to replace it.  There should not be any rendering differences with this commit.</pre>
-<p>[base/gdevp14.c]</p>
+Fix a memory corruption problem introduced by the rev. 11588 on some systems.
+Free the string returned by systempapername() but don't free the static string
+returned by defaultpapername() . Bug 691557.
+</pre>
+<p>[base/gp_upapr.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-24T172738.965229Z"></a>
-2010-01-24T17:27:38.965229Z Robin Watts</strong></p>
+<p><strong><a name="2010-08-13T194628.340691Z"></a>
+2010-08-13T19:46:28.340691Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Fix problems with htmldiff.pl introduced when introducing iframes mode.
-(Javascript wasn't working, image source was incorrect).
+Fix (pdfwrite( : Invalid compression filter emitted.
 
+Bug #691556 &quot;Images compressed with the RunLengthDecode filter are invalid&quot; A typo in
+gdevpdfx.h caused the /Filter entry of an image dictionary to be written with a 
+trailing comma if the filter was RunLength.
+
+No differences expected
 </pre>
-<p>[toolbin/htmldiff.pl]</p>
+<p>[base/gdevpdfx.h]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-24T162043.098277Z"></a>
-2010-01-24T16:20:43.098277Z Robin Watts</strong></p>
+<p><strong><a name="2010-08-12T181430.164084Z"></a>
+2010-08-12T18:14:30.164084Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Correct some errors in htmldiff.pl. Firstly, perl doesn't have true/false,
-so use 0/1. Secondly, move framenum increment out of if where I'd incorrectly
-put it before, resulting in everything going into the same dir unless iframes
-were used.
-
+pstoraster: Removed unneeded &quot;-dDEBUG&quot; from Ghostscript command line.
 </pre>
-<p>[toolbin/htmldiff.pl]</p>
+<p>[cups/pstoraster.in]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-23T174247.176361Z"></a>
-2010-01-23T17:42:47.176361Z Robin Watts</strong></p>
+<p><strong><a name="2010-08-12T181047.335830Z"></a>
+2010-08-12T18:10:47.335830Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Updated htmldiff; neater output structure - each files diffs go into their
-own subdirectory. Option to use iframes to avoid regenerating the html
-twice. Config file include now uses ENV{&quot;HOME&quot;} rather than ~ to work on
-Mac OS.
+CUPS Raster output device: Do verbose degug logging only if compiled in debug mode. Bug 690581.
 
+</pre>
+<p>[cups/gdevcups.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-08-12T063908.575092Z"></a>
+2010-08-12T06:39:08.575092Z regression</strong></p>
+<blockquote>
+<pre>
+Added support for regression testing of the cups device.
 </pre>
-<p>[toolbin/htmldiff.pl]</p>
+<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/build.pl toolbin/localcluster/run.pl]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-22T174602.036283Z"></a>
-2010-01-22T17:46:02.036283Z Till Kamppeter</strong></p>
+<p><strong><a name="2010-08-12T025540.283339Z"></a>
+2010-08-12T02:55:40.283339Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-&quot;cups&quot; output device: Reallocate memory for raster data only if the size of the bitmap has changed, to avoid data getting messed up by unneeded reallocation. This should finally fix bug #691029.
+Fix to handle case where the profiledir is NOT set AND there is a change in the process color model for the device AFTER a profile had already been set.  </pre>
+<p>[base/gsicc_manage.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-08-12T014217.270497Z"></a>
+2010-08-12T01:42:17.270497Z Alex Cherepanov</strong></p>
+<blockquote>
+<pre>
+Implement variable text rendering for widget annotations.
+Bug 691536, customer 532.
 </pre>
-<p>[cups/gdevcups.c]</p>
+<p>[Resource/Init/pdf_main.ps Resource/Init/pdf_draw.ps]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-22T090128.663933Z"></a>
-2010-01-22T09:01:28.663933Z Ken Sharp</strong></p>
+<p><strong><a name="2010-08-11T233148.385487Z"></a>
+2010-08-11T23:31:48.385487Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Fix (pswrite)
+Fix for indeterminism issue that was introduced with changes in 16bit image handling.  Last subpixel element was not getting unpacked properly.  </pre>
+<p>[base/gxi16bit.c]</p>
+</blockquote>
 
-The pswrite device only partially implemented the 'file per page' output model. It
-closed the output file and the bbox device, but did not open a new output file or
-reopen the bbox device, leading to potential crashes later when the pswrite device
-tried to access the bbox device.
+<p><strong><a name="2010-08-11T230548.288399Z"></a>
+2010-08-11T23:05:48.288399Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Another compiler complaint fix.  Proper cast of device.</pre>
+<p>[base/gdevpsdi.c]</p>
+</blockquote>
 
-This patch reopens the bbox device, and opens a new output file, at the end of every
-page when we are outputting one file per page. The problem is that this will emit an
-empty EPS after the last page is completed. Fixing this would mean delaying opening the
-output file until we had received a marking operation. That's more work than we want
-to do on this device, so this is being left as an issue.
-</pre>
-<p>[base/gdevps.c]</p>
+<p><strong><a name="2010-08-11T213103.877037Z"></a>
+2010-08-11T21:31:03.877037Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Fix for compiler error due to implicit declaration</pre>
+<p>[base/gdevpsdi.c base/devs.mak]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-21T030421.383005Z"></a>
-2010-01-21T03:04:21.383005Z Hin-Tak Leung</strong></p>
+<p><strong><a name="2010-08-11T185451.837319Z"></a>
+2010-08-11T18:54:51.837319Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-adding the tiff directory to the list of files to zip up during a windows build. Thanks Gennadiy Tsarenkov or the report and patch. Fixes bug 691069</pre>
-<p>[psi/winint.mak]</p>
+Fix so that if the device process color model changes the profile is updated accordingly.</pre>
+<p>[base/gsicc_manage.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-20T190701.585691Z"></a>
-2010-01-20T19:07:01.585691Z Till Kamppeter</strong></p>
+<p><strong><a name="2010-08-11T161745.421152Z"></a>
+2010-08-11T16:17:45.421152Z Henry Stiles</strong></p>
 <blockquote>
 <pre>
-Fixed handling of back sides when duplex printing via the CUPS Raster output device. With PostScript as input format the y-axis of the back sides was often flipped (bug #691029).
+Fix bug # 691532.  Do not attempt to clone an image that does not exist, each completed page should have an associated image.  We'd like to handle this corrupt file with a better fix, for example the absence of an end page segement is clearly a problem with respect to the specification, but Adobe and Artifex have chosen to support other &quot;off spec&quot; streams so more subtle and less obvious error checking is needed.  Thanks to Tim Waugh for analysis on this problem.
 </pre>
-<p>[cups/gdevcups.c]</p>
+<p>[jbig2dec/jbig2_page.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-20T181139.888031Z"></a>
-2010-01-20T18:11:39.888031Z Michael Vrhel</strong></p>
+<p><strong><a name="2010-08-11T152222.427529Z"></a>
+2010-08-11T15:22:22.427529Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-This commit is a fix for bug 691021 which had quantized (unsmooth) shading artifacts when transparency was present.
+Add some words about the ps2write device to the devices documentation.
+</pre>
+<p>[doc/Devices.htm]</p>
+</blockquote>
 
-The primary changes to the code are:
+<p><strong><a name="2010-08-10T164420.491267Z"></a>
+2010-08-10T16:44:20.491267Z regression</strong></p>
+<blockquote>
+<pre>
 
-The adaptive (non-fixed) smoothness method is now used in the shading code when transparency is present.  Previously there was a check put in place and if there was transparency a fixed amount of smoothing was enforced.
+Several minor changes to the cluster regression system, the most
+signifcant of which are:
 
-The color cache used in the shading code was updated to use the color information in the transparency device that is contained in the imager state.  This object is initialized with either the target device when there is no transparency or with the PDF14 device when there is transparency.  In this way, the proper color information is used by the cache.
+seg. faults are now reported for every case (previously they were only
+reported if they were new)
 
-The shading code makes use of the member variables comp_shift and comp_bits in the color_info member variable of the target device.  This information is now properly updated in the PDF14 device as the transparency group color space changes.
+skip.lst files are now checked for errors
 
-A clist change was also required for proper XPS rendering of gradients.  When it has a gradient with a transparency component, the XPS code first creates a soft mask group and draws the alpha shading.  It then creates a transparency group to draw the color components portion of the shading.  When the transparency group is popped, is is composed using the soft mask buffer which is the XPS opacity shading.  When we are going through the clist writer, the writer will end up drawing the shadings for both the opacity component and the color component with trapezoid fills.  Later, during the clist reading and execution of the trapezoid filling, a clipping device is created.  This device is created with the color info properties of the target device, which in our case is a PDF14 device.  The clipping device is first created during the soft mask group.  This group has color information associated with a grey device since it is just a single channel (the XPS alpha channel).  Later, the same clipping device is used when we are doing the trapezoid filling during the transparency group fills.  The problem is that the color information of the target device may have changed, for example if the transparency color group is RGB or CMYK.  We need to test for that and update the color info for the clipping device. 
+changes to gs/psi now test the pcl/pxl/xps products since changes to
+Ghostscript can affect the pdfwrite path
 
-There are several regression test files that are affected by this commit.  I looked at all of them. Changes appear to be progressions or visually unnoticeable.  Files are
+the tests_private/pdf/PDF_1.7_FTS repository was added
 
-Bug688807.pdf
-Bug689918.pdf
-Bug690115.pdf
-Bug690206.pdf
-Bug690535.pdf
-Bug690709.pdf
-CATX1101.pdf
-CATX4135.pdf
-CATX5233.pdf
-CATX6508.pdf
-CATX9004.pdf
-IA3Z0302.pdf
-IA3Z0303.pdf
-as well as most of the fts_##xx.xps tests.  
 
-
 </pre>
-<p>[base/gscicach.h base/gxshade6.c base/gdevp14.c base/gdevp14.h base/gxshade.c base/gscicach.c base/gxclrast.c base/gxshade.h]</p>
+<p>[toolbin/localcluster/clustermonitor.pl toolbin/localcluster/clustermaster.pl toolbin/localcluster/readlog.pl toolbin/localcluster/build.pl toolbin/localcluster/run.pl toolbin/localcluster/compare.pl]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-19T213816.998845Z"></a>
-2010-01-19T21:38:16.998845Z Hin-Tak Leung</strong></p>
+<p><strong><a name="2010-08-10T162019.775613Z"></a>
+2010-08-10T16:20:19.775613Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-adding comment about possible future rewrite with XGetPixel() ; no code change</pre>
-<p>[base/gdevx.c]</p>
+Commit to move the ICC profile for the device within the device structure.  This will make it easier to handle dynamic changes that may occur to the process color model for the device.  Also a move of device profiles into non gc memory and removal of any references to profiles to the GC.    A few progressions occur with this commit including Bug689918.pdf testpage.pdf. </pre>
+<p>[base/gxi12bit.c base/gsdevice.c base/gdevpdfk.c base/gxpcmap.c base/gxdevice.h /trunk/ghostpdl/xps/xpsgradient.c base/gdevprn.c base/gdevpsdi.c base/gscsepr.c base/gscpixel.c base/gxcmap.c base/gdevbit.c base/gxclip.c base/gxicolor.c base/gximag3x.c base/gscspace.c base/gsicc.c base/gscdevn.c base/gscolor2.c base/lib.mak base/gxiscale.c base/gsicc_manage.c base/gxcspace.h base/gscicach.c base/gdevnfwd.c base/gxdevcli.h base/gdevp14.c psi/zdevice.c base/gsicc_create.c base/gsicc_cache.c base/gdevp14.h base/gsicc_cache.h base/gxccman.c base/gscms.h base/gxclist.h psi/zusparam.c base/gxshade.c base/gxblend.c base/gsequivc.c base/gsciemap.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-19T154857.559895Z"></a>
-2010-01-19T15:48:57.559895Z Robin Watts</strong></p>
+<p><strong><a name="2010-08-10T091550.312005Z"></a>
+2010-08-10T09:15:50.312005Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Attempt to fix bug 691030, regression with thin lines. This regression was
-caused by revision 10391, where I pulled the rectangle special cases into
-line with the more general case. Sadly, the more general case appears to be
-wrong in the way it rounds lines lying on integer values.
+Enhancement : pdfwrite
 
-The fix is to correct the rounding in the general case, and to keep the
-rectangle special cases in line with this. Unfortunately this produces
-unacceptable results with the PCL interpreter.
+performance enhancement for pdfwrite when handling files with large amounts of text.
 
-We therefore commit a compromise solution, whereby we make the code do the
-'correct' thing (or what we believe the correct thing is) for postscript,
-and leave operation alone for the other languages. We spot this by examining
-the fill_adjust values. This seems to works, with the minor problem that we
-still see some changes in PCL due to it sometimes using non-zero fill_adjust
-to thicken lines. A visual check shows the diffs to be reasonable.
+Bug #689859 &quot;Performance comparison versions 7.07 and 8.62 on HP-UX ia64&quot; Alex's
+analysis shows that pdfwrite was spending a lot of time trying to to see if two type 1
+fonts were the same before deciding whether a glyph could be added to a font, or was 
+already present in a font copy.
 
-Expected Differences: MANY. But extensively checked with htmldiff and they
-seem OK.
+Most of the time was spent extracting and comparing /Subrs. The new code creates a hash
+(MD5) of both the local and global Subrs (if present) and stores that in the type 1
+'data' field in the font (16 bytes). The hashes are created by pdfwrite only as they 
+are required, so there is no performance penalty for rendering. The hash comparison is
+considerably quicker than the long winded Subrs comparison.
 
+For many files the performance difference is minimal but for file containing lots of
+pages, mostly composed of text, there is a considerable saving. The text files run in
+about 60% of the time they did before this change.
 
 </pre>
-<p>[base/gxdevcli.h base/gdevtxtw.c base/gdevtrac.c base/gdevbbox.c base/gdevmem.c base/gdevnfwd.c base/gdevddrw.c base/gxstroke.c]</p>
+<p>[base/gxfont1.h base/gxfcopy.c psi/zfont1.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-19T111824.072283Z"></a>
-2010-01-19T11:18:24.072283Z Robin Watts</strong></p>
+<p><strong><a name="2010-08-10T081335.250205Z"></a>
+2010-08-10T08:13:35.250205Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Move ghostscript.vcproj from win32 to gs directory, and adjust solution file
-accordingly. This serves 2 purposes; firstly, the solution now correctly
-supports tag jumping (that is, the ability to click on a warning or error
-and jump to that line in the file). The second is that the ghostscript
-project now lives in the ghostscript directory, and hence may be usable by
-people wanting to build *just* ghostscript, rather than ghostscript as a
-component of GhostPDL.
+A small revision to the fix for Bug 691326: the glyphs array must have
+at least one entry.
 
-Update ReadMe.txt to reflect this change, and document a known problem.
+No cluster differences expected.
 
-No expected differences.
+Bug 691343
+</pre>
+<p>[Resource/Init/gs_ttf.ps]</p>
+</blockquote>
 
+<p><strong><a name="2010-08-09T004131.173587Z"></a>
+2010-08-09T00:41:31.173587Z Ray Johnston</strong></p>
+<blockquote>
+<pre>
+Free the pattern-clist devices that are created (and left for the GC to
+free) when pattern-clist patterns are used with a device that is using the
+clist for the page. Those that were allocated during the print_page clist
+playback would be those that leaked. Since the devices were closed, this
+could lead to GC referencing objects that were invalid. Related to, but
+not the final fix to Bug 691527.
 </pre>
-<p>[/trunk/ghostpdl/win32/ghostscript.vcproj /trunk/ghostpdl/win32/ReadMe.txt ghostscript.vcproj /trunk/ghostpdl/win32/GhostPDL.sln]</p>
+<p>[base/gxpcmap.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-18T112829.454584Z"></a>
-2010-01-18T11:28:29.454584Z Ken Sharp</strong></p>
+<p><strong><a name="2010-08-09T000727.505245Z"></a>
+2010-08-09T00:07:27.505245Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Addendum to revision 10615. Use the *y* scale factor for computing the vertical character
-advance, not the x scale which the previous commit used. Also note that the text of the
-previous log said:
+Remove spurious &quot;cvx&quot; operators after .pushextendedgstate and
+.popextendedgstate . Do .popextendedgstate after checking that &quot;Q&quot;
+has a correspondingh &quot;q&quot;. Bug 691538.
+</pre>
+<p>[Resource/Init/pdf_ops.ps]</p>
+</blockquote>
 
-&quot;as a parameter to zchar_set_cache to set the horizontal advance&quot;
+<p><strong><a name="2010-08-07T155808.066501Z"></a>
+2010-08-07T15:58:08.066501Z Alex Cherepanov</strong></p>
+<blockquote>
+<pre>
+Implement rendering of Widget annotation border background specified by
+/BC and /BG entries of the appearance characteristics dictionary /MK.
+Bug 691524, customer 532.
+</pre>
+<p>[Resource/Init/pdf_draw.ps]</p>
+</blockquote>
 
-That should, of course, read vertical advance.
+<p><strong><a name="2010-08-06T202111.891509Z"></a>
+2010-08-06T20:21:11.891509Z Ray Johnston</strong></p>
+<blockquote>
+<pre>
+Fix segfault seen with fts_17_1704.pdf when the clist playback of patterns
+that had been stored as clists were attempted to be read from the clist
+as bitmaps. This happened when -dMaxPatternBitmap=1000000 was used which
+is smaller than the default, confusing a HACK that attempted to force
+the use of the pattern-clist mode. Also remove some #if 0 idle code.
 </pre>
-<p>[psi/zfapi.c]</p>
+<p>[base/gsptype1.c base/gxpcmap.c base/gxcolor2.h]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-18T111655.954810Z"></a>
-2010-01-18T11:16:55.954810Z Ken Sharp</strong></p>
+<p><strong><a name="2010-08-06T172216.521958Z"></a>
+2010-08-06T17:22:16.521958Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI - FreeType). The current FAPI implementation for FreeType ignores any vertical
-advance defined in a glyph. This causes type 1 glyphs defined with an sbw (not hsbw) 
-which have a vertical advance as well as, or instead of, a horizontal advance to not
-advance the current point correctly.
+I missed a couple of now unused variables in the previous commit.
+</pre>
+<p>[psi/iname.c]</p>
+</blockquote>
 
-There is a separate issue with FreeType which does not return the correct vertical 
-advance which will be addressed in a separate patch.
+<p><strong><a name="2010-08-06T154921.355481Z"></a>
+2010-08-06T15:49:21.355481Z Ray Johnston</strong></p>
+<blockquote>
+<pre>
+Add documentation on -dMaxPatternBitmap=# parameter in the 'Improving
+Performance' section of the Use.htm file. The actual parameter was
+added in rev 11605.
+</pre>
+<p>[doc/Use.htm]</p>
+</blockquote>
 
-This patch adds the vertical advance to the metrics structure and uses it as a 
-parameter to zchar_set_cache to set the horizontal advance in GS for the glyph.
+<p><strong><a name="2010-08-06T150300.994141Z"></a>
+2010-08-06T15:03:00.994141Z Chris Liddell</strong></p>
+<blockquote>
+<pre>
+Prevent doing a gc &quot;unmark&quot; on memory already (potentially)
+freed.
+
+Relates to Bug 691380. I could not reproduce the seg fault
+as reported, but valgrind reported the write to freed memory
+in the same place as the reported seg fault.
+
 </pre>
-<p>[psi/fapi_ft.c psi/zfapi.c psi/ifapi.h]</p>
+<p>[psi/iname.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-18T084120.191771Z"></a>
-2010-01-18T08:41:20.191771Z Ken Sharp</strong></p>
+<p><strong><a name="2010-08-06T111522.616992Z"></a>
+2010-08-06T11:15:22.616992Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI). The code to 'serialise' a CFF font (that is to convert the internal GS
-representation back to a stream resembling a disk font) was seriously broken when writing
-a local Subrs DICT.
+Fix pdfwrite
+There is a hack in type 3 font creation in pdfwrite which increases the FontMatrix if
+all the elements are very small, apparently Acrobat is unable to cope with very small 
+FontMatrix entries.
 
-The offset to the Subrs DICT is stored in the Private DICT as an offset from the
-start of  the Private DICT. This means it depends on the length of the Private DICT,
-but the Private DICT includes that offset, so the length of the Private DICT is
-dependent on the size of the offset (CFF integers use between 1 &amp; 5 bytes depending
-on their value).
+However, if all the entries are 0, it ends up running round a loop multiplying by 10
+indefinitely. This change simply avoids the loop if all the matrix elements are 0.
+Naturally this isn't a useful font, its a Quality Logic test file.
 
-The normal method for dealing with this is a process of refinement; assume that a 1 byte
-representation will suffice, calculate the size of the DICT, see if that size can be 
-represented in 1 byte. If not assume a 2 byte representation, recalculate the size
-of the DICT, see if it can be represented in 2 bytes and so on.
+</pre>
+<p>[base/gdevpdtt.c]</p>
+</blockquote>
 
-It looks like the code was intended to do this, but it was in fact seriously broken
-and ended up incrementing an integer for size of DICT until it became negative, and
-then stored a negative (and incorrect) offset to the Subrs.
+<p><strong><a name="2010-08-06T111140.511965Z"></a>
+2010-08-06T11:11:40.511965Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Revision 11600 introduced a sever regression with text in XPS files. This revision
+addresses that by only applying the fix to preserve glyph data when the text operation
+is TEXT_FROM_SINGLE_GLYPH as this is the only case where the affected union is a glyph
+not a pointer to a series of glyphs, and is therefore the only case which is affected.
 
-Replaced the code with a simple for loop surrounding a switch.
+Expected Differences: All XPS files with text should again work correctly.
 </pre>
-<p>[psi/write_t2.c]</p>
+<p>[base/gdevpdte.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-14T163845.881264Z"></a>
-2010-01-14T16:38:45.881264Z Ken Sharp</strong></p>
+<p><strong><a name="2010-08-06T082720.529691Z"></a>
+2010-08-06T08:27:20.529691Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Fix the syntax error accidentally committed in revision 10608 which prevented
-Ghostscript from building.
+Revise some of the FAPI related information.
+
 </pre>
-<p>[base/gdevpdtw.c]</p>
+<p>[doc/Use.htm doc/Make.htm doc/Develop.htm doc/Psfiles.htm]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-14T162503.707208Z"></a>
-2010-01-14T16:25:03.707208Z Ken Sharp</strong></p>
+<p><strong><a name="2010-08-06T055342.503244Z"></a>
+2010-08-06T05:53:42.503244Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Fix (pdfwrite) Bug #691058 &quot;Incorrect embedding of CIDToGIDMap for CIDFontType 2&quot;.
+Implement rendering of standard Stamp and Text annotations. Ghostscript uses
+different font than Acrobat in Stamp icons and uses the same icon for the Text
+annotation regardless of the /Name attribute. Bug 691525, customer 532.
+</pre>
+<p>[Resource/Init/pdf_draw.ps]</p>
+</blockquote>
 
-Previously we would embed a CIDToGIDMap for a CIDFontType 2 font (TrueType outlines) if
-the font had a non-identity CIDToGIDMap, or if we were producing PDF/A output.
+<p><strong><a name="2010-08-06T042459.663647Z"></a>
+2010-08-06T04:24:59.663647Z Ray Johnston</strong></p>
+<blockquote>
+<pre>
+Add a new paramter MaxPatternBitmap with a default value of 8Mb. Formerly
+the pattern_clist mode would be used when the bitmap size exceeded 1Mb
+and prior to rev 11___ this calculation was flawed and could allow pattern
+bitmaps as large as 64Mb to avoid the pattern_clist mode. While the clist
+based pattern tiling is slow, setting the threshold to 8Mb should be rare
+enough to minimize performance impact. Bug 691512.
+</pre>
+<p>[base/gsdevice.c base/gdevp14.c base/gxdevcli.h base/gsdparam.c base/gxpcmap.c base/gxdevice.h base/gdevbit.c]</p>
+</blockquote>
 
-However the spec (PDF 1.7, Section 5.6, &quot;Glyph Selection in CIDFonts') says that we
-should *always* embed a CIDToGIDMap if the font is embedded, and never if the font is
-not. 
+<p><strong><a name="2010-08-05T232612.261846Z"></a>
+2010-08-05T23:26:12.261846Z Till Kamppeter</strong></p>
+<blockquote>
+<pre>
+CUPS Raster output device: Segmentation fault on mid-job changes of the color depth.
 
-This patch modified the CIDToGIDMap production so that we ignore the production of PDF/A
-files, and instead check whether the font is being embedded. If it is being embedded
-then we create a CIDToGIDMap, if it is not, then we don't.
+This patch prevents the crash by forcing a memory reallocation on
+color depth changes. The approach principally works but we did not
+decide yet whether it is the final solution, as Michael Vrhel is still
+doing major changes in the color handling. Bug 690435.
+
 </pre>
-<p>[base/gdevpdtw.c]</p>
+<p>[cups/gdevcups.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-14T022419.739891Z"></a>
-2010-01-14T02:24:19.739891Z Masaki Ushizaka</strong></p>
+<p><strong><a name="2010-08-05T191611.698734Z"></a>
+2010-08-05T19:16:11.698734Z Ray Johnston</strong></p>
 <blockquote>
 <pre>
-Fix two warnings introduced in rev. 10603.  Signed/unsigned incompatibility.
+Fix comment about no support for BITS=4
 </pre>
-<p>[base/gschar0.c]</p>
+<p>[lib/viewrgb.ps]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-13T210409.482842Z"></a>
-2010-01-13T21:04:09.482842Z regression</strong></p>
+<p><strong><a name="2010-08-05T191400.403158Z"></a>
+2010-08-05T19:14:00.403158Z Ray Johnston</strong></p>
 <blockquote>
 <pre>
+Minor correction to usage string left over from when this was split out
+from setupgs.
+</pre>
+<p>[psi/mkfilelt.cpp]</p>
+</blockquote>
 
-General cleanup and minor improvements of the local cluster code:
-  changed timeout values
-  keep logs of machine status messages
-  change previous md5sum cache size
-  better differentiate pdfwrite vs bitmap output errors
+<p><strong><a name="2010-08-05T174036.908437Z"></a>
+2010-08-05T17:40:36.908437Z Chris Liddell</strong></p>
+<blockquote>
+<pre>
+The &quot;show&quot; machinery expected that even non-marking text operations
+(such as stringwidth) would result in a glyph bitmap which
+could be cached (assuming the glyph would be a candidate for the
+cache with a normal marking operation, like show).
 
+FAPI, however, did not create a glyph bitmap for non-marking
+operations, thus the cache would receive a valid, but
+&quot;empty&quot; glyph. This caused Postscript that used stringwidth
+before a show to sometimes &quot;lose&quot; glyphs, by using the empty
+cached glyph.
 
+FAPI's behaviour now matches the expectations of the show/cache
+management code.
+
+Causes cluster differences in Bug688372.ps, fts_31_3111.pdf, and
+14-08.PS, these are all progressions.
+
+Bug 691517
+
 </pre>
-<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/readlog.pl toolbin/localcluster/build.pl toolbin/localcluster/run.pl toolbin/localcluster/compare.pl]</p>
+<p>[psi/fapi_ft.c psi/zfapi.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-12T214228.034208Z"></a>
-2010-01-12T21:42:28.034208Z Robin Watts</strong></p>
+<p><strong><a name="2010-08-05T154939.430735Z"></a>
+2010-08-05T15:49:39.430735Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Fix overallocation in bmpcmp.c that was causing out of memory errors.
+Fix (pdfwrite) 
+A piece of data (pointer to glyph data) was stored and passed into a routine
+'process_text_modify_width' which expected the glyph data to remain unchanged but
+modified the text enumerator data. This doesn't work if the glyph data is a pointer
+to the text enumerator data. NB the text enumerator is saved and restored around the
+call.
 
+Modified so that the calling routine makes a copy of the glyph data before calling 
+'process_text_modify_width'.
 
+This should prevent 13-10.ps from entering an infinite loop.
 </pre>
-<p>[toolbin/bmpcmp.c]</p>
+<p>[base/gdevpdte.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-12T202232.464302Z"></a>
-2010-01-12T20:22:32.464302Z Robin Watts</strong></p>
+<p><strong><a name="2010-08-04T231524.779084Z"></a>
+2010-08-04T23:15:24.779084Z Robin Watts</strong></p>
 <blockquote>
 <pre>
-Updated bmpcmp.c and htmldiff.pl. bmpcmp.c now outputs metadata about each set
-of difference bitmaps (which page, bbox etc). htmldiff.pl now reads that
-metadata and outputs that into the file. Some javascript hackery is used to
-display the device coords of the point under the mouse pointer.
+Fix for Bug 691504 (gs taking a long time to render a file).
 
-Finally, if the $parallel option is set, htmldiff will fork jobs in parallel
-to try to make better use of multicore machines.
+Revision 8694 changes code from using a simple cast to an int to using
+a call to (int)floor. This fixes problems, but costs a factor of 3 in
+processing time for heavily tiled files.
 
+Here we change to using a macro version of floor instead. This removes
+the function call and NaN handling overheads and returns us to the
+same kind of performance as we had before.
 
+We apply the same change throughout the file (i.e. all the calls to (int)floor,
+not just the two changed in r8694.
+
+There is still scope for optimising this code further, but this closes the
+regression.
+
+No differences seen in local cluster testing.
+
 </pre>
-<p>[toolbin/bmpcmp.c toolbin/htmldiff.pl]</p>
+<p>[base/gxp1fill.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-12T094958.118243Z"></a>
-2010-01-12T09:49:58.118243Z Masaki Ushizaka</strong></p>
+<p><strong><a name="2010-08-04T225904.842835Z"></a>
+2010-08-04T22:59:04.842835Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Fix for bug #690834 &amp; #687832
+Implement rendering of Underline and StrikeOut annotations without
+appearance streams. Bug 691526, customer 532.
+</pre>
+<p>[Resource/Init/pdf_draw.ps]</p>
+</blockquote>
 
-Bug #690834: text garbled in PS viewer; PDF works
- - Fixed to concatenate CIDFont FDArray font's FontMatrix when running under 'cshow' or 'glyphshow'.
- - Fixed to use correct FDArray font when concatenate its FontMatrix.
- - Changed the meaning of 'fstack.items[n].index' to keep track of FDArray font and FontMatrix.
- - Reverted the rev. 5613 which was a fix for bug #687832.
-Bug #687832: (PDF interpreter) : CID Font in PDF
- - Fixed the interpretaion of W/W2/DW/DW2 value from glyph space (wrong) to 1000th of text space (correct).
+<p><strong><a name="2010-08-03T120247.197684Z"></a>
+2010-08-03T12:02:47.197684Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Fix : FAPI (no bug number, discovered working on a different problem)
 
-Applying this patch makes some one dot differences on text in 19 files of LocalCluster test. (List is in Bugzilla #687832 comment #9).</pre>
-<p>[base/gxchar.c Resource/Init/pdf_font.ps base/gdevpdtc.c base/gschar0.c base/gxtext.h]</p>
+Another place where the FAPI code assumes that a text enumerator is a show_enum and 
+casts it as such. While this is true for rendering, it is not the case when capturing
+glyphs for pdfwrite.
+
+Altered the code to test if the enumerator is a show_enum and if not, to get the
+graphics state from the enumerator 'pis' pointer instead if possible. Signal an error
+if this is not possible.
+
+No differences expected.
+</pre>
+<p>[psi/zfapi.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-11T120826.301794Z"></a>
-2010-01-11T12:08:26.301794Z Ken Sharp</strong></p>
+<p><strong><a name="2010-08-03T080213.862491Z"></a>
+2010-08-03T08:02:13.862491Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Bug #691044 &quot;&quot;
+Enhancement : PDF interpreter. Bug #691503
 
-Another problem caused by a corrupt compressed data stream, resulting in garbage data
-being sent to the TrueType interpreter.
+When creating an outline (/OUT pdfmark), especially for the pdfwrite device, check the 
+destination page to see that it lies between FirstPage and LastPage; if it does not, then
+don't emit it. This is an extension to the existing control which checked that the 
+destination page wasn't greater than the number of pages in the PDF file.</pre>
+<p>[Resource/Init/pdf_main.ps]</p>
+</blockquote>
 
-Caused when the TT interpreter is given an argument of 0 to the MINDEX operator. Rather
-than flag this as an error I've chosen to simply return. This is because it seems that
-a value of 0 is actually legal (stupid, but legal), and simply leaves the stack
-unchanged.
+<p><strong><a name="2010-08-03T075650.987568Z"></a>
+2010-08-03T07:56:50.987568Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+In the section 'Using Unicode True Type fonts', replace the example CSI array with one
+whose values are strings, not names. These must be string values.
+</pre>
+<p>[doc/Use.htm]</p>
+</blockquote>
 
+<p><strong><a name="2010-08-02T213029.939498Z"></a>
+2010-08-02T21:30:29.939498Z Alex Cherepanov</strong></p>
+<blockquote>
+<pre>
+Partly revert rev. 11392 that over-simplified the check for a valid obj line
+in the PDF file. Use --search-- to reject impossible cases but revert to the
+old logic to verify the results. Bug 691502.
 </pre>
-<p>[base/ttinterp.c]</p>
+<p>[Resource/Init/pdf_rbld.ps]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-10T155148.168326Z"></a>
-2010-01-10T15:51:48.168326Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-08-02T164500.756282Z"></a>
+2010-08-02T16:45:00.756282Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Don't use operator 'execute' because it resets the /command attribute
-in $error dictionary. Use '.execute pop' instead. Keep 'execute' as an
-operator for backward compatibility. Thanks to dakka.akka at gmail.com
-for analysis of the bug. Bug 691050.
+Fix a compiler warning about a missing prototype for free()
+caused by my previous commit.
 </pre>
-<p>[toolbin/smoke.ps Resource/Init/gs_init.ps]</p>
+<p>[base/lib.mak base/gp_upapr.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-09T235933.690907Z"></a>
-2010-01-09T23:59:33.690907Z Robin Watts</strong></p>
+<p><strong><a name="2010-08-02T134903.975996Z"></a>
+2010-08-02T13:49:03.975996Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Updated version of bmpcmp. Now loads bmp, pgm, pbm, ppm files. Diffs are
-always written as bmps though.
+Fix a memory leak. Free the paper name string allocated amd 
+returned by libpaper.
+</pre>
+<p>[base/gp_upapr.c]</p>
+</blockquote>
 
-No expected differences.
+<p><strong><a name="2010-08-02T092004.666066Z"></a>
+2010-08-02T09:20:04.666066Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Missing ';' in r11586 replaced. Should build now.</pre>
+<p>[base/gdevpdfx.h]</p>
+</blockquote>
 
+<p><strong><a name="2010-08-02T090647.523074Z"></a>
+2010-08-02T09:06:47.523074Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Fix a few minor compiler warnings from gcc. No differences expected.
 </pre>
-<p>[toolbin/bmpcmp.c]</p>
+<p>[base/gdevpdfx.h base/gdevpdf.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-09T160124.458674Z"></a>
-2010-01-09T16:01:24.458674Z Ken Sharp</strong></p>
+<p><strong><a name="2010-08-02T063925.229115Z"></a>
+2010-08-02T06:39:25.229115Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning. We were potentially passing a NULL pointer to a routine which
-would unconditionally dereference it. Fixed by taking no action if the pointer is NULL.
+Applied patch to fix &quot;imagen&quot; output device (bug 690561).
 </pre>
-<p>[base/gsgdata.c]</p>
+<p>[base/gdevimgn.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-08T011724.694675Z"></a>
-2010-01-08T01:17:24.694675Z Ray Johnston</strong></p>
+<p><strong><a name="2010-08-01T085915.942136Z"></a>
+2010-08-01T08:59:15.942136Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Add documentation on the limitations of -sstdout=_____ where users expected
-_all_ stdout I/O to be redirected, not just PS writing to stdout. Bug 691037.
+Remove the now redundant --disable-cairo directives.
+
 </pre>
-<p>[doc/Use.htm]</p>
+<p>[toolbin/localcluster/readme toolbin/localcluster/run.pl]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-07T105336.539549Z"></a>
-2010-01-07T10:53:36.539549Z Robin Watts</strong></p>
+<p><strong><a name="2010-07-31T160737.431496Z"></a>
+2010-07-31T16:07:37.431496Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Changes to the MSVC makefiles to prepare for the prototype vs2005 solution
-file. Firstly, we introduce an SBR symbol; if this is set when invoking the
-makefile, we add a new flag to the C compiler (held in SBRFLAGS) to cause
-the generation of the browse data for each source file. Next, we introduce a
-new bsc build target to combine those .sbr files into appropriate .bsc ones.
-The final change is enable debug builds to put their builds into debugobj
-rather than obj directories.
+Remove the &quot;dead&quot; devcairo device.
 
-With luck, this should cause no differences for anyone other than me.
+No cluster differences expected.
 
+Bug 690009
+
 </pre>
-<p>[/trunk/ghostpdl/common/msvc_top.mak /trunk/ghostpdl/language_switch/pspcl6_msvc.mak /trunk/ghostpdl/svg/svg_msvc.mak base/msvccmd.mak /trunk/ghostpdl/xps/xps_msvc.mak psi/msvc32.mak base/msvclib.mak /trunk/ghostpdl/main/pcl6_msvc.mak]</p>
+<p>[ghostscript.vcproj base/configure.ac base/gdevcairo.c base/devs.mak]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-07T103153.862753Z"></a>
-2010-01-07T10:31:53.862753Z Ken Sharp</strong></p>
+<p><strong><a name="2010-07-31T154539.194094Z"></a>
+2010-07-31T15:45:39.194094Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Update the example file. The old file used a single 'charpath pathbbox' to determine the
-height of the text. It then used the 'scale' operator to draw larger text.
+Reapply r11570
 
-If the path was fixed to pixel boundaries, and the point size was low (default 15
-points) this could lead to a small error which was magnified by the cumulative scale
-operations.
+Copying converted samples to the output raster used the byte
+length of the input raster, rather than the byte length of 
+the converted data. Change to use the correct length.
 
-This led to significant differences when using the FreeType font code, as it seems to 
-return a hinted path which is bounded by pixel co-ordinates, unlike the regular GS
-code.
+Bug 691494 - credit to SaGS for the patch.
 
-The altered code scales the font and recalculates the height of the text each time
-giving more accurate results. In addition a minimum size has been introduced (50 points)
-for the calculation of the text height. Together these result in much closer output.
 </pre>
-<p>[examples/alphabet.ps]</p>
+<p>[base/gdevdbit.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-06T111901.103028Z"></a>
-2010-01-06T11:19:01.103028Z Ken Sharp</strong></p>
+<p><strong><a name="2010-07-31T150424.124204Z"></a>
+2010-07-31T15:04:24.124204Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Fix bug #691043 &quot;Vulnerability report : Ghostscript gs_type2_interpret null ptr
-dereference (Segmentation Fault)&quot;. The problem appears to be caused by a corrupt
-compressed data stream which results in garbage font data being sent to the type 2 and
-under some conditions the type 1, font interpreters.
+No need to install Resources and iccprofiles if COMPILE_INITS=1
 
-As noted these font interpreters are normally coded to be intolerant of faults, and
-do not normally perform much error checking. As a result badly formed (or as in this
-case, garbage) fonts can cause serious problems.
+When COMPILE_INITS=1, the mentioned directories are not used and just waste
+disk space and also confusing. Bug 689253.
 
-Although the null dereference is the cause of the error, this is actually caused by
-interpreting the data as a font, and decrementing the font instruction pointer below
-the bottom of the instruction stack. 
+</pre>
+<p>[base/unixinst.mak]</p>
+</blockquote>
 
-The patch here adopts the suggestion from the original bug reporter of checking the
-pointer before the dereference, but in addition adds some checking when the
-instruction pointer is decremented to see that it does not descend past the bottom of
-the stack. This is because tests showed that it was possible to reach this point with
-a non-NULL pointer, which was still invalid and caused a segmentation violation.
+<p><strong><a name="2010-07-31T003707.940018Z"></a>
+2010-07-31T00:37:07.940018Z Ray Johnston</strong></p>
+<blockquote>
+<pre>
+Fix the calculation of the size of the pattern bitmap by correcting the
+calculation of the effective depth (bits per pixel). PaintType 2 is the
+uncolored (mask == 1 bit per pixel) mode, PaintType 1 is colored, thus
+needs the full target device color_info.depth bits per pixel. Bug 691514
+detected running the PDF 1.7 FTS for customer 532.
+</pre>
+<p>[base/gxpcmap.c]</p>
+</blockquote>
 
-In addition the free_glyph routine has been modified to check the pgd (pointer to 
-glyph data) parameter is non-NULL, and that its 'procs' member is non-NULL, before
-attempting to call the free procedure. This fault was exposed by selecting the pdfwrite
-device.
+<p><strong><a name="2010-07-30T231352.534878Z"></a>
+2010-07-30T23:13:52.534878Z Till Kamppeter</strong></p>
+<blockquote>
+<pre>
+Distinguish the two uses of cdev - one from icc merge, one the from very old lpd code (bug 691463).
 
-Although improved this is not a comprehensive fix, there are other locations where the
-font instruction pointer may be incremented past the top, or decremented past the
-bottom, of the instruction stack. However the FreeType font interpreter correctly
-detects the problems without causing a crash, so I don't think we should expend too
-much effort on rewriting our current font code to cope.
+This causes a warning when building with gcc, msvc, and also DEC CC.
+
 </pre>
-<p>[base/gsgdata.c base/gstype1.c base/gstype2.c base/gxtype1.c]</p>
+<p>[base/gdevbbox.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-05T155758.786575Z"></a>
-2010-01-05T15:57:58.786575Z Ken Sharp</strong></p>
+<p><strong><a name="2010-07-30T213419.596701Z"></a>
+2010-07-30T21:34:19.596701Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Revert code introduced in revision 10578. This code is no longer required since the
-test in the FreeType code, which this code evaded, is no longer present when built
-using the incremental interface.
+Removed unneeded &quot;;&quot; characters from C code to silence warnings of DEC CC (bug 691463)
 
 </pre>
-<p>[psi/fapi_ft.c]</p>
+<p>[contrib/gdevbjc_.h base/gxpcolor.h base/strmio.h base/gdevrinkj.c base/gdevbit.c base/gdevpdtf.h base/gsovrc.h]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-05T005207.186738Z"></a>
-2010-01-05T00:52:07.186738Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T203848.303275Z"></a>
+2010-07-30T20:38:48.303275Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Remove duplicate call to errwrite() introduced by the rev. 10568.
-Thanks to Henry for spotting this.
+configure script: Hide error message when &quot;sed&quot; does not have a &quot;--version&quot; option.
 </pre>
-<p>[base/gsmisc.c]</p>
+<p>[base/configure.ac]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-04T150922.066340Z"></a>
-2010-01-04T15:09:22.066340Z Ken Sharp</strong></p>
+<p><strong><a name="2010-07-30T200921.607711Z"></a>
+2010-07-30T20:09:21.607711Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Add a comment to explain the arbitrary choice of value for num_glyphs in revision 10578.
+Tips about cross-compiling 64-bit ghostscript  on 32-bit windows
+
+This procedure is slightly simplier(?) than the cross-compiling instruction
+which Russell removed with r9807 about a year ago. Note that
+ARCH_STRUCT_ALIGN_MOD mentioned in Russell's instruction was removed
+r6773 (in 2006) and note also that all the &quot;genconf&quot; references in r9807
+should be &quot;genarch&quot; instead.
+
 </pre>
-<p>[psi/fapi_ft.c]</p>
+<p>[doc/Make.htm]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-04T092721.029560Z"></a>
-2010-01-04T09:27:21.029560Z Ken Sharp</strong></p>
+<p><strong><a name="2010-07-30T171523.787490Z"></a>
+2010-07-30T17:15:23.787490Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-FreeType interface fix. When using the incremental interface to FreeType (which in fact
-we always use), Ghostscript is responsible for locating and passing the glyph
-description data to FreeType, and so we don't bother to track certain kinds of data
-in the FreeType structure.
+Fix for bug 691488.
 
-However, even when using the incremental interface, FT still tests some of this data, in
-particular it tests the requested glyph index against the reported number of glyphs
-in the font, and aborts if the index is too large.
+This commit fixes the issues that we are seeing with the JPEG2000 images in the FTS files EXCEPT for the issues related to SmaskInData.  Those images will be addressed in a separate commit and will now be handled in bug 691470.  
 
-This patch simply sets the num_glyphs member of the FT_face structure to a large number
-(65534) so that the internal FreeType test is successful, and we don't have to bother
-with the record-keeping that would be required to keep this member updated when fonts
-change.
+With this commit, support is in place for faster 16 bit image rendering due to the improved ICC support, which lets us avoid the multiple conversions from 16 bit to frac to float to unsigned short to byte which occurred in the old flow.  Also, the jasper interface will now, when it encounters a 16 bit or 12 bit image, use the higher bit depth renderer and pass the data along.  Previously, we were truncating to 8bits in our jasper interface.  These changes have been regression tested and checked with bmpcmp.  
+
+
 </pre>
-<p>[psi/fapi_ft.c]</p>
+<p>[base/gxi12bit.c base/lib.mak base/gxi16bit.c Resource/Init/gs_lev2.ps Resource/Init/gs_res.ps base/sjpx.c Resource/Init/pdf_draw.ps base/gximage.h]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-03T010712.832443Z"></a>
-2010-01-03T01:07:12.832443Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T171346.325084Z"></a>
+2010-07-30T17:13:46.325084Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Fix error recovery code that messed up operand stack trying to break out
-of post table processing when the offset to the glyph name is beyond the
-table length. Bug 690837.
-</pre>
-<p>[Resource/Init/gs_ttf.ps]</p>
+Fix for double to float conversion warnings. Bug 691498.  </pre>
+<p>[base/gsicc_create.c]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-02T184840.508429Z"></a>
-2010-01-02T18:48:40.508429Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T170659.251898Z"></a>
+2010-07-30T17:06:59.251898Z Henry Stiles</strong></p>
 <blockquote>
 <pre>
-Remove description of -dIgnoreTTEncoding flag from the documentation.
+rollback to revision 11564, 11565 broke the build</pre>
+<p>[base/gxi12bit.c base/lib.mak base/gxi16bit.c contrib/gdevbjc_.h base/gdevbbox.c base/gxpcolor.h Resource/Init/gs_res.ps Resource/Init/pdf_draw.ps base/gsovrc.h base/gdevpdtf.h base/gsicc_create.c autogen.sh Resource/Init/gs_lev2.ps base/strmio.h base/configure.ac base/gdevrinkj.c base/sjpx.c base/gdevbit.c base/gximage.h base/gdevdbit.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-30T142707.462183Z"></a>
+2010-07-30T14:27:07.462183Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Fix for bug 691488.
+
+This commit fixes the issues that we are seeing with the JPEG2000 images in the FTS files EXCEPT for the issues related to SmaskInData.  Those images will be addressed in a separate commit and will now be handled in bug 691470.  
+
+With this commit, support is in place for faster 16 bit image rendering due to the improved ICC support, which lets us avoid the multiple conversions from 16 bit to frac to float to unsigned short to byte which occurred in the old flow.  Also, the jasper interface will now, when it encounters a 16 bit or 12 bit image, use the higher bit depth renderer and pass the data along.  Previously, we were truncating to 8bits in our jasper interface.  These changes have been regression tested and checked with bmpcmp.  
+
+
 </pre>
-<p>[doc/Use.htm]</p>
+<p>[base/gxi12bit.c base/lib.mak base/gxi16bit.c Resource/Init/gs_lev2.ps Resource/Init/gs_res.ps base/sjpx.c Resource/Init/pdf_draw.ps base/gximage.h]</p>
 </blockquote>
 
-<p><strong><a name="2010-01-02T184515.635704Z"></a>
-2010-01-02T18:45:15.635704Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T140814.058178Z"></a>
+2010-07-30T14:08:14.058178Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Implement symbolic glyph mapping as described in PDF 1.7. Use it for TrueType
-fonts with symbolic flag set or having no encoding entry.
-The flag -dIgnoreTTEncoding is removed because symbolic fonts always do this
-now and non-symbolic fonts should never ignore encoding.
-Bug 691035, customer 220.
+Copying converted samples to the output raster used the byte
+length of the input raster, rather than the byte length of 
+the converted data. Change to use the correct length.
 
-The new spec includes cmap 3,0 in the supported list. We discovered this
-before but didn't use cmap 3,0 as a first choice. PDF 1.7 is not clear about
-the choice between symbolic and non-symbolic branches. Current algorithm
-is based on a few experiments with AR 8.
+Bug 691494 - credit to SaGS for the patch.
 
-The patch causes rendering differences in comparefiles/keyboard.pdf
-A few undefined characters change from boxes to empty space.
-Current rendering of undefined characters in Ghostscript doesn't match
-Adobe Acrobat and should be revised.
 </pre>
-<p>[Resource/Init/pdf_font.ps Resource/Init/gs_ttf.ps]</p>
+<p>[base/gdevdbit.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-30T173030.315764Z"></a>
-2009-12-30T17:30:30.315764Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T135952.334818Z"></a>
+2010-07-30T13:59:52.334818Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Remove C++ comments (//) and commented out code because this is not compatible
-with old compilers and breaks our coding standard. Comments were introduced
-by rev. 9664 and 9778. Bug 691032.
+Fix for double to float conversion warnings. Bug 691498</pre>
+<p>[base/gsicc_create.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-30T113715.489627Z"></a>
+2010-07-30T11:37:15.489627Z Till Kamppeter</strong></p>
+<blockquote>
+<pre>
+Distinguish the two uses of cdev - one from icc merge, one the from very old lpd code (bug 691463).
+
+This causes a warning when building with gcc, msvc, and also DEC CC.
+
 </pre>
-<p>[contrib/gdevcd8.c psi/iscannum.c]</p>
+<p>[base/gdevbbox.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-30T150640.609490Z"></a>
-2009-12-30T15:06:40.609490Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T112007.130600Z"></a>
+2010-07-30T11:20:07.130600Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Add a check whether the entry in post table of TrueType font crosses
-the end of the table. Fill the rest of the table with /.notdef and
-continue. Bug 691031.
+Suppressed error message during ./configure if &quot;sed&quot; does not support &quot;--version&quot; (bug 691463)
 </pre>
-<p>[Resource/Init/gs_ttf.ps]</p>
+<p>[base/configure.ac]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-29T221801.420560Z"></a>
-2009-12-29T22:18:01.420560Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T111617.321612Z"></a>
+2010-07-30T11:16:17.321612Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Use safer function vsnprintf() instead of vsprintf() for error reporting.
-Truncate long messages, issue a warning, and continue. Bug 690829.
+Removed unneeded &quot;;&quot; characters from C code to silence warnings of DEC CC (bug 691463)
 </pre>
-<p>[base/lib.mak base/gsmisc.c base/stdio_.h]</p>
+<p>[contrib/gdevbjc_.h base/gxpcolor.h base/strmio.h base/gdevrinkj.c base/gdevbit.c base/gdevpdtf.h base/gsovrc.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-29T011748.171480Z"></a>
-2009-12-29T01:17:48.171480Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T111247.691429Z"></a>
+2010-07-30T11:12:47.691429Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Remove stage 2 from seticcspace() and a corresponding PS procedure because
-it's no longer needed. Since rev. 10563 the string data source is converted
-to reusable stream without a call-out. Bug 690828.
+Removed unneeded quotes in autogen.sh.
 </pre>
-<p>[psi/zcolor.c Resource/Init/gs_cspace.ps]</p>
+<p>[autogen.sh]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-28T070359.416178Z"></a>
-2009-12-28T07:03:59.416178Z Alex Cherepanov</strong> (<a href="Details.htm#2009-12-28T070359.416178Z">details</a>)</p>
+<p><strong><a name="2010-07-30T111035.977735Z"></a>
+2010-07-30T11:10:35.977735Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Don't use long and buggy call-out process to convert a string to a
-reusable stream. Do it in 3 lines of C code. Bug 690828.
+On Tru64 stdint.h does not exist but the types required by jbig2 are in inttypes.h there (bug 691463).
 
 </pre>
-<p>[psi/zcolor.c psi/zfrsd.c psi/zfrsd.h psi/int.mak]</p>
+<p>[base/configure.ac]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-27T155842.012990Z"></a>
-2009-12-27T15:58:42.012990Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T110327.732163Z"></a>
+2010-07-30T11:03:27.732163Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Assume /FirstChar is 0 and /LastChar is 255 when they are not defined, and
-issue a warning. Bug 691022.
+On Tru64 the integer types are in inttypes.h and not in stdint.h as in VMS
+ 
+Bug 691463, required for jbig2dec.
+
 </pre>
-<p>[Resource/Init/pdf_font.ps]</p>
+<p>[base/stdint_.h jbig2dec/os_types.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-27T153532.126971Z"></a>
-2009-12-27T15:35:32.126971Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T110025.895059Z"></a>
+2010-07-30T11:00:25.895059Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Consider fonts without font stream and with wrong or missing /Subtype
-attribute as Type 1 fonts. Bug 691023.
+Replace &quot;==&quot; bashism by &quot;=&quot; in configure.ac
+
+&quot;==&quot; is a bash extension. See bash's manpage recommending &quot;=&quot; for posix
+compliance (bug 691463). This causes various tests to fail and resulted 
+in the link failure from mis-detecting omni.
+
 </pre>
-<p>[Resource/Init/pdf_font.ps]</p>
+<p>[base/configure.ac]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-26T222145.513158Z"></a>
-2009-12-26T22:21:45.513158Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T105644.338677Z"></a>
+2010-07-30T10:56:44.338677Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Fix a compile error on UN*X platforms introduced by the previous commit
-(rev. 10558).
+'%' in printf() needs to be '%%'
+
+Tru64 C issues a warning (bug 691463).
 </pre>
-<p>[base/gp_psync.c]</p>
+<p>[base/mkromfs.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-26T200544.539107Z"></a>
-2009-12-26T20:05:44.539107Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T105330.576036Z"></a>
+2010-07-30T10:53:30.576036Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning about checking after dereferencing.
-In this case dereferencing means &amp;((foo *)0)-&gt;bar, which is harmless.
+Removed duplicate AC_PATH_PROG(pkg-config) check in ./configure.
+
+The extra check caused
+
+./configure: !: not found
+
+messages on some platforms. Bug 691463.
+
 </pre>
-<p>[base/gp_psync.c]</p>
+<p>[base/configure.ac]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-26T183235.542626Z"></a>
-2009-12-26T18:32:35.542626Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T101447.310782Z"></a>
+2010-07-30T10:14:47.310782Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Move checking gstate for 0 immediately after allocation. Fix a Coverity
-warning about checking after dereferencing.
+Update documentation as --enable-dynamics is no longer required for &quot;make so&quot; to work.
 </pre>
-<p>[base/gsstate.c]</p>
+<p>[doc/Make.htm]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-26T182204.265168Z"></a>
-2009-12-26T18:22:04.265168Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T101041.906626Z"></a>
+2010-07-30T10:10:41.906626Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Don't dereference a pointer before checking it for NULL. Fix a Coverity
-warning about checking after dereferencing.
+Added some missing initializations in DeviceN
+
+This should have been part of the DeviceN change. If left unset,
+the code path assumes color display and goes down the color display
+path and eventually segfaults. Bug 690428.
 </pre>
-<p>[base/gxdhtserial.c]</p>
+<p>[base/gdevxcmp.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-26T013511.234623Z"></a>
-2009-12-26T01:35:11.234623Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T095623.737093Z"></a>
+2010-07-30T09:56:23.737093Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Include stdlib.h for a prototype for abs().
+Fix time-struct related build failure with SunStudio (bug 691453).
+
+Apparently many platforms and compilers, including gcc and intel C,
+require both &lt;sys/time.h&gt; and &lt;time.h&gt;. This patch just adds Sun Pro C
+to the list of such platforms and compilers.
+
 </pre>
-<p>[base/gdevpdtt.c]</p>
+<p>[base/time_.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-26T011312.801372Z"></a>
-2009-12-26T01:13:12.801372Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T094551.500432Z"></a>
+2010-07-30T09:45:51.500432Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Fix a case where a pointer is first dereferenced and then checked for 0.
+Avoid that the x11 output device can create huge windows which crash the X server. Bug 690444.
 </pre>
-<p>[base/ttobjs.c]</p>
+<p>[base/gdevxini.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-26T004830.642019Z"></a>
-2009-12-26T00:48:30.642019Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-30T085817.493418Z"></a>
+2010-07-30T08:58:17.493418Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Clear Coverity warnings about unreachable code. Fix incorrect error
-processing in some contributed drivers. Also remove a spurious *.orig file.
+Assorted fixes for the modularized X11 output device
+
+All object files destined for shared libraries needed to be compiled
+with -fPIC but this is not the case for gsparamx.c, gdevemap.c, and
+gdevxcmp.c which are required by other parts to be built as standard.
+
+This change makes x11 not depend on gsparamx.c and gdevemap.c (and not
+geeting them included in the shared library X11.so). gsparamx.c is
+part of psdf and is usually included and available, and gdevemap.c is
+small enough to be inserted completely where it is used.
+
+gdevxcmp.c is addressed by building it with $(GLCCSHARED) and not with
+$(GLCC).
+
+In addition, $(CC_SHARED) is only used for object files, rather than
+for linking, so DYNAMIC_CFLAGS is more appropiate here than
+DYNAMIC_LDLAGS.
+
+Bug 691510
+
 </pre>
-<p>[contrib/lips4/gdevl4v.c.orig contrib/lips4/gdevl4v.c contrib/eplaser/gdevescv.c contrib/lips4/gdevl4r.c]</p>
+<p>[base/gdevxxf.c base/Makefile.in base/devs.mak]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-24T003305.486056Z"></a>
-2009-12-24T00:33:05.486056Z Ray Johnston</strong></p>
+<p><strong><a name="2010-07-29T182806.621749Z"></a>
+2010-07-29T18:28:06.621749Z Ray Johnston</strong></p>
 <blockquote>
 <pre>
-Fix detection for nearing/passing command list buffer limit to allow for
-the condition when the pointer is past the limit (which is NOT the end
-of the buffer, but is only a warning). Change this variable name to
-'warn_limit' to avoid confusion with the 'limit' used in most other
-buffer management areas, such as streams. Bug 691016.
+Add a comment recommending -sstdout=%stderr with -sOutputFile=- to prevent
+PostScript files that print from messing up the output. Bug 691507.
 </pre>
-<p>[base/gxclrast.c]</p>
+<p>[doc/Use.htm]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-23T211234.206998Z"></a>
-2009-12-23T21:12:34.206998Z Robin Watts</strong></p>
+<p><strong><a name="2010-07-29T142919.627579Z"></a>
+2010-07-29T14:29:19.627579Z Robin Watts</strong></p>
 <blockquote>
 <pre>
-Add new assert_.h header file. Convert existing code to use it.
+Remove unused variable left over from removal of pattern_cache_alt.
 
+No expected changes.
+
 </pre>
-<p>[contrib/gdevcd8.c /trunk/ghostpdl/pl/pldebug.h base/assert_.h contrib/pcl3/eprn/mediasize.c contrib/lips4/gdevlprn.h contrib/pcl3/eprn/eprnrend.c]</p>
+<p>[base/gsstate.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-22T233230.888745Z"></a>
-2009-12-22T23:32:30.888745Z regression</strong></p>
+<p><strong><a name="2010-07-29T140539.594612Z"></a>
+2010-07-29T14:05:39.594612Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Remove -dNOOUTERSAVE and related commands from command line and optionally
-read in list of fast to process files (so that long commands can be
-processed first).
+Fix (pdfwrite) : try not to write out invalid xref
 
+Exposed by bug #691503. There are circumstances under which we create a reference to a
+/Page object which does not yet exist (creating an outline tree for example). In this
+case we create a reference to the page, and set its initial offset to the current 
+position in the PDF file. When we later write the real object we update the position
+to reflect the point in the file where it is actually stored.
+
+However, if we don't actually ever write the object (in the case above, because
+LastPage is set before the destination page), then the object remains pointing to the
+wrong location in the file. This is then written into the xref table, and this confuses
+the current version of Ghostscript.
+
+The patch creates new pages with an offset of 0 (which is always invalid because the 
+PDF header means the minimum offset for any object is 15). If the page is later
+created then the offset gets updated. If it is not written, however, we now check in 
+the xref writing code to see if an object has an offset of 0. If it does, then we
+break the xref table up and do not write an xref entry for the missing object.
+
+Ghostscript is happy with this and processes the file.
+
+NB the proper fix is to not emit the Outline entry for the page which will not be
+present in the output, and a patch has been suggested to achieve this. This code has
+some uses, however, as it may prevent this kind of problem in the future. It also
+permits objects to be created and never referenced (presumably because they are never
+used) without leaving invalid entries in the xref, which might be useful.
+
+No expected differences.
 </pre>
-<p>[toolbin/localcluster/build.pl]</p>
+<p>[base/gdevpdf.c base/gdevpdfu.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-21T160338.968428Z"></a>
-2009-12-21T16:03:38.968428Z Ken Sharp</strong></p>
+<p><strong><a name="2010-07-29T135953.090810Z"></a>
+2010-07-29T13:59:53.090810Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Fix (pdfwrite) Bug #691009 &quot;Regression: 14-01.PS fails with pdfwrite&quot;. revision 10297,
-a fix for pdfwrite involving composite fonts with type 3 descendants, did not check a
-return value. This could cause a segment fault later, if a type 0 font was invalid.
+Two changes for two primarily pdfwrite problems with FAPI/FT.
 
-The Genoa file 14-01.ps specifically runs tests with invalid type 0 fonts to check the
-behaviour under error conditions and appears to be the only test file we have which
-does this.
+The first is to only replace whichever of BuildGlyph or BuildChar
+procedures the original font actually contained, replacing both
+regardless confused some of &quot;decoding&quot; code elsewhere in GS
+(op_show_continue_dispatch()) and we ended up receiving a valid
+glyph to render instead of notdef. In this case we ended up incorrectly
+stroking a charpath (this was seen with Quark's Type 3 &quot;special effects&quot;
+font). With rendering output this resulted in a boldening effect on the glyph,
+in pdfwrite, the result was strange extra lines through the glyph.
+
+The second change is to due pdfwrite's use of a unit matrix for some of
+its work. This resulted in small glyph metrics rounding to zero within
+Freetype, and pdfwrite thinking a glyph had a width of zero. So make
+the scale value at which we consider a glyph to be &quot;small&quot; an order of magnitude
+larger, which gets compensated for in the calculation of Freetype's final
+matrix.
+
+Unfortunately this does cause ~2600 differences in the cluster tests: some
+are progressions, most are pixel differences due to rounding differences
+because the scaling numbers have changed in Freetype.
+
+Fixes Bug 691383
+
 </pre>
-<p>[base/gdevpdtt.c]</p>
+<p>[psi/fapi_ft.c psi/zfapi.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-21T072023.809940Z"></a>
-2009-12-21T07:20:23.809940Z Ralph Giles</strong></p>
+<p><strong><a name="2010-07-28T184446.282683Z"></a>
+2010-07-28T18:44:46.282683Z Robin Watts</strong></p>
 <blockquote>
 <pre>
-Revert c10520 which causes problems with the MSVC build.
+Fix bug #691493. Revert some of the work done for gs_2_colors.
 
-$(CC_) enforces 'ansi' C under msvc32.mak, disabling any Microsoft
-extensions. This often causes problems with 3rd party libraries
-which try to take advantage of those extensions.
+I had needlessly attempted to have 2 pattern_cache's, one for stroking
+colors and one for non-stroking colors. Given that the pattern_cache is
+indexed by color id number, this is not necessary as all the data can
+live happily in just one instance.
 
-This means that the -fPIC flag is again not propagated in the GCC
-build; this is just to unbreak the build until I can test a different
-solution which works on both platforms.
+This removes the problem seen in the bug (where it was getting into an
+infinite loop trying to populate the cache).
+
+Local cluster testing shows this produces 57 differences, all (I think)
+non-determinisms.
+
+
 </pre>
-<p>[base/libtiff.mak]</p>
+<p>[base/gsstate.c base/gxistate.h base/gsistate.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-20T195400.274659Z"></a>
-2009-12-20T19:54:00.274659Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-28T123751.588339Z"></a>
+2010-07-28T12:37:51.588339Z Till Kamppeter</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning: comparing array against NULL is not useful.
+CUPS Raster output device &quot;cups&quot;: Improved support for rendering jobs with high memory demands.
+
+Let Ghostscript determine the memory buffer sizes automatically (as it
+does with all the other output devices) if the environment variable
+RIP_MAX_CACHE is not set, zero, or does not begin with a number (like
+&quot;auto&quot;). If RIP_MAX_CACHE defines a valid value, use the actual value
+for BufferSpace and not 1/10 of it. MaxBitmap is the maximum buffer
+size to be used when rendering in full page mode, BufferSpace is the
+buffer size used in banding mode. Banding mode is used if MaxBitmap is
+too small to hold one page. Bug 691499.
+
 </pre>
-<p>[base/gxclthrd.c]</p>
+<p>[cups/gdevcups.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-20T194310.432199Z"></a>
-2009-12-20T19:43:10.432199Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-28T092249.016213Z"></a>
+2010-07-28T09:22:49.016213Z Robin Watts</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning about an expression with undefined order of evaluation.
+Add new gp_thread_start, gp_thread_finish abstraction, and deprecate old
+gs_create_thread function. Adapt multiple rendering thread code to use
+this new style instead. Hopefully this should solve the problems seen
+in rare cases when a test thread doesn't get scheduled until after the
+DLL has exited and the code isn't around any more.
+
+No expected differences.
+
+This code has been tested with MSVC and on linux with pthreads. While it
+should work with Borland and Watcom (as all the headers appear consistent)
+I have not been able to properly test it. Therefore the code is currently
+configured to fall back to the old code, thus hopefully guaranteeing that
+this commit won't make the operation under Borland/Watcom any worse than
+it is now. This fallback is controlled by a single define for each of
+these systems in gp_wsync.c, so it's easy to test. If users can report
+success with the new code we can remove the fallback trivially.
+
+
 </pre>
-<p>[contrib/gdevbjca.c]</p>
+<p>[base/gp_wsync.c base/gxclthrd.c base/gp_nsync.c base/gp_psync.c base/gxclthrd.h base/gpsync.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-20T185408.195262Z"></a>
-2009-12-20T18:54:08.195262Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-28T073652.403693Z"></a>
+2010-07-28T07:36:52.403693Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning about an expression with undefined order of evaluation.
+As pointed out by SaGS in Bug #691440, comment 5(C) there was a typo in revision 11498,
+a '&gt;&gt;' was accidentally dropped form the batch file.
 </pre>
-<p>[contrib/pcl3/eprn/eprnrend.c]</p>
+<p>[lib/ps2pdf.bat]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-20T142439.934442Z"></a>
-2009-12-20T14:24:39.934442Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-27T071003.221027Z"></a>
+2010-07-27T07:10:03.221027Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Fix Coverity warnings about unchecked return code.
+Add missing free of the new bitmap data.
 </pre>
-<p>[base/gxchar.c]</p>
+<p>[psi/zfapi.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-20T065250.539169Z"></a>
-2009-12-20T06:52:50.539169Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-27T070247.392994Z"></a>
+2010-07-27T07:02:47.392994Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Fix Coverity warnings about unchecked return code.
+Slightly revise comment for why we might need to create a new bitmap
+in fapi_finish_render_aux()
+
+No cluster differences expected.
+
 </pre>
-<p>[base/gsptype1.c]</p>
+<p>[psi/zfapi.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-19T171409.025653Z"></a>
-2009-12-19T17:14:09.025653Z regression</strong></p>
+<p><strong><a name="2010-07-26T084833.786696Z"></a>
+2010-07-26T08:48:33.786696Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Minor improvements:
+A much better solution for Bug 691328.
 
-skip.lst is now processed by compare.pl instead of build.pl, so tests
-to be skipped will be run, just not reported.
+The bitmap data coming from a font scaler/renderer may not have its raster
+alignment as Ghostscript expects, so in the event that is the case, create
+a bitmap which is GS compatible in the FAPI layer, before calling any
+further operations on it.
 
-Store the archive count in the md5sum.archive so the report email will
-be accurate.
+This reverts the previous &quot;hack&quot; from r11362.
 
-Treat indeterminate errors (mostly timeouts) the same as indeterminate
-md5sums (i.e. report them below the fold).
+No cluster differences expected.
 
 </pre>
-<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/build.pl toolbin/localcluster/cachearchive.pl toolbin/localcluster/compare.pl]</p>
+<p>[base/gsbitops.c psi/zfapi.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-19T011649.970378Z"></a>
-2009-12-19T01:16:49.970378Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-24T225746.607791Z"></a>
+2010-07-24T22:57:46.607791Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Fix an array overrun in zsethalftone5() caused by an unchecked error code
-when the number of colorants exceeds the current implementation limit;
-throw a /limitcheck error instead. Also fix an unrelated Coverity warning
-about unchecked return value from dict_int_param(). Bug 691001.
+Render 3D annotations (using appearance stream) on the printer device even
+if Print flag (0x4) is not set. This is done following AR8 and AR9 example
+but contrary to PDF 1.7 spec. Bug 691486, customer 532.
 </pre>
-<p>[psi/zht2.c]</p>
+<p>[Resource/Init/pdf_draw.ps]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-18T222419.154314Z"></a>
-2009-12-18T22:24:19.154314Z Ralph Giles</strong></p>
+<p><strong><a name="2010-07-23T200128.232264Z"></a>
+2010-07-23T20:01:28.232264Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Update some obsolete gs_throw() calls. Bug 691010.
+Make *clean targets remove generated tif*.h files. Bug 691485.
+</pre>
+<p>[base/gs.mak]</p>
+</blockquote>
 
-This code seemed to be using an early version of the gs_throw() error
-reporting macros, passing an undefined -997 error code, a redundant
-__func__ error message, and expecting the macro to break flow control.
+<p><strong><a name="2010-07-23T190145.196186Z"></a>
+2010-07-23T19:01:45.196186Z Alex Cherepanov</strong></p>
+<blockquote>
+<pre>
+Remove .dividesfnts procedure, which is not needed by PS interpreter after
+the introduction and use of string_array_access_proc() way back in
+revision 176. FreeType doesn't require a particular way to split sfnts
+either. ps2write includes procedures to create a well formed Type 42 from
+a TrueType font.
 
-This commit updates it to the modern version's behaviour.</pre>
-<p>[base/gdevdbit.c]</p>
+The error is caused by .dividesfnts only spliting strings when the split
+offset is even. The sample file has a *long* run of cases where the split
+offsets are odd. When an even offset is finally found, the number of buffered
+bytes exceeds the maximum length of the string causing /rangecheck error.
+Thanks to Chris Liddell for the analysis of the problem.
+Bug 691473, customer 532.
+</pre>
+<p>[Resource/Init/gs_ttf.ps]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-18T211417.100541Z"></a>
-2009-12-18T21:14:17.100541Z Ralph Giles</strong></p>
+<p><strong><a name="2010-07-23T092028.484085Z"></a>
+2010-07-23T09:20:28.484085Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Add a missing header to ensure delaration and definition match
-for mem_mono_strip_copy_rop(). Fixes a warning in the gcc build.</pre>
-<p>[base/lib.mak base/gdevmr1.c]</p>
+Commit the correct change for Bug 691427
+	
+
+
+</pre>
+<p>[base/lib.mak]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-18T183246.014514Z"></a>
-2009-12-18T18:32:46.014514Z Ralph Giles</strong></p>
+<p><strong><a name="2010-07-23T082243.299979Z"></a>
+2010-07-23T08:22:43.299979Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Add .libs and autom4te.cache to the exclude list for clusterpush.
+Change the gsicc* targets from using GCFLAGS to CFLAGS. This ensure that the
+options for building .so objects are correct.
 
-Builds which generate .deps directories also generally create the
-other two. The autom4te.cache files aren't necessarily large but
-aren't appropriate to copy to another system since they represent
-details of the local build environment.
+Additionally, add the extra dependencies to the sodebug target so it works
+correctly.
+
+No cluster differences expected.
+
+Bug 691427
+
 </pre>
-<p>[toolbin/localcluster/clusterpush.pl]</p>
+<p>[base/lib.mak base/unix-dll.mak]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-18T162412.002354Z"></a>
-2009-12-18T16:24:12.002354Z Marcos H. Woehrmann</strong></p>
+<p><strong><a name="2010-07-23T025737.996803Z"></a>
+2010-07-23T02:57:37.996803Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Added .deps to the exclude list for clusterpush.pl.
+Handle the case when, contrary to the spec, default viewing optional content
+configuration dictionary has /BaseState attribute equal /OFF. Mark all OCGs
+/OFF and unmark ON UCGs. Bug 691491, customer 532.
 </pre>
-<p>[toolbin/localcluster/clusterpush.pl]</p>
+<p>[Resource/Init/pdf_main.ps]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-18T070410.684226Z"></a>
-2009-12-18T07:04:10.684226Z Ralph Giles</strong></p>
+<p><strong><a name="2010-07-21T192614.458296Z"></a>
+2010-07-21T19:26:14.458296Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Add graphics library support for raster operations and extended halftone
-methods to the default gcc build.
+Fix for bug 691478
 
-This allows ghostpcl to build linked against the default 'so' build of
-the gs library. On my Linux x86_64 this increases the size of the library
-by 29K. While significant, I prefer this to the maintenance burden of
-the two different configurations. 
+Note that string objects that are maintained as user params must be either allocated in non-gc memory or be a constant in the executable. The problem stems from the way userparams are retained during garbage collection in a param_list (collected by currentuserparams).  For some reason this param_list does not get the pointers to strings relocated during the GC. Note that the param_dict itself is correctly updated by reloc, it is just the pointers to the strings in the param_list that are not traced and updated. In this particular case, ICCProfilesDir sets a string in the icc_manager. When a reclaim occurs, the string is relocated (when in non-gc memory and when it is noted to the gc with the proper object descriptor).  Then if a set_icc_directory occurs, the user params pointer has NOT been updated and validation problems will occur.  Fix for this was to make the string not known to the GC and to allocate in non-gc memory.  When icc manager is deallocated, the string is also deallocated.</pre>
+<p>[base/gsicc_manage.c psi/zusparam.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-21T000316.900862Z"></a>
+2010-07-21T00:03:16.900862Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Fix so that non-isolated transparency groups are rendered correctly.  This fixes a rendering issue with fts_25_2524 and with a few in the test suite.  A future optimization will be to avoid the extra buffer push if the blend mode is normal, since in that case we can draw directly into the parent buffer.</pre>
+<p>[base/gdevp14.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-20T094634.095118Z"></a>
+2010-07-20T09:46:34.095118Z Masaki Ushizaka</strong></p>
+<blockquote>
+<pre>
+Add support for user defined huffman table.
+
+This code adds support for segment type 53 segments, which supplies
+inline huffman code table.  Bug 689853.
+
+Many thanks to Justin Greer.
+
+
 </pre>
-<p>[base/Makefile.in]</p>
+<p>[jbig2dec/jbig2_segment.c jbig2dec/jbig2_huffman.c jbig2dec/jbig2_text.c jbig2dec/jbig2_symbol_dict.c jbig2dec/jbig2_huffman.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-18T063702.606724Z"></a>
-2009-12-18T06:37:02.606724Z Ralph Giles</strong></p>
+<p><strong><a name="2010-07-20T082305.218485Z"></a>
+2010-07-20T08:23:05.218485Z Masaki Ushizaka</strong></p>
 <blockquote>
 <pre>
-Derive the libtiff compiler line from $(CC_) instead of $(CC) so
-the common flag set is propagated.
+Catching up to the latest jbig2dec source.
 
-Without this, additional options, like XCFLAGS=-fPIC aren't used when
-compiling the libtiff source files.
+This includes following jbig2dec git commits:
+
+commit d26c7e4f39f76fe70cc61d6dc14d05a042a9be48
+Author: Masaki Ushizaka &lt;masaki at ghostscript.com&gt;
+Date:   Tue Jul 20 08:01:29 2010 +0000
+
+    Fix jbig2_image_set_pixel function prototype
+    
+    The declaration of jbig2_image_set_pixel was differenct between
+    jbig2_image.h and jbig2_image.c (int value vs bool value).  And
+    prevented compiling it by MSVC comiler in C++ mode.
+    This patch fixes it.  Bug #691461.
+
+commit c5d61c78c0de785b74b86d4e5298e3cc7b9e2b68
+Author: Masaki Ushizaka &lt;masaki at ghostscript.com&gt;
+Date:   Fri Jul 16 09:13:41 2010 +0000
+
+    A little fix to allocating memory size
+
+commit e12fa07da845515911db8be2f7cfa8ef551061ba
+Author: Tor Andersson &lt;tor.andersson at gmail.com&gt;
+Date:   Thu Jul 15 00:49:09 2010 +0200
+
+    Use the jbig2_new and jbig2_renew macros instead of calling
+    jbig2_alloc and jbig2_realloc directly. Also adds a few typecasts
+    and #defines required to compile the source as C++.
+
+commit 31dd7ef66dbd1c34df08365aa3c36e6391617f37
+Author: Tor Andersson &lt;tor.andersson at gmail.com&gt;
+Date:   Thu Jul 15 00:42:38 2010 +0200
+
+    Update VERSION define in config_win32.h
+
+commit 941b73315a166fe07e0f1a1b81171477285280f7
+Author: Tor Andersson &lt;tor.andersson at gmail.com&gt;
+Date:   Thu Jul 15 00:41:46 2010 +0200
+
+    Add Makefile.unix -- a simple makefile for unix-like systems.
+
+commit f6066822041bbffd7169fd4bfc19c48daae8f155
+Author: Tor Andersson &lt;tor.andersson at gmail.com&gt;
+Date:   Thu Jul 15 00:35:58 2010 +0200
+
+    Fix memory leak of the word stream struct.
+
+
+No visible difference expected.
+
+
+
+
 </pre>
-<p>[base/libtiff.mak]</p>
+<p>[jbig2dec/config_win32.h jbig2dec/jbig2.c jbig2dec/jbig2_image_pbm.c jbig2dec/jbig2_metadata.c jbig2dec/jbig2_image.c jbig2dec/jbig2_huffman.c jbig2dec/jbig2_text.c jbig2dec/jbig2_priv.h jbig2dec/jbig2_image.h jbig2dec/jbig2_refinement.c jbig2dec/jbig2dec.c jbig2dec/jbig2_arith_iaid.c jbig2dec/jbig2_halftone.c jbig2dec/Makefile.unix jbig2dec/jbig2_segment.c jbig2dec/jbig2_arith.c jbig2dec/jbig2_symbol_dict.c jbig2dec/jbig2_generic.c jbig2dec/jbig2_page.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-18T052314.353404Z"></a>
-2009-12-18T05:23:14.353404Z Henry Stiles</strong></p>
+<p><strong><a name="2010-07-20T055604.938511Z"></a>
+2010-07-20T05:56:04.938511Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Export the the type 42 component parser procedure for pcl, no expected
-differences.
+Remove noisy warnings if embedded icc profile is not valid.  In those cases, we use the default and move on.  </pre>
+<p>[psi/zicc.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-19T212235.957060Z"></a>
+2010-07-19T21:22:35.957060Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Fix for Bug691474.  Source of error was due to icc hash code being read from clist after the transfer function.  It should have been read prior to the transfer function.  This was the first file we have seen that had a soft mask with a transfer function.  Also fix for rendering of this file.  The softmasks only uses the alpha channel as opposed to the luminosity of the object.  Progression with CityMap-evnice.pdf in test suite.  That file must have a alpha style softmask.</pre>
+<p>[base/gdevp14.c base/gstparam.h]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-19T154536.535276Z"></a>
+2010-07-19T15:45:36.535276Z Chris Liddell</strong></p>
+<blockquote>
+<pre>
+
+Update trunk to FreeType 2.4.1
+
+The important change (from Ghostscript's point of view) is that the previously
+patented TrueType hinting operations have been enabled by default after the
+expiration of the patents in question.
+
+This change (the hinting being enabled) causes 3060 non-pdfwrite cluster
+changes, and 655 pdfwrite changes - these are expected, and are
+progressions.
+
 </pre>
-<p>[base/gxfont42.h base/gstype42.c]</p>
+<p>[freetype/builds/unix/config.sub freetype/src/pshinter/pshglob.c freetype/src/base/ftpfr.c freetype/src/pshinter/pshglob.h freetype/src/type1/t1objs.c freetype/docs/DEBUG freetype/builds/win32/w32-dev.mk freetype/src/type1/t1objs.h freetype/docs/reference/ft2-gasp_table.html freetype/src/pshinter freetype/docs/INSTALL.CROSS freetype/src freetype/docs/reference/ft2-lcd_filtering.html freetype/src/truetype/ttgload.c freetype/builds/win32/win32-def.mk freetype/src/type1 freetype/builds/wince/vc2005-ce freetype/src/truetype/ttgload.h freetype/src/tools/ftrandom/ftrandom.c freetype/devel/ft2build.h freetype/src/tools/docmaker/formatter.py freetype/src/autofit/Jamfile freetype/src/bdf/module.mk freetype/docs/reference/ft2-glyph_stroker.html freetype/include/freetype/config/ftheader.h freetype/src/cff/Jamfile freetype/src/cff/cffparse.c freetype/src/raster/ftraster.c freetype/src/cff/cffparse.h freetype/src/cff/cffcmap.c freetype/src/raster/ftraster.h freetype/src/cff/cffcmap.h freetype/src/raster/ftrend1.c freetype/include/freetype/internal/services/svttglyf.h freetype/builds/wince/vc2005-ce/freetype.vcproj freetype/src/raster/ftrend1.h freetype/docs/INSTALL.ANY freetype/src/psnames/module.mk freetype/src/base/ftutil.c freetype/src/autofit/afglobal.c freetype/src/cache/ftcsbits.c freetype/builds/mac/ftmac.c freetype/src/autofit/afglobal.h freetype/src/pcf/rules.mk freetype/src/base/ftsystem.c freetype/src/cache/ftcsbits.h freetype/builds/amiga/include/freetype freetype/builds/mac/FreeType.m68k_cfm.make.txt freetype/src/psaux/psaux.c freetype/builds/ansi freetype/src/cff/module.mk freetype/src/pshinter/rules.mk freetype/src/pcf/pcfread.c freetype/src/bdf/bdflib.c freetype/docs/reference/ft2-list_processing.html freetype/include/freetype/ftcache.h freetype/src/pcf/pcfread.h freetype/builds/unix/ft2unix.h freetype/src/raster/Jamfile freetype/builds/atari/FREETYPE.PRJ freetype/src/gzip/rules.mk freetype/src/pshinter/pshalgo.c freetype/include/freetype/internal/services/svcid.h freetype/include/freetype/ftincrem.h freetype/src/lzw freetype/builds/compiler/bcc-dev.mk freetype/src/pshinter/pshalgo.h freetype/src/tools/test_afm.c freetype/src/psnames/psnamerr.h freetype/src/cache/ftccache.c freetype/src/cache/ftcmru.c freetype/include/freetype/config/ftstdlib.h freetype/src/cid/cidtoken.h freetype/vms_make.com freetype/include/freetype/freetype.h freetype/docs/INSTALL.UNIX freetype/src/cache/ftccache.h freetype/src/cache/ftcmru.h freetype/src/tools/cordic.py freetype/src/pfr/Jamfile freetype/src/pfr/pfrload.c freetype/src/pfr/pfr.c freetype/builds/amiga/src freetype/src/pfr/pfrload.h freetype/include/freetype/fterrdef.h freetype/builds/detect.mk freetype/src/tools/ftrandom freetype/docs/reference/ft2-cache_subsystem.html freetype/builds/win32/vc2005 freetype/src/type1/t1gload.c freetype/builds/win32/vc2008 freetype/src/base/ftbbox.c freetype/builds/dos freetype/src/otvalid/otvgdef.c freetype/src/type1/t1gload.h freetype/include/freetype/ftsystem.h freetype/docs/reference/ft2-glyph_variants.html freetype/src/bdf/bdferror.h freetype/builds/unix/aclocal.m4 freetype/src/gxvalid/rules.mk freetype/docs/reference/ft2-bdf_fonts.html freetype/src/pcf/pcf.c freetype/src/otvalid/rules.mk freetype/include/freetype/internal/services/svotval.h freetype/src/bdf/Jamfile freetype/src/gxvalid/gxvbsln.c freetype/src/pfr/pfrdrivr.c freetype/src/pcf/pcf.h freetype/builds/compiler/win-lcc.mk freetype/src/type1/Jamfile freetype/src/pfr/pfrdrivr.h freetype/src/pcf/pcferror.h freetype/src/sfnt/ttsbit0.c freetype/src/base/ftmac.c freetype/builds/mac/FreeType.ppc_classic.make.txt freetype/src/base/ftgloadr.c freetype/src/base/ftbase.c freetype/docs freetype/builds/win32/vc2005/freetype.vcproj freetype/docs/reference/.gitignore freetype/src/base/ftbase.h freetype/builds/compiler freetype/src/gxvalid/gxvmort0.c freetype/src/bdf/bdf.c freetype/builds/amiga/src/base/ftsystem.c freetype/src/bdf/bdf.h freetype/src/cff/cff.c freetype/src/gxvalid/gxvalid.c freetype/builds/win32/w32-lcc.mk freetype/include/freetype/internal/services freetype/include/freetype/internal/psaux.h freetype/src/gxvalid/gxvalid.h freetype/autogen.sh freetype/src/base/fttype1.c freetype/docs/reference/ft2-type1_tables.html freetype/src/autofit/afmodule.c freetype/builds/unix/detect.mk freetype/include freetype/src/autofit/afmodule.h freetype/builds/vms freetype/src/pfr/pfrcmap.c freetype/objs/README freetype/builds/dos/dos-wat.mk freetype/builds/exports.mk freetype/src/pfr/pfrcmap.h freetype/src/psaux/Jamfile freetype/src/cff/cffpic.c freetype/builds/amiga/smakefile freetype/src/base/ftdebug.c freetype/src/gzip/inflate.c freetype/src/cff/cffpic.h freetype/src/type1/t1driver.c freetype/src/otvalid/otvbase.c freetype/include/freetype/ftmoderr.h freetype/src/gxvalid/gxvopbd.c freetype/src/type1/t1driver.h freetype/builds/win32/vc2005/freetype.sln freetype/builds/mac freetype/builds/atari freetype/builds/compiler/visualage.mk freetype/builds/newline freetype/builds/vms/ftsystem.c freetype/src/base/basepic.c freetype/src/type1/t1parse.c freetype/src/otvalid/otvmath.c freetype/src/gxvalid/gxvmort1.c freetype/src/base/basepic.h freetype/src/psnames/rules.mk freetype/src/type1/t1parse.h freetype/docs/reference/ft2-winfnt_fonts.html freetype/src/pcf/Jamfile freetype/src/gzip/Jamfile freetype/src/base/ftbdf.c freetype/builds/mac/ascii2mpw.py freetype/builds/unix/.gitignore freetype/src/raster/module.mk freetype/src/type1/t1afm.c freetype/src/cid/cidobjs.c freetype/include/ft2build.h freetype/include/freetype/internal/services/svgxval.h freetype/include/freetype/internal/ftrfork.h freetype/builds/win32/ftdebug.c freetype/src/tools freetype/src/type1/t1afm.h freetype/src/type1/t1tokens.h freetype/src/pshinter/pshrec.c freetype/src/cid/cidobjs.h freetype/builds/dos/dos-emx.mk freetype/src/pshinter/pshrec.h freetype/src/autofit/autofit.c freetype/builds/win32/w32-wat.mk freetype/builds/wince/vc2008-ce freetype/src/truetype/ttobjs.c freetype/include/freetype/ftchapters.h freetype/src/type1/t1errors.h freetype/include/freetype/ftlzw.h freetype/src/otvalid/otvgsub.c freetype/src/truetype/ttobjs.h freetype/src/tools/apinames.c freetype/src/winfonts/fnterrs.h freetype/src/cache/ftcache.c freetype/builds/win32/visualc/freetype.sln freetype/include/freetype/ftglyph.h freetype/docs/reference/ft2-gx_validation.html freetype/builds/vms/ftconfig.h freetype/builds/win32/vc2005/index.html freetype/builds/unix/unixddef.mk freetype/src/raster/rasterrs.h freetype/src/autofit/aflatin2.c freetype/builds/dos/detect.mk freetype/src/type42/Jamfile freetype/src/base/ftpic.c freetype/builds/wince freetype/src/autofit/aflatin2.h freetype/builds/win32/w32-mingw32.mk freetype/include/freetype/fttypes.h freetype/src/cache/ftcglyph.c freetype/src/gxvalid/gxvmort2.c freetype/builds/link_std.mk freetype/src/cache/ftcglyph.h freetype/src/pshinter/pshinter.c freetype/src/cache/Jamfile freetype/src/tools/test_bbox.c freetype/include/freetype/internal/services/svpsinfo.h freetype/src/type42/t42types.h freetype/builds/os2/os2-dev.mk freetype/builds/mac/ftlib.prj.xml freetype/src/gxvalid/gxvmort.c freetype/src/raster/rastpic.c freetype/builds/win32/vc2008/index.html freetype/src/gxvalid/gxvmort.h freetype/src/gxvalid/README freetype/src/raster/rastpic.h freetype/src/tools/docmaker/docbeauty.py freetype/builds/amiga/include freetype/docs/reference/ft2-incremental.html freetype/src/gzip/ftgzip.c freetype/include/freetype/ftcid.h freetype/include/freetype/internal/services/svpfr.h freetype/builds/compiler/watcom.mk freetype/builds/dos/dos-gcc.mk freetype/src/sfnt/module.mk freetype/src/psnames freetype/docs/INSTALL freetype/src/type1/t1load.c freetype/src/gzip/inftrees.c freetype/src/gzip freetype/builds/amiga/src/base/ftdebug.c freetype/docs/INSTALL.VMS freetype/src/type1/t1load.h freetype/src/gzip/inftrees.h freetype/src/pfr/pfrsbit.c freetype/src/gxvalid/gxvfeat.c freetype/src/cff/cfftoken.h freetype/include/freetype/internal/ftgloadr.h freetype/docs/PROBLEMS freetype/builds/wince/vc2008-ce/freetype.sln freetype/src/pfr/pfrsbit.h freetype/src/truetype/Jamfile freetype/src/gxvalid/gxvfeat.h freetype/builds/unix/configure freetype/docs/reference/ft2-basic_types.html freetype/src/otvalid freetype/src/gxvalid/gxvkern.c freetype/docs/INSTALL.MAC freetype/src/cid/Jamfile freetype/include/freetype/ftmm.h freetype/builds/symbian/freetype.mmp freetype/src/base/ftglyph.c freetype/src/sfnt freetype/src/otvalid/otverror.h freetype/docs/UPGRADE.UNIX freetype/src/autofit/afcjk.c freetype/src/autofit/aftypes.h freetype/src/sfnt/sfdriver.c freetype/src/psaux/afmparse.c freetype/src/autofit/afcjk.h freetype/src/sfnt/sfobjs.c freetype/src/base/ftobjs.c freetype/src/sfnt/sfdriver.h freetype/src/psaux/afmparse.h freetype/src/sfnt/sfobjs.h freetype/src/pfr/rules.mk freetype/docs/reference/ft2-sfnt_names.html freetype/builds/win32/visualc/freetype.vcproj freetype/builds/atari/deflinejoiner.awk freetype/src/psaux/module.mk freetype/src/base/ftstroke.c freetype/src/base/ftfstype.c freetype/docs/GPL.TXT freetype/src/base/ftbitmap.c freetype/src/pshinter/pshpic.c freetype/src/winfonts freetype/builds/dos/dos-def.mk freetype/src/pshinter/pshpic.h freetype/builds/win32/w32-gcc.mk freetype/src/psnames/pstables.h freetype/src/sfnt/rules.mk freetype/builds/wince/vc2005-ce/index.html freetype/src/autofit/afpic.c freetype/docs/raster.txt freetype/builds/atari/FNames.SIC freetype/builds/atari/ATARI.H freetype/src/autofit/afpic.h freetype/src/otvalid/otvgpos.c freetype/docs/reference/ft2-multiple_masters.html freetype/src/cff/cffdrivr.c freetype/docs/reference/ft2-base_interface.html freetype/src/cid/cidriver.c freetype/builds/mac/README freetype/src/otvalid/otvgpos.h freetype/include/freetype/ftgasp.h freetype/builds/unix/unix-cc.in freetype/src/autofit/afindic.c freetype/src/cff/cffdrivr.h freetype/src/cid/cidriver.h freetype/src/autofit/afindic.h freetype/docs/INSTALL.GNU freetype/src/raster freetype/builds/unix/ft-munmap.m4 freetype/src/winfonts/module.mk freetype/src/sfnt/ttkern.c freetype/docs/reference/ft2-index.html freetype/src/gzip/infutil.c freetype/src/sfnt/sferrors.h freetype/src/psaux/t1cmap.c freetype/src/sfnt/ttkern.h freetype/src/gxvalid/gxvmort4.c freetype/src/gzip/infutil.h freetype/include/freetype/ttnameid.h freetype/src/psaux/t1cmap.h freetype/builds/os2/detect.mk freetype/src/gzip/zconf.h freetype/docs/reference/ft2-user_allocation.html freetype/src/base/ftpatent.c freetype/src/truetype/rules.mk freetype/src/truetype freetype/src/base/ftadvanc.c freetype/src/tools/docmaker/tohtml.py freetype/builds/unix/unix-dev.mk freetype/src/otvalid/otvcommn.c freetype/src/otvalid/otvalid.c freetype/include/freetype/config/ftmodule.h freetype/src/otvalid/otvcommn.h freetype/src/otvalid/otvalid.h freetype/include/freetype/ftxf86.h freetype/include/freetype/internal/ftserv.h freetype/Jamrules freetype/src/type1/module.mk freetype/builds/win32/vc2008/freetype.sln freetype/src/base/ftapi.c freetype/docs/VERSION.DLL freetype/docs/LICENSE.TXT freetype/docs/reference/ft2-gzip.html freetype/builds/compiler/emx.mk freetype/include/freetype/ftstroke.h freetype/builds/unix/unix.mk freetype/include/freetype/ftlist.h freetype/include/freetype/ftbitmap.h freetype/objs/.gitignore freetype/src/type42/t42parse.c freetype/src/bdf/bdfdrivr.c freetype/modules.cfg freetype/docs/reference/ft2-toc.html freetype/docs/reference/ft2-computations.html freetype/builds/win32/visualce/freetype.dsp freetype/ChangeLog.20 freetype/src/cid/ciderrs.h freetype/src/type42/t42parse.h freetype/ChangeLog.21 freetype/builds/unix/configure.ac freetype/ChangeLog.22 freetype/builds/unix/ftconfig.in freetype/builds/beos freetype/ChangeLog.23 freetype/src/bdf/bdfdrivr.h freetype/builds/win32/visualce/freetype.dsw freetype/include/freetype/tttables.h freetype/docs/reference/ft2-quick_advance.html freetype/builds/unix/freetype2.in freetype/src/cid/module.mk freetype/src/autofit/afdummy.c freetype/src/gxvalid freetype/docs/reference/ft2-mac_specific.html freetype/src/tools/chktrcmp.py freetype/include/freetype/internal/services/svxf86nm.h freetype/src/autofit/afdummy.h freetype/src/pcf/pcfdrivr.c freetype/include/freetype/internal/ftobjs.h freetype/builds/symbian/bld.inf freetype/src/gxvalid/gxvmort5.c freetype/src/psnames/Jamfile freetype/src/pcf/pcfdrivr.h freetype/builds/unix/ftsystem.c freetype/docs/MAKEPP freetype/Jamfile freetype/builds/win32/visualce/index.html freetype/builds/compiler/gcc-dev.mk freetype/include/freetype/ftotval.h freetype/src/tools/test_trig.c freetype/src/tools/docmaker/content.py freetype/include/freetype/ftadvanc.h freetype/builds freetype/include/freetype/internal/services/svpostnm.h freetype/builds/unix/mkinstalldirs freetype/src/cff/rules.mk freetype/src/gzip/zlib.h freetype/src/type42/t42error.h freetype/src/smooth/module.mk freetype/src/sfnt/sfnt.c freetype/docs/reference/ft2-truetype_tables.html freetype/builds/compiler/gcc.mk freetype/builds/unix/config.guess freetype/src/otvalid/Jamfile freetype/src/autofit/afloader.c freetype/include/freetype/internal/services/svkern.h freetype/builds/beos/beos-def.mk freetype/src/autofit/afloader.h freetype/src/cache/ftcerror.h freetype/src/sfnt/Jamfile freetype/src/psaux/psobjs.c freetype/src/gzip/infcodes.c freetype/src/truetype/ttpic.c freetype/src/psaux/psobjs.h freetype/docs/reference/ft2-header_file_macros.html freetype/src/pshinter/pshnterr.h freetype/docs/reference/ft2-ot_validation.html freetype/src/base/ftcalc.c freetype/src/gzip/infcodes.h freetype/src/truetype/ttpic.h freetype/src/bdf/rules.mk freetype/include/freetype/internal/tttypes.h freetype/src/psaux freetype/builds/unix/freetype2.m4 freetype/docs/reference/ft2-outline_processing.html freetype/src/gxvalid/gxvmorx0.c freetype/include/freetype/internal/ftvalid.h freetype/include/freetype/fterrors.h freetype/builds/win32/visualc/freetype.dsp freetype/src/gzip/infblock.c freetype/builds/win32/visualc/freetype.dsw freetype/src/base/ftlcdfil.c freetype/include/freetype/internal/ftmemory.h freetype/src/type1/type1.c freetype/include/freetype/ftpfr.h freetype/src/gzip/infblock.h freetype/src/type42/rules.mk freetype/src/tools/ftrandom/Makefile freetype/src/pshinter/module.mk freetype/builds/amiga/include/freetype/config/ftmodule.h freetype/src/gxvalid/gxvmorx.c freetype/docs/formats.txt freetype/builds/amiga/makefile.os4 freetype/src/cff/cffobjs.c freetype/src/smooth/ftsmooth.c freetype/src/gxvalid/gxvmorx.h freetype/include/freetype/ftoutln.h freetype/src/cff/cffobjs.h freetype/docs/reference/ft2-truetype_engine.html freetype/builds/beos/detect.mk freetype/src/smooth/ftsmooth.h freetype/include/freetype/ftsynth.h freetype/src/winfonts/rules.mk freetype/src/tools/ftrandom/README freetype/src/pcf freetype/docs/CHANGES freetype freetype/src/base freetype/src/base/ftotval.c freetype/include/freetype/tttags.h freetype/src/autofit freetype/src/truetype/module.mk freetype/include/freetype/internal/autohint.h freetype/src/tools/glnames.py freetype/src/sfnt/ttload.c freetype/src/gxvalid/gxvfgen.c freetype/builds/atari/gen-purec-patch.sh freetype/src/sfnt/ttload.h freetype/src/pfr/pfrtypes.h freetype/docs/reference/ft2-system_interface.html freetype/builds/win32/w32-bcc.mk freetype/src/pcf/README freetype/src/gxvalid/gxvtrak.c freetype/include/freetype/internal/ftdriver.h freetype/objs freetype/include/freetype/ftgzip.h freetype/include/freetype/internal/services/svbdf.h freetype/src/base/ftrfork.c freetype/src/smooth/rules.mk freetype/src/base/rules.mk freetype/src/gxvalid/gxvmorx1.c freetype/src/autofit/afwarp.c freetype/src/cid/cidload.c freetype/include/freetype/ftgxval.h freetype/src/autofit/afwarp.h freetype/builds/win32/w32-intl.mk freetype/include/freetype/internal/services/svgldict.h freetype/src/cid/cidload.h freetype/src/gxvalid/gxvprop.c freetype/docs/reference/ft2-raster.html freetype/include/freetype/ftlcdfil.h freetype/src/type42/type42.c freetype/src/tools/docmaker/sources.py freetype/src/raster/rules.mk freetype/src/truetype/ttgxvar.c freetype/src/pshinter/Jamfile freetype/src/truetype/ttdriver.c freetype/src/gxvalid/Jamfile freetype/src/truetype/ttgxvar.h freetype/src/pfr/pfrgload.c freetype/builds/unix/unix-lcc.mk freetype/src/Jamfile freetype/src/pshinter/pshmod.c freetype/src/autofit/aflatin.c freetype/src/truetype/ttdriver.h freetype/src/base/ftsnames.c freetype/src/pfr/pfrgload.h freetype/src/pshinter/pshmod.h freetype/include/freetype/internal/ftcalc.h freetype/include/freetype/ftrender.h freetype/builds/unix freetype/src/base/ftgasp.c freetype/src/autofit/aflatin.h freetype/src/base/ftdbgmem.c freetype/src/smooth/ftspic.c freetype/include/freetype/t1tables.h freetype/src/cid/cidgload.c freetype/src/base/ftoutln.c freetype/src/smooth/ftspic.h freetype/builds/compiler/intelc.mk freetype/src/base/ftwinfnt.c freetype/src/base/ftsynth.c freetype/src/cid/cidgload.h freetype/include/freetype/internal/internal.h freetype/src/sfnt/ttbdf.c freetype/src/lzw/ftlzw.c freetype/src/sfnt/ttbdf.h freetype/builds/win32/vc2008/freetype.vcproj freetype/builds/win32/w32-bccd.mk freetype/src/truetype/ttpload.c freetype/src/gxvalid/gxvmorx2.c freetype/src/truetype/ttinterp.c freetype/src/lzw/rules.mk freetype/src/truetype/ttpload.h freetype/src/base/ftxf86.c freetype/src/base/ftstream.c freetype/src/truetype/ttinterp.h freetype/src/sfnt/ttcmap.c freetype/builds/ansi/ansi.mk freetype/include/freetype/internal/services/svmm.h freetype/src/pfr freetype/builds/compiler/ansi-cc.mk freetype/src/sfnt/ttcmap.h freetype/src/gxvalid/module.mk freetype/src/gxvalid/gxvjust.c freetype/builds/toplevel.mk freetype/src/truetype/tterrors.h freetype/builds/win32 freetype/builds/symbian freetype/src/pcf/pcfutil.c freetype/src/cid/type1cid.c freetype/src/pcf/pcfutil.h freetype/src/base/ftgxval.c freetype/builds/win32/visualce freetype/include/freetype/internal/pshints.h freetype/builds/amiga freetype/builds/amiga/src/base freetype/builds/win32/w32-icc.mk freetype/src/sfnt/ttmtx.c freetype/src/psnames/psmodule.c freetype/src/sfnt/ttmtx.h freetype/builds/wince/vc2008-ce/index.html freetype/src/psaux/psauxmod.c freetype/src/pfr/module.mk freetype/src/base/ftcid.c freetype/src/psnames/psmodule.h freetype/include/freetype/ftsnames.h freetype/src/psaux/psauxmod.h freetype/README.git freetype/configure freetype/src/gzip/inffixed.h freetype/src/bdf freetype/docs/reference/ft2-pfr_fonts.html freetype/src/sfnt/ttcmapc.h freetype/docs/reference freetype/builds/os2/os2-gcc.mk freetype/builds/compiler/bcc.mk freetype/builds/link_dos.mk freetype/docs/reference/ft2-cid_fonts.html freetype/include/freetype/ftwinfnt.h freetype/builds/unix/freetype-config.in freetype/src/pfr/pfrobjs.c freetype/src/base/Jamfile freetype/docs/release freetype/include/freetype/ftimage.h freetype/src/lzw/ftzopen.c freetype/src/pfr/pfrobjs.h freetype/src/lzw/Jamfile freetype/src/truetype/truetype.c freetype/Makefile freetype/src/base/fttrigon.c freetype/builds/win32/w32-vcc.mk freetype/src/lzw/ftzopen.h freetype/src/autofit/afhints.c freetype/builds/unix/install.mk freetype/src/autofit/afhints.h freetype/builds/win32/visualce/freetype.vcproj freetype/include/freetype/ftmac.h freetype/src/psaux/rules.mk freetype/src/type1/rules.mk freetype/src/cache/ftcimage.c freetype/src/psnames/pspic.c freetype/builds/atari/README.TXT freetype/src/cache/ftcimage.h freetype/include/freetype/config/ftconfig.h freetype/src/cid/cidparse.c freetype/src/psnames/pspic.h freetype/src/cff/cfferrs.h freetype/src/cid/cidparse.h freetype/docs/reference/ft2-version.html freetype/src/smooth/Jamfile freetype/src/tools/docmaker freetype/src/gzip/adler32.c freetype/src/tools/docmaker/.gitignore freetype/include/freetype/internal/sfnt.h freetype/docs/reference/README freetype/builds/compiler/unix-lcc.mk freetype/src/winfonts/winfnt.c freetype/devel/ftoption.h freetype/builds/wince/ftdebug.c freetype/src/gzip/zutil.c freetype/src/sfnt/sfntpic.c freetype/builds/unix/unix-def.in freetype/src/winfonts/winfnt.h freetype/builds/os2/os2-def.mk freetype/src/smooth/smooth.c freetype/src/gzip/zutil.h freetype/src/sfnt/sfntpic.h freetype/devel freetype/src/smooth/ftgrays.c freetype/src/raster/ftmisc.h freetype/docs/reference/ft2-module_management.html freetype/src/gxvalid/gxvmorx4.c freetype/include/freetype/internal/pcftypes.h freetype/src/pfr/pfrerror.h freetype/src/smooth/ftgrays.h freetype/src/winfonts/Jamfile freetype/builds/beos/beos.mk freetype/src/raster/raster.c freetype/include/freetype/internal/services/svwinfnt.h freetype/docs/CUSTOMIZE freetype/include/freetype/config freetype/builds/unix/configure.raw freetype/include/freetype/internal/t1types.h freetype/builds/wince/vc2008-ce/freetype.vcproj freetype/docs/reference/ft2-font_formats.html freetype/src/otvalid/module.mk freetype/include/freetype/internal/services/svpscmap.h freetype/ChangeLog freetype/include/freetype/fttrigon.h freetype/builds/win32/visualc freetype/src/cache/ftcmanag.c freetype/docs/FTL.TXT freetype/src/sfnt/ttsbit.c freetype/README freetype/src/cache/ftcmanag.h freetype/src/sfnt/ttsbit.h freetype/builds/mac/FreeType.ppc_carbon.make.txt freetype/builds/wince/vc2005-ce/freetype.sln freetype/docs/reference/ft2-sizes_management.html freetype/src/type42/t42drivr.c freetype/src/psaux/psconv.c freetype/include/freetype/ftbdf.h freetype/include/freetype/ftsizes.h freetype/src/type42/t42drivr.h freetype/src/cff freetype/include/freetype/internal/services/svtteng.h freetype/src/psaux/psconv.h freetype/include/freetype/internal/ftdebug.h freetype/src/tools/docmaker/docmaker.py freetype/src/gxvalid/gxverror.h freetype/src/autofit/module.mk freetype/include/freetype/internal/ftstream.h freetype/src/cff/cfftypes.h freetype/builds/modules.mk freetype/src/smooth freetype/docs/reference/ft2-bitmap_handling.html freetype/src/gxvalid/gxvmorx5.c freetype/src/gxvalid/gxvmod.c freetype/builds/freetype.mk freetype/include/freetype/internal/ftpic.h freetype/src/type42 freetype/src/gxvalid/gxvmod.h freetype/include/freetype/ftbbox.h freetype/src/otvalid/otvmod.c freetype/builds/unix/install-sh freetype/src/psnames/psnames.c freetype/builds/os2 freetype/src/cid/rules.mk freetype/src/psaux/psauxerr.h freetype/src/type42/t42objs.c freetype/src/otvalid/otvmod.h freetype/src/cache/ftccmap.c freetype/src/cache/ftcbasic.c freetype/src/cache freetype/src/smooth/ftsmerrs.h freetype/src/type42/t42objs.h freetype/include/freetype/internal/services/svttcmap.h freetype/version.sed freetype/builds/amiga/include/freetype/config/ftconfig.h freetype/src/psaux/t1decode.c freetype/docs/reference/ft2-glyph_management.html freetype/src/autofit/rules.mk freetype/src/tools/docmaker/utils.py freetype/builds/win32/visualc/index.html freetype/src/psaux/t1decode.h freetype/builds/ansi/ansi-def.mk freetype/src/otvalid/otvjstf.c freetype/src/type42/module.mk freetype/src/cff/cffgload.c freetype/src/autofit/aferrors.h freetype/src/gxvalid/gxvlcar.c freetype/builds/amiga/makefile freetype/include/freetype/internal/services/svsfnt.h freetype/src/bdf/README freetype/src/base/ftinit.c freetype/src/cff/cffgload.h freetype/src/cache/ftccback.h freetype/include/freetype/internal freetype/src/base/ftmm.c freetype/src/pcf/module.mk freetype/docs/TODO freetype/docs/reference/ft2-lzw.html freetype/src/tools/Jamfile freetype/builds/win32/detect.mk freetype/builds/unix/ltmain.sh freetype/src/autofit/afangles.c freetype/include/freetype/config/ftoption.h freetype/src/gxvalid/gxvcommn.c freetype/src/cff/cffload.c freetype/include/freetype freetype/src/autofit/afangles.h freetype/builds/compiler/visualc.mk freetype/src/gxvalid/gxvcommn.h freetype/src/cff/cffload.h freetype/builds/mac/FreeType.m68k_far.make.txt freetype/builds/amiga/include/freetype/config freetype/src/sfnt/ttpost.c freetype/src/sfnt/ttpost.h freetype/src/cid freetype/src/cache/rules.mk freetype/include/freetype/ttunpat.h freetype/builds/amiga/README freetype/include/freetype/ftmodapi.h freetype/include/freetype/internal/fttrace.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-18T013829.130442Z"></a>
-2009-12-18T01:38:29.130442Z Ralph Giles</strong></p>
+<p><strong><a name="2010-07-18T053008.091459Z"></a>
+2010-07-18T05:30:08.091459Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-And the 'nogc' allocator to the default gcc build.
+Implement halftones type 6, 10, 16 in PDF interpreter.
+Use default halftone when the halftone type is incorrect.
+</pre>
+<p>[Resource/Init/pdf_draw.ps]</p>
+</blockquote>
 
-This allows ghostxps to build linked against the default 'so' build of
-the gs library, simplifying some build options. The code size increase
-is negligible.
+<p><strong><a name="2010-07-18T000337.786299Z"></a>
+2010-07-18T00:03:37.786299Z Alex Cherepanov</strong></p>
+<blockquote>
+<pre>
+Recognize enumerated color space #12 as CMYK following JPX baseline spec.
 </pre>
-<p>[base/Makefile.in]</p>
+<p>[Resource/Init/pdf_draw.ps]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-17T201408.344945Z"></a>
-2009-12-17T20:14:08.344945Z Robin Watts</strong> (<a href="Details.htm#2009-12-17T201408.344945Z">details</a>)</p>
+<p><strong><a name="2010-07-17T212339.853613Z"></a>
+2010-07-17T21:23:39.853613Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Fix for bug 690620. Original patch from HenryS. This adjusts rectangular
-fills to more closely match that used by Acrobat v8.
+Re-implement handling of named page sizes to avoid dependence on
+the definitions of compatibility operators (a4, letter, etc.)
+in userdict. Bug 691458.
+</pre>
+<p>[Resource/Init/gs_init.ps Resource/Init/gs_setpd.ps Resource/Init/gs_statd.ps]</p>
+</blockquote>
 
+<p><strong><a name="2010-07-17T000709.985181Z"></a>
+2010-07-17T00:07:09.985181Z Alex Cherepanov</strong></p>
+<blockquote>
+<pre>
+Remove unused variables CC_D and CC_INT from all makefiles.
 </pre>
-<p>[base/gsdps1.c]</p>
+<p>[psi/os2.mak base/unixhead.mak base/bcwin32.mak base/openvms.mak base/watcw32.mak base/msvccmd.mak base/wccommon.mak]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-17T181348.602966Z"></a>
-2009-12-17T18:13:48.602966Z regression</strong></p>
+<p><strong><a name="2010-07-16T204049.337914Z"></a>
+2010-07-16T20:40:49.337914Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Cache the previous revisions crc values to improve compare.pl performance.
+Fix the bug that prevented recognition of GenericResourceDir/Category/Name
+as a valid resource path and required inclusion of GenericResourceDir in
+the search path to find the same resource by searching.
 
-Also remove the no longer needed splitjobs.pl from the repository.
+New procedure does the following:
+1. Returns GenericResourceDir/Category/Name if it exists.
+2. Searches for Category/Name in LIBPATH. Returns actual path if found.
+3. For non-existing resources return the same path as (1).
 
+Old implementation added GenericResourceDir twice, didn't close files,
+used system memory, called expensive procedures twice, etc.
+
+Regression testing shows trivial differences in 23-07.ps, which prints
+the length of ResourceFileName procedure.
+This is a partial fix for bug 691408.
 </pre>
-<p>[toolbin/localcluster/splitjobs.pl toolbin/localcluster/clustermaster.pl toolbin/localcluster/cachearchive.pl toolbin/localcluster/compare.pl]</p>
+<p>[Resource/Init/gs_res.ps]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-17T175714.753910Z"></a>
-2009-12-17T17:57:14.753910Z Robin Watts</strong> (<a href="Details.htm#2009-12-17T175714.753910Z">details</a>)</p>
+<p><strong><a name="2010-07-16T195803.971410Z"></a>
+2010-07-16T19:58:03.971410Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Update the arguments passed to ghostscript by htmldiff.pl so that they
-more closely match those used by the localcluster.
+Prepend icc directory to device profile name if the default name is used so that we have it during clist reading.  This is a fix for the iccprofiles/ problem in 691408 when compile inits is not used.  Also,  fix so that the profile name is allocated in non-gc memory.  This was a source of issues with the userparams dict not seeming to be traced or at least not getting its members relocated if a profile in the icc manager was relocated.  This fixes the breaking of the psdcmyk device in rev  11499.  Also removal of spurious warning messages.</pre>
+<p>[base/gsicc_manage.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-07-15T204206.487509Z"></a>
+2010-07-15T20:42:06.487509Z Ray Johnston</strong></p>
+<blockquote>
+<pre>
+Change pdf14_put_image so that the gx_default_begin_typed_image will
+be able to call the device's 'begin_image' which is often hooked for
+device specific (hardware accelerated) image rendering. This avoids
+the default image rendering which results in LOTS of fill_rectangle
+calls. Found with customer 532.
 </pre>
-<p>[toolbin/htmldiff.pl]</p>
+<p>[base/gdevp14.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-17T152407.353413Z"></a>
-2009-12-17T15:24:07.353413Z regression</strong> (<a href="Details.htm#2009-12-17T152407.353413Z">details</a>)</p>
+<p><strong><a name="2010-07-15T192838.670595Z"></a>
+2010-07-15T19:28:38.670595Z Ray Johnston</strong></p>
 <blockquote>
 <pre>
-Minor cleanup/improvement of local cluster code.
+The other half of the version.mak change.
+</pre>
+<p>[Resource/Init/gs_init.ps]</p>
+</blockquote>
 
+<p><strong><a name="2010-07-15T181417.190964Z"></a>
+2010-07-15T18:14:17.190964Z Ray Johnston</strong></p>
+<blockquote>
+<pre>
+Update version to 9.00 PRE-RELEASE (with a bogus date, but before Aug 1)
+This will serve to notify folks what the next release will be (not 8.72)
 </pre>
-<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/build.pl toolbin/localcluster/clusterpush.pl toolbin/localcluster/run.pl toolbin/localcluster/compare.pl]</p>
+<p>[base/version.mak]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-16T184620.783419Z"></a>
-2009-12-16T18:46:20.783419Z Robin Watts</strong> (<a href="Details.htm#2009-12-16T184620.783419Z">details</a>)</p>
+<p><strong><a name="2010-07-15T144939.770856Z"></a>
+2010-07-15T14:49:39.770856Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Fix for incorrect bbox test in bmpcmp.
+Improve Ghostscript operation when current directory is not included in the
+search path.
+1. Make file path separators at the end of LIBPATH entries optional to reduce
+   the number of trivial configuration errors.
+2. Search LIBPATH list for valid iccprofiles/ directory as a sibling to
+   (Resource) and set it as a default to ensure a valid default.
+   This code follows /GenericResourceDir example.
+3. Make sure that the path name derived from /GenericFontDir is is not
+   searched but other font file names are searched. Earlier code relied on
+   a feature of .libfile not searching for an absolute path and failed
+   when the path was relative.
+Partial fix for bugs 691350, 691408.
+</pre>
+<p>[Resource/Init/gs_lev2.ps Resource/Init/gs_fonts.ps Resource/Init/gs_res.ps]</p>
+</blockquote>
 
-bmpcmp would correctly assess the changed region, but then incorrectly accept
-changes restricted to a single row or column as not being changes at all.
+<p><strong><a name="2010-07-15T054255.376283Z"></a>
+2010-07-15T05:42:55.376283Z Alex Cherepanov</strong></p>
+<blockquote>
+<pre>
+Add copying default ICC profiles to disk-install location. This is necessary
+for the builds with COMPILE_INITS=0, which looks for ICC profiles on disk.
+Thanks to Hin-Tak for the patch. Bug 691449.
+</pre>
+<p>[base/unixinst.mak]</p>
+</blockquote>
 
+<p><strong><a name="2010-07-14T212533.726848Z"></a>
+2010-07-14T21:25:33.726848Z Till Kamppeter</strong></p>
+<blockquote>
+<pre>
+Allow the CUPS Raster backend alternatively output compressed (version 2) CUPS Raster data (bug #689885).
 </pre>
-<p>[toolbin/bmpcmp.c]</p>
+<p>[cups/gdevcups.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-16T183340.102435Z"></a>
-2009-12-16T18:33:40.102435Z Robin Watts</strong></p>
+<p><strong><a name="2010-07-13T183029.088597Z"></a>
+2010-07-13T18:30:29.088597Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Broken fix for incorrect bbox test in bmpcmp; please ignore this revision
-and use 10507 instead.
+Ensure the local variable into which we read Truetype cmap table data (platform ID, encoding ID etc) is actually large enough to hold all the data we read into it.
 
-bmpcmp would correctly assess the changed region, but then incorrectly accept
-changes restricted to a single row or column as not being changes at all.
-</pre>
-<p>[toolbin/bmpcmp.c]</p>
+Bug 691452 (part 1)
+
+No cluster differences expected.</pre>
+<p>[base/gsfcid2.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-16T174049.399642Z"></a>
-2009-12-16T17:40:49.399642Z Robin Watts</strong></p>
+<p><strong><a name="2010-07-13T082456.010563Z"></a>
+2010-07-13T08:24:56.010563Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Improved version of htmldiff.pl: New HTML file started every 100 or so sets
-of image differences (configurable). This should stop browsers grinding to a
-halt. Improved reporting of conversion errors.
+Update the documentation on producing PDF/X to make it clear that -sProcessColorModel
+is an absolute requirement, even when using -dUseCIEColor, and that the PDFA_def.ps
+file must be edited, at the very least to alter the ICCProfile entry.
 
+Also made some minor syntax changes in PDF/A and PDF/X documentation for greater clarity.
 </pre>
-<p>[toolbin/htmldiff.pl]</p>
+<p>[doc/Ps2pdf.htm]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-15T221458.866880Z"></a>
-2009-12-15T22:14:58.866880Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-13T070459.625768Z"></a>
+2010-07-13T07:04:59.625768Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Increase the limit on the number of color components to 12. A file with
-9 components has been found in the wild, add 3 more for a small reserve.
-Bug 691002.
-</pre>
-<p>[base/gsccolor.h]</p>
+Fix for Bug 691444.  Issue was introduced when interpolation max output range was set to be 65535 so that the output could be fed directly into CMM. Problem was for HT output devices like pbmraw the interpolation filter ignored the max range setting and used a max value of the frac range as output.  This fixes a number of files that had regressions.  Files checked with bmpcmp.</pre>
+<p>[base/sidscale.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-15T143456.554574Z"></a>
-2009-12-15T14:34:56.554574Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-13T012010.578834Z"></a>
+2010-07-13T01:20:10.578834Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Fix a botched use of references where a pointer to a reference in a
-PostScript VM was used as a temporary variable. Bug 690828.
-</pre>
-<p>[psi/zcolor.c]</p>
+Fix for bug 691445.  pdf14 mapping procs were not paying attention to the trans device in the imager state.  bmpcmp showed that this fixed several files.</pre>
+<p>[base/gdevp14.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-15T095523.729025Z"></a>
-2009-12-15T09:55:23.729025Z Ken Sharp</strong> (<a href="Details.htm#2009-12-15T095523.729025Z">details</a>)</p>
+<p><strong><a name="2010-07-12T150357.186505Z"></a>
+2010-07-12T15:03:57.186505Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI) : Silence a compiler warning
+In the event the FAPI code has to replace the FontBBox array, make sure the new array is marked executable.
 
-</pre>
+No cluster differences expected.</pre>
 <p>[psi/zfapi.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-13T013159.081596Z"></a>
-2009-12-13T01:31:59.081596Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-11T152614.804339Z"></a>
+2010-07-11T15:26:14.804339Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Accept ASCII85 stream that ends with bare '~' in PDF files for compatibility
-with Acrobat Reader. Add /PDFRules ASCII85Decode filter parameter to select
-between PS and PDF logic. Bug 690976, customer 870.
+Fix for overprint regressions introduced with icc branch merge.  Review of bmp compares reveals that this fixes a number of issues hence the large number of differences with the commit.  There is one regression introduced with this commit, which is IA3Z0302.pdf.pdf.pkmraw.300 page 2 a bug will be opened for this.   Also, review of Atona_Technical_1v1_x3.pdf.pam.72 reveals there some overprint issues may still exist with bitmap and halftone image overprinting on top of spotcolors when Overprint is true and and Overprint mode is set to On.  This issue may have existed prior to the icc commit.  Will open a bug to investigate.</pre>
+<p>[base/gsicc_create.c base/gxcspace.h base/gscspace.c base/gsicc.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-07-10T012854.795367Z"></a>
+2010-07-10T01:28:54.795367Z Ray Johnston</strong></p>
+<blockquote>
+<pre>
+Fix 'status' operator to return false when the IODevice prefix is
+not found instead of undefinedfilename. Found while working on 691408.
 </pre>
-<p>[base/sa85d.h Resource/Init/pdf_base.ps base/sa85d.c psi/zfdecode.c]</p>
+<p>[psi/zfile.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-12T230518.157328Z"></a>
-2009-12-12T23:05:18.157328Z Ray Johnston</strong> (<a href="Details.htm#2009-12-12T230518.157328Z">details</a>)</p>
+<p><strong><a name="2010-07-09T183119.790276Z"></a>
+2010-07-09T18:31:19.790276Z Ray Johnston</strong></p>
 <blockquote>
 <pre>
-Fix RasterOp texture rendering from uninitialized memory (past end of buffer)
-when the texture was 'expanded' and the unexpanded texture had repitions in y.
-Bug 690299.
-
+Fix to use stable memory for profiledir in icc_manager structure and change
+all 'current_' functions to return the actual value set, the default, or
+an empty string if no default. Also set the default ICCProfilesDir to
+%rom%iccprofiles which will work if COMPILE_INITS=1. This should also be
+set by the PS init code (see bug 691408).
 </pre>
-<p>[base/gdevdrop.c]</p>
+<p>[psi/zusparam.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-12T223917.759602Z"></a>
-2009-12-12T22:39:17.759602Z regression</strong></p>
+<p><strong><a name="2010-07-09T094017.170342Z"></a>
+2010-07-09T09:40:17.170342Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Added abort option to clusterpush.pl (i.e. 'clusterpush.pl abort') to
-abort current job and remove any jobs queued for a user (it is possible
-to abort/remove jobs for other users, but I'll leave that undocumented).
+Improve Windows batch files.
+Bug #691440 &quot;Windows bat files use relative paths and write to non-temp dir&quot;
 
-Also partially added support for mupdf regression testing.
+As suggested by Bjorn Martensson in bug #691440. Altered all batch files which call
+other batch files so that they prepend the call with the location the original
+batch file was executed from. This allows batch files such as ps2pdf.bat to be called
+from locations other than the Ghostscript 'lib' directory.
 
-</pre>
-<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/build.pl toolbin/localcluster/clusterpush.pl toolbin/localcluster/run.pl]</p>
+Also altered the location of temporary files created by the batch files to the Windows
+temporary folder by using the %TEMP% environment variable. If this variable is not set
+for some reason then this will still default to the current directory, as it does now.
+This allows batch files to be run from directories which are read only.
+
+Since these files are not used by our (Linux) cluster there will be no differences. I
+have tested a number of the scripts, but not all of them. The ones I have tested seem
+to work well.
+
+I finally found a reference which states that the %~d batch parameter was introduced
+to Windows in NT4, this means that these batch files will likely fail on older versions
+of Windows (ie Windows 3.x/95/98). I don't believe we need to support such antiquated
+Operating Systems any further.</pre>
+<p>[lib/pf2afm.bat lib/gsdj500.bat lib/ps2ascii.bat lib/ps2pdfxx.bat lib/lpr2.bat lib/gsndt.bat lib/gstt.bat lib/eps2eps.bat lib/pdf2dsc.bat lib/gsbj.bat lib/ps2epsi.bat lib/gsdj.bat lib/dumphint.bat lib/ps2ps2.bat toolbin/msvcxml.bat lib/gsnd.bat lib/font2c.bat lib/pdfopt.bat lib/gst.bat lib/pdf2ps.bat lib/ps2pdf.bat lib/gslj.bat lib/bdftops.bat lib/pfbtopfa.bat lib/ps2pdf12.bat lib/ps2pdf13.bat lib/ps2pdf14.bat lib/gslp.bat lib/lpgs.bat lib/ps2ps.bat lib/pftogsf.bat]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-12T182525.212987Z"></a>
-2009-12-12T18:25:25.212987Z regression</strong></p>
+<p><strong><a name="2010-07-08T200159.912724Z"></a>
+2010-07-08T20:01:59.912724Z Robin Watts</strong></p>
 <blockquote>
 <pre>
-Added --max-size=2500000 to avoid sending very large files.
+Extend the experimental ENABLE_TRAP_AMALGAMATION code to the
+TEMPLATE_slant_into_trapezoids cases too. The current code generates 3
+trapezoids; the new code will (if the option is enabled) attempt to
+amalgamate the top/bottom traps into the middle one.
 
-Divide queueing and syncing into two steps, so that it's possible
-to ^C if you decide the files being transmistted are incorrect.
+Enabling this code (but disabling the existing code for trap amalgamation)
+shows no differences. Enabling all the trap amalgamation code shows 888
+differences, all fairly innocuous.
 
+As this code is going in disabled, no cluster differences are expected.
+
 </pre>
-<p>[toolbin/localcluster/clusterpush.pl]</p>
+<p>[base/gxfillts.h base/gxfill.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-12T034655.487466Z"></a>
-2009-12-12T03:46:55.487466Z Hin-Tak Leung</strong></p>
+<p><strong><a name="2010-07-08T162020.892723Z"></a>
+2010-07-08T16:20:20.892723Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Coverity warning #4475, uninitialized value</pre>
-<p>[base/gdevpxut.c]</p>
+Update the Ghostscript man page to reflect the new default for -P option
+made by the rev. 11494.
+</pre>
+<p>[man/gs.1]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-12T034555.759446Z"></a>
-2009-12-12T03:45:55.759446Z Hin-Tak Leung</strong></p>
+<p><strong><a name="2010-07-07T212755.422122Z"></a>
+2010-07-07T21:27:55.422122Z Marcos H. Woehrmann</strong></p>
 <blockquote>
 <pre>
-Coverty warning #1158, unchecked return values</pre>
-<p>[base/gdevpx.c]</p>
+clusterpush.pl with no options now tests language_switch build as well as gs, pcl, and xps.
+
+Also some minor documentation improvements.
+</pre>
+<p>[toolbin/localcluster/clusterpush.pl toolbin/localcluster/readme]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-12T034513.363455Z"></a>
-2009-12-12T03:45:13.363455Z Hin-Tak Leung</strong></p>
+<p><strong><a name="2010-07-07T174709.812924Z"></a>
+2010-07-07T17:47:09.812924Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Coverity warning #2555, removing unused header</pre>
-<p>[base/gdevpx.c]</p>
+Dont't search for initialization files in the current directory first
+by default because this leads to well-known security and confusion problems.
+Do this only on the user's request by -P switch. Also revert rev. 11468,
+which is no longer needed. Bug 691350.
+</pre>
+<p>[base/openvms.mmk psi/zfile.c doc/Use.htm base/bcwin32.mak base/ugcclib.mak base/Makefile.in base/unix-gcc.mak base/macos-mcp.mak toolbin/msvcxml.bat psi/os2.mak base/watclib.mak base/openvms.mak base/macosx.mak base/watcw32.mak psi/msvc32.mak base/unixansi.mak base/msvclib.mak]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-12T034349.383201Z"></a>
-2009-12-12T03:43:49.383201Z Hin-Tak Leung</strong></p>
+<p><strong><a name="2010-07-07T134957.894248Z"></a>
+2010-07-07T13:49:57.894248Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-treat depth 15 the same as depth 16 in get_bits_rectangle()
+Fix : temporary memory device not finalized.
 
-It looks to be 'just work' (or no worse than depth 16) by treating depth 
-15 the same as depth 16 in get_bits_rectangle. The pcl files in the original report
-works now; but a pxl file shows some visual artifects (and different one) at depth
-15, 16 and will be filed separately.
+clist_init_data creates a temporary memory device in order to &quot;get the memory planarity
+set up&quot;, using a local variable to hold the device. When the function exits the
+variable goes out of scope and disappears.
 
-This fix fix bug 690328 (make X11 device continue for those pcl files; caveate 
-visual artefacts for at least one pxl file)
+Because the memory device is a forwarding device it increments the reference count of
+its target, but because it is never finalized it does not decrement the reference count
+when it is destroyed, leading to an incorrect target reference count.
 
+This only affects pdfwrite at present, but it prevents valid PDF files being written
+because the file is only terminated when the pdfwrite device reference count reaches
+0 and the pdfwrite device is closed.
+
+Added calls to finalize the device before discarding it.
+
+No expected differences.
 </pre>
-<p>[base/gdevx.c doc/Devices.htm]</p>
+<p>[base/gxclist.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-12T002826.868635Z"></a>
-2009-12-12T00:28:26.868635Z Ray Johnston</strong> (<a href="Details.htm#2009-12-12T002826.868635Z">details</a>)</p>
+<p><strong><a name="2010-07-06T222732.077335Z"></a>
+2010-07-06T22:27:32.077335Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Fix hang condition due to pointer comparison, bug 690638.
-
+Increase the max number of color components to 14 to accomodate a new
+record (13) found in the wild. Bug 691425.
 </pre>
-<p>[base/gxclrast.c]</p>
+<p>[base/gsccolor.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-11T191857.300388Z"></a>
-2009-12-11T19:18:57.300388Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-07-06T092540.558632Z"></a>
+2010-07-06T09:25:40.558632Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Fix incorrect calculation of the operand stack base (pdfemptycount) in PDF
-interpreter, which caused incorrect processing of scn operator. Bug 690977.
+Fix (pdfwrite) : Named destinations with no /Page not working properly
 
+Bug #691344 &quot;REGRESSION: ps2pdf of 8.70 generates correct hyperlinks but not ps2pdf of
+8.71&quot;
+
+The revisions 9779 and 9788 fixed a problem where DOCVIEW pdfmarks without a /Page or
+/View entry were producing invalid PDF files, and a problem with DEST pdfmarks arising
+from it.
+
+Because DOCVIEW and DEST pdfmarks share some common code in pdfwrite to create a 
+Destination annotation in the outptu PDF, this still left some confusion in the code.
+The problem was that DOCVIEW pdfmarks need not contain Page or View data, but named 
+destinations *must*, but pdfmarks need not specify, in which case the current page is
+used.
+
+Added a parameter to pdf_make_dest which allows us to differentiate the two cases and
+use the current page number for a named destination if no page is supplied.
+
+The regression suite can't test this non-printing feature, so no differences are 
+expected.
 </pre>
-<p>[Resource/Init/pdf_draw.ps]</p>
+<p>[base/gdevpdfm.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-10T032932.317033Z"></a>
-2009-12-10T03:29:32.317033Z regression</strong></p>
+<p><strong><a name="2010-07-06T070453.806003Z"></a>
+2010-07-06T07:04:53.806003Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Removed bitrgb and pgmraw from pcl regression tests.
+Improve handling an error condition as suggested by Alex Cherepanov in Bug #691435,
+comment 9. </pre>
+<p>[base/gdevpdfj.c]</p>
+</blockquote>
 
-Fixed a bug where failed compiles would cause a job restart loop.
+<p><strong><a name="2010-07-06T001144.270183Z"></a>
+2010-07-06T00:11:44.270183Z Ray Johnston</strong></p>
+<blockquote>
+<pre>
+Fix BAND_LIST_STORAGE=memory to handle files that create compressed memory
+files &gt; 2Gb. Also add code to make the reporting of these file sizes a bit
+better, but portability may still be an issue. Reference Bug 690199 for
+customers 850 and 531.
 
 </pre>
-<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/build.pl toolbin/localcluster/run.pl]</p>
+<p>[base/gxclmem.c base/gxclist.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-09T172434.115310Z"></a>
-2009-12-09T17:24:34.115310Z Ken Sharp</strong> (<a href="Details.htm#2009-12-09T172434.115310Z">details</a>)</p>
+<p><strong><a name="2010-07-05T235146.696108Z"></a>
+2010-07-05T23:51:46.696108Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Fix (pdfwrite) : regressions with revision 10474
+Replace all '==' executable names with '//== exec' in Ghostscript start-up
+code because MS driver redefines '==' in a way that requires write access to
+the top dictionary, and this is not always the case. Bug 689957.
+</pre>
+<p>[Resource/Init/gs_cmap.ps Resource/Init/gs_pdfwr.ps Resource/Init/pdf_main.ps Resource/Init/gs_resmp.ps Resource/Init/pdf_font.ps Resource/Init/gs_fonts.ps Resource/Init/pdf_base.ps Resource/Init/pdf_sec.ps Resource/Init/gs_ttf.ps Resource/Init/pdf_draw.ps Resource/Init/gs_cff.ps Resource/Init/gs_fapi.ps]</p>
+</blockquote>
 
+<p><strong><a name="2010-07-05T161838.343520Z"></a>
+2010-07-05T16:18:38.343520Z Alex Cherepanov</strong></p>
+<blockquote>
+<pre>
+Set svn:ignore property for all remaining generated files in jasper,
+jbig2dec, and tiff directories.
 </pre>
-<p>[base/gdevpdtt.c]</p>
+<p>[tiff/contrib/iptcutil tiff/contrib/tags tiff/build tiff/tools tiff tiff/contrib tiff/contrib/mac-mpw tiff/contrib/acorn tiff/html jasper/src/libjasper/include/jasper tiff/contrib/mac-cw tiff/contrib/dbs tiff/html/images tiff/man tiff/contrib/win_dib tiff/html/man tiff/libtiff tiff/test tiff/contrib/addtiffo jbig2dec tiff/port tiff/contrib/ras tiff/contrib/mfs tiff/contrib/pds tiff/contrib/dbs/xtiff tiff/contrib/stream]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-09T153227.320916Z"></a>
-2009-12-09T15:32:27.320916Z Ken Sharp</strong> (<a href="Details.htm#2009-12-09T153227.320916Z">details</a>)</p>
+<p><strong><a name="2010-07-05T151009.278642Z"></a>
+2010-07-05T15:10:09.278642Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Fix (pdfwrite) : Unchecked return value causing indeterminisms
+Add a pair of parentheses to silence a gcc compiler warning. Also extend the comment
+slightly to be a little more informative.
 
+No differences expected.
 </pre>
-<p>[base/gdevpdtt.c]</p>
+<p>[base/gdevpdfj.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-08T160901.319365Z"></a>
-2009-12-08T16:09:01.319365Z Ken Sharp</strong> (<a href="Details.htm#2009-12-08T160901.319365Z">details</a>)</p>
+<p><strong><a name="2010-07-05T051316.304757Z"></a>
+2010-07-05T05:13:16.304757Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI) : Handle Type 42 fonts with CharStrings dictionaries with real PS glyphs
+Use the presence of /CIDSystemInfo instead of /Subtype value to decide
+whether the object is a CID font. The former is required by Acrobat, the
+latter appears to be ignored by Acrobat, and so may be wrong. Bug 691426. 
+</pre>
+<p>[Resource/Init/pdf_font.ps]</p>
+</blockquote>
 
+<p><strong><a name="2010-07-05T012343.139942Z"></a>
+2010-07-05T01:23:43.139942Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+test for emptiness of HAVE_FONTCONFIG is better than non-yes-ness of enable_fontconfig; fine-tuning of r11448 to --disable-cairo when fontconfig is not available or user-disabled</pre>
+<p>[base/configure.ac]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-05T011830.861454Z"></a>
+2010-07-05T01:18:30.861454Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+new/renamed documentation file libpng-1.2.44.txt missed in r11482 for libpng 1.2.42-&gt;1.2.44 upgrade</pre>
+<p>[libpng/libpng-1.2.44.txt]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-04T190417.740307Z"></a>
+2010-07-04T19:04:17.740307Z Alex Cherepanov</strong></p>
+<blockquote>
+<pre>
+Reaplly Hin-Tak's patch, rev. 11453, which was rolled back by the rev. 11462.
+Apply diff between stock 1.2.42 &lt;-&gt; 1.2.44 to upgrade to libpng 1.2.44 - bug
+fixes - CVE-2010-1205. Bug 691438. 
 </pre>
-<p>[psi/zfapi.c]</p>
+<p>[libpng/pngrtran.c libpng/scripts/makefile.gcmmx libpng/contrib/pngminim/encoder/gather.sh libpng/scripts/makefile.sgi libpng/scripts/makefile.sco libpng/scripts/makefile.hpgcc libpng/KNOWNBUG libpng/projects/xcode/libpng.xcodeproj/project.pbxproj libpng/scripts/pngos2.def libpng/scripts/makefile.nommx libpng/scripts/makefile.linux libpng/pngmem.c libpng/png.c libpng/contrib/pngminim/decoder/gather.sh libpng/scripts/makefile.64sunu libpng/scripts/makefile.elf libpng/scripts/libpng-config-head.in libpng/png.h libpng/CMakeLists.txt libpng/pngrio.c libpng/pngpread.c libpng/Y2KINFO libpng/scripts/makefile.netbsd libpng/pngwio.c libpng/pngrutil.c libpng/scripts/makefile.hpux libpng/scripts/makefile.darwin libpng/scripts/makefile.sggcc libpng/README libpng/contrib/pngminim/decoder/makefile libpng/scripts/makefile.32sunu libpng/libpngpf.3 libpng/scripts/makefile.solaris-x86 libpng/libpng-1.2.42.txt libpng/contrib/pngminim/preader/makefile libpng/scripts/makefile.solaris libpng/pngwtran.c libpng/contrib/pngminim/preader/gather.sh libpng/scripts/makefile.mingw libpng/scripts/makefile.aix libpng/scripts/makefile.hp64 libpng/scripts/png32ce.def libpng/scripts/makefile.beos libpng/scripts/makefile.ne12bsd libpng/pngread.c libpng/scripts/pngw32.def libpng/pngget.c libpng/INSTALL libpng/scripts/makefile.cegcc libpng/CHANGES libpng/contrib/pngminim/encoder/makefile libpng/projects/wince.txt libpng/libpng.3 libpng/example.c libpng/scripts/makefile.so9 libpng/pngwrite.c libpng/pngconf.h libpng/pngset.c libpng/LICENSE libpng/png.5 libpng/pngwutil.c libpng/scripts/makefile.openbsd libpng/scripts/makefile.dec libpng/scripts/README.txt libpng/scripts/makefile.cygwin libpng/pngtest.c libpng/ANNOUNCE libpng/scripts/libpng.pc.in]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-08T075226.208006Z"></a>
-2009-12-08T07:52:26.208006Z Ralph Giles</strong></p>
+<p><strong><a name="2010-07-03T002940.754683Z"></a>
+2010-07-03T00:29:40.754683Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Revert remaining changes to the clusterpush script inadvertently 
-included in r10461. This version is now identical with the version
-in r10435. In particular, the more sophisticated gs/ghostpdl detection
-which works for branches and custom-named directories is restored.
+missed linker defines needed to build under 64-bit windows in a previous commit r11388 for bug 691302</pre>
+<p>[psi/msvc32.mak]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-01T215829.492747Z"></a>
+2010-07-01T21:58:29.492747Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Bubble up of error when allocation of default profile cmm handle fails. Fix for bug 691429</pre>
+<p>[base/gsicc_manage.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-01T211355.381754Z"></a>
+2010-07-01T21:13:55.381754Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+revert r11469(r11455) - wrong fix to bug 690428</pre>
+<p>[base/gdevxcmp.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-01T190829.177579Z"></a>
+2010-07-01T19:08:29.177579Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Enhancement (pdfwrite) : Fall back to Flate instead of JPEG when an image turns out
+short.
+
+Bug #691435 &quot;any PDFSETTINGS besides /default gives dictfull error&quot;
+
+There are two problems; firstly when an error is encountered closing a filter the
+error code (-1 or -2 usually) is returned and interpreted as a regular GS error,
+resulting in ridiculous error messages. Modified to return ioerror instead.
+
+Secondly, when an image terminates with insufficient data and pdfwrite is creating a
+DCT encoded image, we can't complete the image. In this case try to fall back to the
+simple Flate compressed stream instead.
+
+No differences expected.
 </pre>
-<p>[toolbin/localcluster/clusterpush.pl]</p>
+<p>[base/gdevpdfj.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-08T074112.811962Z"></a>
-2009-12-08T07:41:12.811962Z Ralph Giles</strong></p>
+<p><strong><a name="2010-07-01T171423.564053Z"></a>
+2010-07-01T17:14:23.564053Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Update local cluster documentation to reference the 'regression' account
-instead of 'marcos' and other minor cleanup.
+Fix for Bug 691431.  This was caused by a PS CIE color space being used for a transparency group color space.  That really should not be allowed since those color spaces are unidirectional.  They are installed though when -dUseCIEColor is used with a PDF file that has transparency. Solution is to use the default ICC profiles for the group color space when this occurs.</pre>
+<p>[base/gstrans.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-01T121920.914734Z"></a>
+2010-07-01T12:19:20.914734Z Robin Watts</strong></p>
+<blockquote>
+<pre>
+Revert revision 11472 as it breaks almost every file in the cluster tests,
+and it's preventing other meaningful work being done.
+
 </pre>
-<p>[toolbin/localcluster/setupcluster toolbin/localcluster/clusterpush.pl toolbin/localcluster/readme toolbin/localcluster/clusterpush.txt]</p>
+<p>[base/gp_unifn.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-08T072503.670058Z"></a>
-2009-12-08T07:25:03.670058Z Ralph Giles</strong></p>
+<p><strong><a name="2010-07-01T004157.037474Z"></a>
+2010-07-01T00:41:57.037474Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Use the new 'regression' username in the clusterpush script.
+reapply 11457</pre>
+<p>[base/gs_dll_call.h]</p>
+</blockquote>
 
-This corrects what looks like an inadvertent commit of an older version
-in r10461.
+<p><strong><a name="2010-07-01T004043.889090Z"></a>
+2010-07-01T00:40:43.889090Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+reapply 11456</pre>
+<p>[base/gp_unifn.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-01T003616.428446Z"></a>
+2010-07-01T00:36:16.428446Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+reapply 11454 for outdated config.guess config.sub. see original commit log</pre>
+<p>[jpeg/config.guess jpeg/config.sub]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-01T003305.624689Z"></a>
+2010-07-01T00:33:05.624689Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+typo that causes linker error if one does not do make clean between builds</pre>
+<p>[base/lib.mak]</p>
+</blockquote>
+
+<p><strong><a name="2010-07-01T000022.982087Z"></a>
+2010-07-01T00:00:22.982087Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+reapply r11455 - see original commit log for details</pre>
+<p>[base/gdevxcmp.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-30T233411.835858Z"></a>
+2010-06-30T23:34:11.835858Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+security patch from Werner Fink, to disable loading init files from group/world-writable directories - bug 691350</pre>
+<p>[psi/zfile.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-30T221202.295636Z"></a>
+2010-06-30T22:12:02.295636Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Initialize profile member variables that are part of serialization.  Fix for Bug 691433
+	
+
 </pre>
-<p>[toolbin/localcluster/clusterpush.pl]</p>
+<p>[base/gsicc_manage.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-08T063151.930815Z"></a>
-2009-12-08T06:31:51.930815Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-29T180629.735123Z"></a>
+2010-06-29T18:06:29.735123Z Henry Stiles</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning. Don't assign a value to a variable if it isn't used.
+remove obsolete clusterpush scripts.
 </pre>
-<p>[psi/imainarg.c]</p>
+<p>[/trunk/ghostpdl/tools/clusterpush.sh toolbin/clusterpush.sh]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-08T033305.781180Z"></a>
-2009-12-08T03:33:05.781180Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-29T171745.269232Z"></a>
+2010-06-29T17:17:45.269232Z Henry Stiles</strong></p>
 <blockquote>
 <pre>
-Fix Coverity warnings caused by a recurring error in opvp driver where
-'if (i &gt; sizeof(foo)/sizeof(*foo)) ...' was used to prevent out-of-bounds
-access to foo[i] .
+revert back to 11450.
 </pre>
-<p>[contrib/opvp/gdevopvp.c]</p>
+<p>[/trunk/ghostpdl/main/pcl6_gcc.mak libpng/pngrtran.c libpng/scripts/makefile.gcmmx base/ugcclib.mak libpng/contrib/pngminim/encoder/gather.sh /trunk/ghostpdl/xps/xpspath.c base/unix-gcc.mak libpng/scripts/makefile.sgi base/gp_unifn.c base/macos-mcp.mak libpng/scripts/makefile.sco libpng/scripts/makefile.hpgcc /trunk/ghostpdl/main/pcl6_msvc.mak libpng/KNOWNBUG libpng/projects/xcode/libpng.xcodeproj/project.pbxproj libpng/scripts/pngos2.def base/macosx.mak libpng/scripts/makefile.nommx libpng/scripts/makefile.linux jpeg/config.guess base/unixansi.mak libpng/pngmem.c base/msvclib.mak libpng/png.c libpng/contrib/pngminim/decoder/gather.sh libpng/scripts/makefile.64sunu jpeg/config.sub libpng/scripts/libpng-config-head.in libpng/scripts/makefile.elf libpng/png.h base/lib.mak libpng/CMakeLists.txt libpng/pngrio.c libpng/Y2KINFO libpng/pngpread.c libpng/scripts/makefile.netbsd /trunk/ghostpdl/xps/xps_msvc.mak libpng/pngwio.c libpng/pngrutil.c libpng/scripts/makefile.hpux libpng/scripts/makefile.darwin libpng/scripts/makefile.sggcc /trunk/ghostpdl/xps/xpsglyphs.c libpng/README doc/Make.htm libpng/contrib/pngminim/decoder/makefile libpng/scripts/makefile.32sunu libpng/libpngpf.3 libpng/scripts/makefile.solaris-x86 /trunk/ghostpdl/language_switch/pspcl6_msvc.mak libpng/libpng-1.2.42.txt libpng/contrib/pngminim/preader/makefile libpng/libpng-1.2.44.txt libpng/scripts/makefile.solaris base/Makefile.in libpng/pngwtran.c libpng/contrib/pngminim/preader/gather.sh /trunk/ghostpdl/xps/xpstile.c /trunk/ghostpdl/xps/xpsgradient.c libpng/scripts/makefile.hp64 base/gs_dll_call.h libpng/scripts/makefile.aix libpng/scripts/makefile.mingw libpng/scripts/png32ce.def /trunk/ghostpdl/common/msvc_top.mak libpng/scripts/makefile.beos base/watclib.mak /trunk/ghostpdl/xps/xpsopacity.c libpng/scripts/makefile.ne12bsd libpng/pngread.c /trunk/ghostpdl/xps/xpspage.c libpng/scripts/pngw32.def libpng/pngget.c libpng/INSTALL libpng/scripts/makefile.cegcc libpng/CHANGES libpng/contrib/pngminim/encoder/makefile libpng/libpng.3 libpng/example.c libpng/projects/wince.txt base/bcwin32.mak libpng/scripts/makefile.so9 libpng/pngconf.h libpng/pngwrite.c libpng/pngset.c libpng/LICENSE libpng/png.5 libpng/pngwutil.c base/openvms.mak base/gdevxcmp.c libpng/scripts/makefile.openbsd libpng/scripts/makefile.dec base/watcw32.mak base/unix-dll.mak libpng/scripts/README.txt libpng/scripts/makefile.cygwin psi/msvc32.mak libpng/pngtest.c libpng/ANNOUNCE /trunk/ghostpdl/xps/xpsimage.c libpng/scripts/libpng.pc.in]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-08T033218.888688Z"></a>
-2009-12-08T03:32:18.888688Z regression</strong> (<a href="Details.htm#2009-12-08T033218.888688Z">details</a>)</p>
+<p><strong><a name="2010-06-29T070829.009258Z"></a>
+2010-06-29T07:08:29.009258Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Improve the node failure job reallocation logic.
+more cygwin/mingw-related patches from Jan Nieuwenhuizen (lilypond/gub) ; this one depends on features of GNU make, so it is added as comments to avoid breaking build with non-GNU make</pre>
+<p>[base/unix-dll.mak]</p>
+</blockquote>
 
-</pre>
-<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/clusterpush.pl toolbin/localcluster/run.pl toolbin/localcluster/compare.pl]</p>
+<p><strong><a name="2010-06-29T070545.877229Z"></a>
+2010-06-29T07:05:45.877229Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+avoid re-define _Windows if it is already defined; one of the cygwin/mingw-related patches from Jan Nieuwenhuizen (lilypond/gub)</pre>
+<p>[base/gs_dll_call.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-08T004259.473070Z"></a>
-2009-12-08T00:42:59.473070Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-29T070425.796552Z"></a>
+2010-06-29T07:04:25.796552Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning. Avoid a FILE pointer leak in an unlikely
-case when gs_main_init2() fails.
+cygwin is one platform which uses the unix file name interface but is sensitive to binary/text mode; one of the cygwin/mingw-related patches from Jan Nieuwenhuizen (lilypond/gub)</pre>
+<p>[base/gp_unifn.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-29T064759.438186Z"></a>
+2010-06-29T06:47:59.438186Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+gx_device_has_color() was changed 8 years ago in the deviceN commit (r2925),
+from just color_info.numcomponents &gt; 1 to 
+|| (dev)-&gt;color_info.gray_index == GX_CINFO_COMP_NO_INDEX .
+
+This has some unfortunate side-effect for continuous tone gray devices which
+doesn't support transparency, such as a 8-bit gray X11 display, which goes
+down the wrong code path. These are quite rare so it took 7 years for the bug 
+(bug 690428) to be seen.
+
 </pre>
-<p>[psi/imainarg.c]</p>
+<p>[base/gdevxcmp.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-07T154953.218004Z"></a>
-2009-12-07T15:49:53.218004Z Ken Sharp</strong> (<a href="Details.htm#2009-12-07T154953.218004Z">details</a>)</p>
+<p><strong><a name="2010-06-29T060526.121392Z"></a>
+2010-06-29T06:05:26.121392Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI) : Ignore some TrueType faults
+updating jpeg config.sub config.guess to that from libpng 1.2.44; bug 690486</pre>
+<p>[jpeg/config.guess jpeg/config.sub]</p>
+</blockquote>
 
-</pre>
-<p>[psi/fapi_ft.c]</p>
+<p><strong><a name="2010-06-29T053019.407679Z"></a>
+2010-06-29T05:30:19.407679Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+apply diff between stock 1.2.42 &lt;-&gt; 1.2.44 to upgrade to libpng 1.2.44 - bug fixes - CVE-2010-1205</pre>
+<p>[libpng/pngrtran.c libpng/scripts/makefile.gcmmx libpng/contrib/pngminim/encoder/gather.sh libpng/scripts/makefile.sgi libpng/scripts/makefile.sco libpng/scripts/makefile.hpgcc libpng/KNOWNBUG libpng/projects/xcode/libpng.xcodeproj/project.pbxproj libpng/scripts/pngos2.def libpng/scripts/makefile.nommx libpng/scripts/makefile.linux libpng/pngmem.c libpng/png.c libpng/contrib/pngminim/decoder/gather.sh libpng/scripts/makefile.64sunu libpng/scripts/makefile.elf libpng/scripts/libpng-config-head.in libpng/png.h libpng/CMakeLists.txt libpng/pngrio.c libpng/pngpread.c libpng/Y2KINFO libpng/scripts/makefile.netbsd libpng/pngwio.c libpng/pngrutil.c libpng/scripts/makefile.hpux libpng/scripts/makefile.darwin libpng/scripts/makefile.sggcc libpng/README libpng/contrib/pngminim/decoder/makefile libpng/scripts/makefile.32sunu libpng/libpngpf.3 libpng/scripts/makefile.solaris-x86 libpng/libpng-1.2.42.txt libpng/libpng-1.2.44.txt libpng/contrib/pngminim/preader/makefile libpng/scripts/makefile.solaris libpng/pngwtran.c libpng/contrib/pngminim/preader/gather.sh libpng/scripts/makefile.mingw libpng/scripts/makefile.aix libpng/scripts/makefile.hp64 libpng/scripts/png32ce.def libpng/scripts/makefile.beos libpng/scripts/makefile.ne12bsd libpng/pngread.c libpng/scripts/pngw32.def libpng/pngget.c libpng/INSTALL libpng/scripts/makefile.cegcc libpng/CHANGES libpng/contrib/pngminim/encoder/makefile libpng/libpng.3 libpng/projects/wince.txt libpng/example.c libpng/scripts/makefile.so9 libpng/pngwrite.c libpng/pngconf.h libpng/pngset.c libpng/LICENSE libpng/png.5 libpng/pngwutil.c libpng/scripts/makefile.openbsd libpng/scripts/makefile.dec libpng/scripts/README.txt libpng/scripts/makefile.cygwin libpng/pngtest.c libpng/ANNOUNCE libpng/scripts/libpng.pc.in]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-07T054636.982240Z"></a>
-2009-12-07T05:46:36.982240Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-29T052507.282125Z"></a>
+2010-06-29T05:25:07.282125Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning. Add missing assignment to 'code' variable. The later
-use of 'code' in the conditional expression indicates that this was the
-author's intention. 
+change documentation as --enable-dynamics is no longer required for &quot;make so&quot; to work</pre>
+<p>[doc/Make.htm]</p>
+</blockquote>
 
-</pre>
-<p>[base/gsfont.c]</p>
+<p><strong><a name="2010-06-29T052009.043972Z"></a>
+2010-06-29T05:20:09.043972Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+split lcms code build into arch-specific targets; try to make both windows inline assembly and unix &quot;make so&quot; work simultaneously; bug 691427</pre>
+<p>[base/watclib.mak base/lib.mak base/bcwin32.mak base/openvms.mak base/ugcclib.mak base/macosx.mak base/watcw32.mak base/Makefile.in base/unix-gcc.mak base/unixansi.mak psi/msvc32.mak base/macos-mcp.mak base/msvclib.mak]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-06T191208.897785Z"></a>
-2009-12-06T19:12:08.897785Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-29T051638.524502Z"></a>
+2010-06-29T05:16:38.524502Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning. Add missing assignment to 'code' variable. The later
-use of 'code' in the conditional expression indicates that this was the
-author's intention. 
+move the DYNAMIC_* defines out of the --enable-dynamic condition so that it applies generally; try to &quot;make so&quot; work with just ./configure ; many bugs ask for make so to work</pre>
+<p>[base/configure.ac]</p>
+</blockquote>
 
-</pre>
-<p>[base/gxttfb.c]</p>
+<p><strong><a name="2010-06-29T043410.440639Z"></a>
+2010-06-29T04:34:10.440639Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+switch autoconf png test away from testing for a soon-to-be-obsolete routine to one we actually use, to smooth over the libpng 1.2.x to 1.4.x transition; bug 691111</pre>
+<p>[jbig2dec/configure.ac base/configure.ac]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-06T145558.088044Z"></a>
-2009-12-06T14:55:58.088044Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-29T041547.742872Z"></a>
+2010-06-29T04:15:47.742872Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning. Check the return code from sget_variable_uint()
-in image4 serialization.
+make --disable-fontconfig imples --disable-cairo; bug 690690</pre>
+<p>[base/configure.ac]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-29T040453.158322Z"></a>
+2010-06-29T04:04:53.158322Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+tries to remove empty *obj/*bin directories when invoking &quot;make distclean&quot;; bug 690871</pre>
+<p>[base/unix-end.mak base/Makefile.in base/unix-dll.mak base/unix-gcc.mak base/unixansi.mak]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-29T034817.519902Z"></a>
+2010-06-29T03:48:17.519902Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+check for GNU sed and switch to alternative sed options if sed is non-GNU; bug 691292</pre>
+<p>[cups/pstopxl.in base/configure.ac]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-29T034430.895095Z"></a>
+2010-06-29T03:44:30.895095Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+Part 2 of update (new files) posted to 687983, corrected for current svn HEAD.</pre>
+<p>[contrib/pscolor/black.pdf contrib/pscolor/color.pdf contrib/pscolor/colorsplit.vcproj contrib/pscolor/black.ps contrib/pscolor/color.ps contrib/pscolor/common.mak contrib/pscolor/input.ps contrib/pscolor/windows.mak]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-29T034118.718227Z"></a>
+2010-06-29T03:41:18.718227Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+Part 1 of the update (modifications to checked-in files) 
+to the pscolor code posted in 687983, corrected for current svn head.
+
 </pre>
-<p>[base/gximage4.c]</p>
+<p>[contrib/pscolor/Makefile contrib/pscolor/test.c contrib/pscolor/instream.yy]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-06T022136.356914Z"></a>
-2009-12-06T02:21:36.356914Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-29T033846.508455Z"></a>
+2010-06-29T03:38:46.508455Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning and improve readability. Don't define a local variable
-with the same name as a function argument.
+ijs communication should be all binary; left-over uncommitted patch from past ijs-related work</pre>
+<p>[ijs/ijs_server_example.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-29T033445.878285Z"></a>
+2010-06-29T03:34:45.878285Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+implements ./configure --with-ufst=UFST_ROOT_DIR ; bug 691293</pre>
+<p>[doc/Make.htm base/Makefile.in base/configure.ac]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-29T023238.254860Z"></a>
+2010-06-29T02:32:38.254860Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Removal of static prototype that has no function.</pre>
+<p>[base/gsicc_cache.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-29T005032.521441Z"></a>
+2010-06-29T00:50:32.521441Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Fix lack of end-of-line in file.</pre>
+<p>[base/gsicc_littlecms.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-28T150431.998704Z"></a>
+2010-06-28T15:04:31.998704Z Henry Stiles</strong></p>
+<blockquote>
+<pre>
+Fix a typo, thanks to Ken for spotting this in review.
 </pre>
-<p>[psi/ziodevsc.c]</p>
+<p>[base/gxpcmap.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-06T005638.018707Z"></a>
-2009-12-06T00:56:38.018707Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-28T105053.201708Z"></a>
+2010-06-28T10:50:53.201708Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning and improve portability. Don't access sequential
-members of a structure as an array.
+Warnings of problems within lcms only occur now in debug mode.  Fix for Bug 691401</pre>
+<p>[base/gsicc_littlecms.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-28T051659.820980Z"></a>
+2010-06-28T05:16:59.820980Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Interface with lcms so that the memory allocators make use of ghostscript's allocator.  This required fixing a few bugs in littlecms where he was using free instead of _cmsFree and also having lcms.h provide the prototypes if the external mem alloc is defined.  Performed cluster push with no problem.  Thanks to Henry for helping me track down a 64 bit issue.</pre>
+<p>[lcms/include/lcms.h base/lib.mak lcms/src/cmslut.c base/lcms.mak lcms/src/cmsio1.c base/gsicc_littlecms.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-26T200613.718954Z"></a>
+2010-06-26T20:06:13.718954Z Henry Stiles</strong></p>
+<blockquote>
+<pre>
+The ad hoc gstate setup for patterns should not call grestore after
+gsave when erasing colored patterns because it results in
+&quot;wraparound&quot;, creating another gstate (no saved gstate exists when the
+pattern is painted), see gsstate.c:gs_grestore() vs
+gsstate.c:gs_grestore_only().  Thanks to Ken Sharp for noticing the the
+extra gstate.  No expected differences.
 </pre>
-<p>[psi/zht1.c]</p>
+<p>[base/gxpcmap.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-05T231032.160743Z"></a>
-2009-12-05T23:10:32.160743Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-26T175906.494303Z"></a>
+2010-06-26T17:59:06.494303Z Henry Stiles</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning. Change the logic in obj_cvs() to handle all possible
-combinations and avoid a potential SEGV.
+This file should have been checked in with revision 11433 which will
+not compile without this change.
+</pre>
+<p>[base/gdevpxat.h]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-25T120050.643763Z"></a>
+2010-06-25T12:00:50.643763Z Chris Liddell</strong></p>
+<blockquote>
+<pre>
+Provide more robust behaviour when FT fails to render a glyph. Inistead of silently continuing when FT errors on a glyph, we'll now attempt to use the notdef, if the notdef triggers an error, we signal the error to the GS world. This ensures that any time we expect processing to continue there is valid glyph information available to the cache and other downstream devices.
+
+This causes one regression difference with 34_all.PS, where an extra TTF notdef is rendered.
+
+Bug 691416</pre>
+<p>[psi/fapi_ft.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-24T071111.011423Z"></a>
+2010-06-24T07:11:11.011423Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Remove a couple of currently unused variables to silence a harmless compiler warning.
 </pre>
-<p>[psi/iutil.c]</p>
+<p>[base/gdevpsft.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-05T192142.203093Z"></a>
-2009-12-05T19:21:42.203093Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-23T171440.891928Z"></a>
+2010-06-23T17:14:40.891928Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning and a potential SEGV caused by a wrong pointer
-checked for NULL after memory allocation.
+Simplify and fix the implementation of operator --mul--, which mishandled 
+some cases like &quot;16#80000000 -1 mul&quot;. Bug 691412.
+</pre>
+<p>[psi/zarith.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-23T155639.786311Z"></a>
+2010-06-23T15:56:39.786311Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+This patch adds limited support for TrueType collection fonts to pdfwrite and ps2write.
+
+In the PostScript world TTC fonts are never passed down to pdfwrite, we only ever see
+TrueType fonts. XPS, however, can pass back TrueType collection SNFTS data. This patch
+uses the first font from the TrueType collection and writes that to the output file.
+This may be too limited and may require further work in future.
+
 </pre>
-<p>[psi/zfcid1.c]</p>
+<p>[base/gdevpsft.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-05T172701.175245Z"></a>
-2009-12-05T17:27:01.175245Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-23T143308.852324Z"></a>
+2010-06-23T14:33:08.852324Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning. Remove dead and commented out code that didn't
-change since April 2000, rev 324.
+Fix for bug691415.  When equivalent ICC profile is already created we should just use it.  Thanks to Ken for getting the details together.</pre>
+<p>[base/gscsepr.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-23T050213.734047Z"></a>
+2010-06-23T05:02:13.734047Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Fix for 691359. Problem tracked down by Alex.  
+
+What lcms is trying to do is to figure out the best prelinearization for the incoming data prior to doing the CLUT interpolation.  In the case when the input is RGB based and the output Gray, lcms was using uninitialized data in constructing is prelinearization.
+
+Tangentially related, there could still be problems with what lcms is doing here if the number of Input channels is 1 and the number of Output channels is 3.  In that case, it is possible (but not likely) that I could have radically different gamma behavior in each of the RGB channels.  Trans in such a case would be constructed based upon only one curve based on the red channel.   In the real world, this is probably not a problem but ideally it would be optimal to use something that provides the best prelinearization in all three channels.  That is an optimization for Marti to do and perhaps is already in lcms2.</pre>
+<p>[lcms/src/cmsgmt.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-22T145459.999510Z"></a>
+2010-06-22T14:54:59.999510Z Henry Stiles</strong></p>
+<blockquote>
+<pre>
+Erase patterns with the color white instead of filling the pattern
+bitmap with 0 or 255.  
+
+Previously the initialization was only used when anti aliasing was
+enabled, now initial erasing is done for all colored patterns,
+eliminating a long standing UMR in the pcl code where the pattern was
+combined with the destination/source with indeterminate results.  The
+UMR manifested in frequent regression reports in the pcl tests
+(c321.bin for example), these reports should go away with this change,
+though (NB) the change only masks the underlying issue.
+
 </pre>
-<p>[psi/zfcmap.c]</p>
+<p>[psi/zpcolor.c base/gxpcmap.c base/gxpcolor.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-04T155208.152428Z"></a>
-2009-12-04T15:52:08.152428Z Ken Sharp</strong> (<a href="Details.htm#2009-12-04T155208.152428Z">details</a>)</p>
+<p><strong><a name="2010-06-22T061254.377174Z"></a>
+2010-06-22T06:12:54.377174Z Masaki Ushizaka</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI) : empty glyphs causing problems after revision 10434
+Fix for bug 689836 and 691248.
 
+Bug 689836 - Huffman tables with only positive values are decoded incorrectly
+Bug 691248 - jbig2dec doesn't handle 042_11 (Huffman Symbol Region)
+
+This patch fixes mulfunctions seen on standard huffman table K, L, M and N.
+A difference will be seen on tests_private/comparefiles/Bug690360.pdf.
+This file was affected by table K mulfunction and this is a improvement.
+
 </pre>
-<p>[psi/zfapi.c]</p>
+<p>[jbig2dec/jbig2_hufftab.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-04T153803.727531Z"></a>
-2009-12-04T15:38:03.727531Z Ken Sharp</strong> (<a href="Details.htm#2009-12-04T153803.727531Z">details</a>)</p>
+<p><strong><a name="2010-06-22T060012.605983Z"></a>
+2010-06-22T06:00:12.605983Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI) : TT tables &gt; 64Kb not read properly.
+Revert rev. 7964 and use a different approach: allocate all structures
+and proceed with their initialization only if all allocations were
+successful. Fix memory corruption that happens at the PostScript
+stack overflow. Bug 691295.
+</pre>
+<p>[psi/idosave.h psi/ialloc.c psi/isave.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-22T055923.952778Z"></a>
+2010-06-22T05:59:23.952778Z Masaki Ushizaka</strong></p>
+<blockquote>
+<pre>
+Added test code for every line of each standard huffman tables.
+
 </pre>
-<p>[psi/zfapi.c]</p>
+<p>[jbig2dec/jbig2_huffman.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-04T035110.377640Z"></a>
-2009-12-04T03:51:10.377640Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-22T051553.089456Z"></a>
+2010-06-22T05:15:53.089456Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Rearrange JP2 color space processing code to facilitate experiments with
-enumerated color spaces.
+Add a /.notdef entry to /CharStrings dictionary if it's missing from an
+embedded Type1 font. Bug 691406, customer 130.
+</pre>
+<p>[Resource/Init/pdf_font.ps]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-21T164155.147464Z"></a>
+2010-06-21T16:41:55.147464Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Removal of improper error message.  Source of a potential access violation.</pre>
+<p>[base/gsicc_manage.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-21T150703.992218Z"></a>
+2010-06-21T15:07:03.992218Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Add the 'gs_error_Remap_Color' pseudo-error, a duplicate -f e_Remap_Color in the
+PostScript interpreter, to the 'base' error list so that PDL clients other than
+PostScript can make use of it for high-level pattern support.
 </pre>
-<p>[Resource/Init/pdf_draw.ps]</p>
+<p>[base/gserrors.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-04T003304.330450Z"></a>
-2009-12-04T00:33:04.330450Z Robin Watts</strong></p>
+<p><strong><a name="2010-06-21T011418.832712Z"></a>
+2010-06-21T01:14:18.832712Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Extend ghostscript graphics library with the capability to handle different
-start, end and dash caps.
+auto-detect host as *BSD and use a differently named obj directory; no effect on non-*BSDs. fixes bug 687214</pre>
+<p>[base/Makefile.in base/configure.ac]</p>
+</blockquote>
 
-The existing gs_setlinecap function sets all 3 caps in lockstep, so no change
-with current code. New functions gs_setlinestartcap, gs_setlineendcap,
-gs_setlinedashcap set the different cap styles.
+<p><strong><a name="2010-06-21T003243.898825Z"></a>
+2010-06-21T00:32:43.898825Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+adding more borland-related build tips; part of borland build fixes (bug 691400)</pre>
+<p>[doc/Make.htm]</p>
+</blockquote>
 
-The dashing code now leaves segment notes in the output path to inform the
-choice of which caps to use. The stroking code is updated to honours these
-notes.
+<p><strong><a name="2010-06-21T001242.541103Z"></a>
+2010-06-21T00:12:42.541103Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+got some garbage in the beginning of the file introduced in an earlier commit</pre>
+<p>[doc/Install.htm]</p>
+</blockquote>
 
-gxclpath.c and gdevvec.c assume that all caps are the same as start_cap.
-Check that this is valid.
+<p><strong><a name="2010-06-21T000112.712437Z"></a>
+2010-06-21T00:01:12.712437Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+nsis-based installer script, makefile adaptation, documentation update; bug 691363</pre>
+<p>[psi/winint.mak doc/Release.htm psi/nsisinst.nsi doc/Install.htm]</p>
+</blockquote>
 
-</pre>
-<p>[base/gsstate.c base/gxclpath.c base/gxline.h base/gxpdash.c base/gxpath.h base/gdevpdtt.c base/gsline.c base/gdevvec.c base/gdevpdfg.c base/gsline.h base/gxstroke.c base/gxclrast.c]</p>
+<p><strong><a name="2010-06-20T233847.757390Z"></a>
+2010-06-20T23:38:47.757390Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+borland build fix (bug 691400): borland defines P_tmpdir but not _P_tmpdir; similiar difference between borlandc and msvc has been seen with setmode/_setmode in the ijs code in ijs/ijs_server.c</pre>
+<p>[jasper/src/libjasper/base/jas_stream.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-03T192112.315688Z"></a>
-2009-12-03T19:21:12.315688Z Marcos H. Woehrmann</strong></p>
+<p><strong><a name="2010-06-20T233224.162240Z"></a>
+2010-06-20T23:32:24.162240Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-I missed a file that should have been part of the r10440 commit.
-</pre>
-<p>[toolbin/localcluster/clusterpull.sh]</p>
+borland build fix (bug 691400): update and complete documentation on working around for too-many-warnings-equal-error problem of borland c++</pre>
+<p>[doc/Make.htm]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-03T191412.694527Z"></a>
-2009-12-03T19:14:12.694527Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-20T232934.775566Z"></a>
+2010-06-20T23:29:34.775566Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning by removing redindant checks. The 'pie' pointer cannot
-be null here because it is dereferenced earlier.
+borland fix (bug 691400): Borland c++ does not support c99 LL nor ULL, but use i64/ui64 like MSVC for 64-bit integer literals</pre>
+<p>[base/sha2.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-20T231137.618908Z"></a>
+2010-06-20T23:11:37.618908Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+ 4 borland build fixes (bug 691400):
+
+- hook up libtiff
+- build mkromfs
+- build import library *.lib corresponding to the dll
+- build the split-out make_filelist (see also r11388 for Bug 691302,
+which does it for msvc)
+
 </pre>
-<p>[psi/zimage.c]</p>
+<p>[base/bcwin32.mak]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-03T173038.929684Z"></a>
-2009-12-03T17:30:38.929684Z Robin Watts</strong></p>
+<p><strong><a name="2010-06-20T230349.551572Z"></a>
+2010-06-20T23:03:49.551572Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Remove stray (incorrect) initialisation. This removes a &quot;removing const&quot;
-warning.
+borland build does not create the obj and bin directories. part of borland build fix (691400)</pre>
+<p>[base/bcwin32.mak]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-20T225732.647408Z"></a>
+2010-06-20T22:57:32.647408Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+defines a unix target, since win32 requires specific compiler flags; HP-UX make/MS nmake both issues a warning and borland make issues an error for duplicate targets; fixes bug 691337, and also part of the problems with borland build (bug 691400)</pre>
+<p>[base/libtiff.mak]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-20T034503.823204Z"></a>
+2010-06-20T03:45:03.823204Z Alex Cherepanov</strong></p>
+<blockquote>
+<pre>
+Fix malformed ICC profile generation on big endian systems, which was caused
+by confusion between internal and external representation of an integer.
 </pre>
-<p>[base/gdevpdfe.c]</p>
+<p>[base/gsicc_create.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-03T161800.535689Z"></a>
-2009-12-03T16:18:00.535689Z Marcos H. Woehrmann</strong></p>
+<p><strong><a name="2010-06-20T030150.289956Z"></a>
+2010-06-20T03:01:50.289956Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Improved cluster reliability (automatically reset stale nodes, move
-watchdog from cron to run.pl, check for periodic transfer, etc.).
+Don't leave wild bytes at the end of a generated ICC profile. Fix Valgrind
+warnings and spurious hash value differences.
+</pre>
+<p>[base/gsicc_create.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-18T235923.662717Z"></a>
+2010-06-18T23:59:23.662717Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Fix so that when the CIE color spaces are released, the icc equivalent space is also rc decremented as is the profile.</pre>
+<p>[base/gscscie.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-18T180659.517404Z"></a>
+2010-06-18T18:06:59.517404Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Fix for memory leak in creation of icc profile from def(g) objects.</pre>
+<p>[base/gsicc_create.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-18T020013.716745Z"></a>
+2010-06-18T02:00:13.716745Z Alex Cherepanov</strong></p>
+<blockquote>
+<pre>
+Use operator --search-- instead of --token-- during PDF rebuilding
+to reduce the load on the name table, slightly improve the speed, and
+work around the bug 691005 in a few cases.
 </pre>
-<p>[toolbin/localcluster/clustermonitor.pl toolbin/localcluster/clustermaster.pl toolbin/localcluster/run.pl]</p>
+<p>[Resource/Init/pdf_rbld.ps]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-03T060839.915454Z"></a>
-2009-12-03T06:08:39.915454Z Ray Johnston</strong></p>
+<p><strong><a name="2010-06-17T202333.279930Z"></a>
+2010-06-17T20:23:33.279930Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Add argument list and 'minst' address to -Z: debugging report to assist in tracking
-cluster test logs (to see which, if any, jobs start but don't finish).
+adjust self-reference of bswin32.mak to correct location. Part 1 of fix to bug 691400</pre>
+<p>[base/bcwin32.mak]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-17T200330.325885Z"></a>
+2010-06-17T20:03:30.325885Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+mentioning -P-/-P and further reference to the INITIALIZATION FILES and Use.htm in the man page. bug 691350</pre>
+<p>[man/gs.1]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-17T194605.887718Z"></a>
+2010-06-17T19:46:05.887718Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+add missing type def for gsicc_create_mashed_clut</pre>
+<p>[base/gsicc_create.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-17T193839.362075Z"></a>
+2010-06-17T19:38:39.362075Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+split make_filelist functionality out of setupgs, to allow UAC restriction during packaging of the installer. Bug 691302</pre>
+<p>[psi/dwsetup.cpp psi/winint.mak psi/msvc32.mak psi/mkfilelt.cpp]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-17T193128.160475Z"></a>
+2010-06-17T19:31:28.160475Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+add info about silent batch installation; bug 691268</pre>
+<p>[doc/Install.htm]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-17T192820.229863Z"></a>
+2010-06-17T19:28:20.229863Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+rc_decrement any icc objects that may exist in the imager state that was created for handling the conversion from PS CIE objects to ICC profiles.</pre>
+<p>[base/gscie.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-17T180435.295987Z"></a>
+2010-06-17T18:04:35.295987Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Free up tag list when done creating icc profile from PDF cal type.</pre>
+<p>[base/gsicc_create.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-17T171334.616951Z"></a>
+2010-06-17T17:13:34.616951Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Change to help track down any memory leaks related to the new icc code.  Also fix so that gs_init_iccmanager copies the null character from the default profile string names.  There was a mismatch between what happened here and what happens when the default user params are set.  This was causing the profiles to reset in the manager when they did not need to be.</pre>
+<p>[base/gsicc_manage.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-17T092018.689467Z"></a>
+2010-06-17T09:20:18.689467Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Fix (FAPI) move two FAPI related members from the show enumerator structure to the text
+enumerator structure. This ensures that these members are always available for rendering
+and eliminates a GPF caused when a device's text_begin method returns a text enumerator 
+rather than the show enumerator returned by gx_default_text_begin.
+
+No differences expected.
 </pre>
-<p>[psi/imain.c psi/imainarg.c]</p>
+<p>[base/gxchar.h base/gxtext.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-03T000230.276576Z"></a>
-2009-12-03T00:02:30.276576Z Hin-Tak Leung</strong></p>
+<p><strong><a name="2010-06-16T061125.298134Z"></a>
+2010-06-16T06:11:25.298134Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-send images with Interpolate=true back to gx_default.
+a few more CRLF eol and svn property corrections</pre>
+<p>[zlib/contrib/dotzlib/LICENSE_1_0.txt zlib/contrib/vstudio/readme.txt zlib/contrib/masmx64/readme.txt base/gsicc_cache.h base/gsicc_manage.c base/gsicc_manage.h zlib/projects/visualc6/README.txt zlib/contrib/dotzlib/readme.txt]</p>
+</blockquote>
 
-comparefiles/148-01.ps have a few Type 1 images with
-&lt;&lt;Interpolate true&gt;&gt; are not rendered with Interpolate.
+<p><strong><a name="2010-06-15T171715.944441Z"></a>
+2010-06-15T17:17:15.944441Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Rename of a few functions to match documentation, update of gdevwts.c to use new color architecture, addition of minor utility functions for use in gxps.  This should not generate regressions.</pre>
+<p>[base/lib.mak base/gsicc_littlecms.h base/gsicc_cache.h base/gsicc_manage.c base/gscms.h base/gdevwts.c base/gsicc_manage.h base/gsicc_littlecms.c]</p>
+</blockquote>
 
-Since pxlcolor/pxlmono cannot do Interpolate within, 
-and has no code to do such thing, the correct solution 
-is simply detect such images and use gx_default_*. Fixes bug 690970.
+<p><strong><a name="2010-06-15T165440.171304Z"></a>
+2010-06-15T16:54:40.171304Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Update of Color Architecture document in preparation for release of GS 9.0</pre>
+<p>[doc/Color_Architecture.tex doc/figures/XPS_Integer_Gray_RGB_Image.eps doc/figures/Overview.eps doc/figures/XPS_DeviceN.eps doc/figures/PDF_Render.eps doc/figures/XPS_Render.eps doc/GS9_Color_Management.pdf doc/figures/XPS_Vector_Color.eps doc/figures/XPS_RGB_Image_Float.eps doc/figures/PS_Spec.eps doc/Color_Architecture.pdf doc/GS9_Color_Management.tex doc/figures/PS_Render.eps doc/figures/PDF_Spec.eps]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-14T231027.633844Z"></a>
+2010-06-14T23:10:27.633844Z Henry Stiles</strong></p>
+<blockquote>
+<pre>
+Modified line endings from CRLF -&gt; LF and propset to native.
 </pre>
-<p>[base/gdevpx.c]</p>
+<p>[base/gsicc_cache.c base/gsicc_cache.h base/gsicc_manage.c base/gsicc_manage.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-02T195705.281734Z"></a>
-2009-12-02T19:57:05.281734Z Marcos H. Woehrmann</strong></p>
+<p><strong><a name="2010-06-14T184247.881614Z"></a>
+2010-06-14T18:42:47.881614Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Improved logic in clusterpush.pl to detect if running from a gs or ghostpdl director.
+Fix yet another case where memcpy() copies a memory block on itself.
+This doesn't cause any problems on Linux or Windows but violates the
+spec and irks Valgrind. Bug 691394.
 </pre>
-<p>[toolbin/localcluster/clusterpush.pl]</p>
+<p>[base/gsline.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-02T142041.078998Z"></a>
-2009-12-02T14:20:41.078998Z Ken Sharp</strong> (<a href="Details.htm#2009-12-02T142041.078998Z">details</a>)</p>
+<p><strong><a name="2010-06-14T180749.834071Z"></a>
+2010-06-14T18:07:49.834071Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI): error in revision 10433
+Remove the &quot;&lt;font&gt; is being rendered with FAPI=&lt;renderer&gt;&quot; messages. But leave a warning if we fall back to the old GS renderer.</pre>
+<p>[Resource/Init/gs_fapi.ps]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-14T111907.131026Z"></a>
+2010-06-14T11:19:07.131026Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Fix (pdfwrite) : limit composite object sizes when producing PDF/A
+
+Bug #691370 &quot;Dictionary size not limited for PDF/A-1&quot;
+
+The PDF/A specification insists that the implementation limitations of Acrobat as
+defined in PDF 1.4 should be followed when producing PDF/A files. Accordingly this
+limits the size of dictionaries to 4095 and arrays to 8191 when producing PDF/A output.
+
+Since there is no way to ignore the problem, setting the PDFACompatibiltyPolicy to 1
+'don't emit the object, carry on producing PDF/A' can't be made to work. Since the 
+user has expressed a desire for an output file, we fall back to Policy 0 'Produce a
+regular PDF file' instead.
+
+Also extend PDFACompatibilityPolicy to include policy 2 'abort'.
+
+No test file for this case, no differences expected.
 </pre>
-<p>[psi/zfapi.c]</p>
+<p>[base/gdevpdfo.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-02T141344.401916Z"></a>
-2009-12-02T14:13:44.401916Z Ken Sharp</strong> (<a href="Details.htm#2009-12-02T141344.401916Z">details</a>)</p>
+<p><strong><a name="2010-06-14T111418.794921Z"></a>
+2010-06-14T11:14:18.794921Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI) : FAPI code not expecting unsorted LOCA/GLYF tables
-
+Extend to PDF/X emission the enhancement in revision 11369 which prevents emitting
+invalid PDF/A files when glyphs are missing from fonts.
 </pre>
-<p>[psi/zfapi.c]</p>
+<p>[base/gdevpdte.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-02T070016.393155Z"></a>
-2009-12-02T07:00:16.393155Z Ray Johnston</strong></p>
+<p><strong><a name="2010-06-14T111240.380849Z"></a>
+2010-06-14T11:12:40.380849Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Fix vertical positioning of interpolated images that caused images to be moved
-down, possibly past the end of the band. An extra multiplication by -1 was the
-culprit. Bug 690885, customers 531 and 850.
+Update the ps2pdf documenataion to reflect the fact that PDF/X-3 conversion now also
+uses the PDFACompatibilityPolicy to control behaviour when a conforming file cannot be
+produced.
 
+Also applied some general grammatical correction to the text.
 </pre>
-<p>[base/gxiscale.c]</p>
+<p>[doc/Ps2pdf.htm]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-01T193906.587717Z"></a>
-2009-12-01T19:39:06.587717Z Robin Watts</strong></p>
+<p><strong><a name="2010-06-14T093417.990404Z"></a>
+2010-06-14T09:34:17.990404Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Fix dropouts seen with thin lines by using the method described in bug 687721,
-namely, that of extending the trapezoids filled by a small triangular region
-at each end.
+Fix (pdfwrite) : Don't emit invalid PDF/A files
 
-Local cluster testing shows 66 changes, of which only 20 or so are real.
-Of these, most are clearly improvements, and the rest are neutral. 
+Bug #691383 &quot;pdfwrite emits invalid PDF/A when glyphs are missing in the input font.&quot;
 
+If the input file references glyphs which are not in the font, then we could emit a
+PDF/A file which also referenced glyph which were not present in the fonts embedded
+in the PDF file.
+
+This patch uses the PDFACompatibilityPolicy to control the action in this case, and
+avoid emitting invalid PDF/A files.
+
+Also extended the functionality of the PDFACompatibilityPolicy to allow the user to 
+abort PDF file production when a valid PDF/A file cannot be produced.
+
+No expected differences as PDF/A production is not tested by regression code.
 </pre>
-<p>[base/gdevddrw.c]</p>
+<p>[base/gdevpdfm.c base/gdevpdte.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-01T191035.168567Z"></a>
-2009-12-01T19:10:35.168567Z Ralph Giles</strong></p>
+<p><strong><a name="2010-06-12T151956.267658Z"></a>
+2010-06-12T15:19:56.267658Z Henry Stiles</strong></p>
 <blockquote>
 <pre>
-Update the clustermonitor cgi script to read the new combined queue 
-file for pending jobs.
+The ICC profile file name buffer was too small to accommodate the
+trailing null appended by strcat resulting in an invalid write to
+memory.
 </pre>
-<p>[toolbin/localcluster/clustermonitor.cgi]</p>
+<p>[base/gsicc_manage.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-01T190827.833775Z"></a>
-2009-12-01T19:08:27.833775Z Ralph Giles</strong></p>
+<p><strong><a name="2010-06-11T172406.899434Z"></a>
+2010-06-11T17:24:06.899434Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Update the clustermonitor cgi script to return regression results.
+In the event of a FreeType error when scaling a font face, don't clean up the FT data, but leave it to the garbage collector
+to call the font object's &quot;finalize&quot; function, which will then clean up the FT data.
 
-This makes use of the CGI module to parse an optional 'report' query
-parameter, which if present, returns a specific regression result
-instead of the default json dashboard status. Current it only supports
-svn jobs, not custom runs submitted through the clusterpush script.
+Secondly, add code to deal with very low resolutions underflowing some of FT's fixed point code (similar to code for small
+scale factors).
 
-Also cleans up the the paths to use a $clusteroot variable for the 
-prefix.
+Bug 691381
 </pre>
-<p>[toolbin/localcluster/clustermonitor.cgi]</p>
+<p>[psi/fapi_ft.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-01T183608.279176Z"></a>
-2009-12-01T18:36:08.279176Z Robin Watts</strong></p>
+<p><strong><a name="2010-06-11T075337.156852Z"></a>
+2010-06-11T07:53:37.156852Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Factor out the miter checking code into a single function rather than having it
-repeated 3 times.
+Fix pdfwrite - device reference counting problem with patterns and XPS
 
-Add a test to the extracted code to spot the case where the cdelta's are too
-small to be reliably used to calculate the correct miter point. In such cases
-revert to using the raw vectors suitably scaled.
+When using XPS as the input PDL, and pdfwrite as the output device, the pdfwrite device
+was counted up by pattern accumulator allocation, but the clist accumulator never
+counted the device down, leading to a reference count &gt; 1 at EOJ. This meant that
+the pdfwrite device wasn't closed, since pdfwrite only emits the PDF file when it is
+closed this led to invalid unfinished PDF files.
 
-Testing reports 69 changes in the regression files, none of which can be
-reproduced locally. This fixes bug 690098.
+The code here modifies the behaviour of the pattern management so that we don't use the 
+'clist' path for accumulating patterns *if* the device can accumulate patterns itself
+*and* the PDL doesn't have_pattern_streams (to avoid pathological PDF file problems)
 
+This resolves the issue with device reference counts and all the FTS XPS files now
+produce complete PDF files.
 </pre>
-<p>[base/gxstroke.c]</p>
+<p>[base/gxpcmap.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-01T180858.973794Z"></a>
-2009-12-01T18:08:58.973794Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-10T161108.241878Z"></a>
+2010-06-10T16:11:08.241878Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning and a potential array overrun in obj_cvp().
+When extracting a path from the FAPI world (for a charpath, for example), only close the path if it has been &quot;opened&quot;.
 
+This prevents empty paths from non-marking glyphs resulting in a point being rendered on the page.
+
+Another part of Bug 691252.
+
+This change causes ~195 differences to be reported on the cluster, but they are all progressions.
+
 </pre>
-<p>[psi/iutil.c]</p>
+<p>[psi/zfapi.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-01T160436.569081Z"></a>
-2009-12-01T16:04:36.569081Z Marcos H. Woehrmann</strong></p>
+<p><strong><a name="2010-06-10T140640.549557Z"></a>
+2010-06-10T14:06:40.549557Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Another clusterpush.pl change that was lost, should have been part of r10421.
+Make the rendering of the Truetype notdef glyph optional with the FAPI interface (as per the previous behaviour).
+
+A few cluster differences are expected as we have test files which use the TTF notdef, I have checked all the differences, and they are correct.
+
+This is part of Bug 691252
+
 </pre>
-<p>[toolbin/localcluster/clusterpush.pl]</p>
+<p>[psi/zfapi.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-01T153715.738865Z"></a>
-2009-12-01T15:37:15.738865Z Marcos H. Woehrmann</strong></p>
+<p><strong><a name="2010-06-09T185909.419344Z"></a>
+2010-06-09T18:59:09.419344Z Robin Watts</strong></p>
 <blockquote>
 <pre>
-Fixed localcluster/clusterpush.pl to work with casper3.
+Update comparerevs.pl script so that it no longer ignores hash values
+on files taht have a non-zero error return. It now only ignores hash
+values on timeouts (because runs can easily produce different numbers of
+pages on each run).
+
+Also, the output is updated to show error values together with hash results.
+Error values are now always in brackets, on a red background.
+
 </pre>
-<p>[toolbin/localcluster/clusterpush.pl]</p>
+<p>[toolbin/localcluster/comparerevs.pl]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-01T090210.394257Z"></a>
-2009-12-01T09:02:10.394257Z Marcos H. Woehrmann</strong></p>
+<p><strong><a name="2010-06-08T162039.058317Z"></a>
+2010-06-08T16:20:39.058317Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-All local cluster jobs are now queued (instead of just user jobs).
-This eliminates a race condition that could have occured if the
-ghostpdl/ghostscript repository is updated after the cluster master
-initiates a cluster run but before the nodes perform the svn update.
-As a side-effect of this change svn commit jobs are not longer given
-priority over user jobs.
+In bytes_copy_rectangle() clamp the length of each row to be copied to the stride of the raster. This takes care of problems copying bitmaps from FT (or potentially other font libraries) which use different alignment to the &quot;internal&quot; rasters. Bug 691328.</pre>
+<p>[base/gsbitops.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-06-08T010410.677952Z"></a>
+2010-06-08T01:04:10.677952Z Alex Cherepanov</strong></p>
+<blockquote>
+<pre>
+Check whether the font has /Encoding before trying to use it. Recent FAPI
+changes give /BuildChar procedure to all fonts including CIDFont resources.
+So the check for non-null pfdata-&gt;BuildChar no longer guaranteed that the
+font has /Encoding. Bug 691311.
 </pre>
-<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/build.pl toolbin/localcluster/clusterpush.pl toolbin/localcluster/run.pl]</p>
+<p>[psi/zchar.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-12-01T034054.743929Z"></a>
-2009-12-01T03:40:54.743929Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-06-07T171420.171809Z"></a>
+2010-06-07T17:14:20.171809Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Fix a Coverity warning about unchecked negative return and a possible
-access to an array at a negative position.
+Fix for Bug 691368.  
 
-</pre>
-<p>[psi/zupath.c]</p>
+lcms appears not to check its handles of link transforms when a profile is released, to clear out xform-&gt;InputProfile.  Probably due to the fact that lcms may not expect a change of the formatters after the link is created.  That would imply that we would need to create links based upon data types, which is not so efficient.  Disable this check in lcms since it is only related to named color profiles, which we will not run into.  Will kick this up to Marti.</pre>
+<p>[lcms/src/cmspack.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-30T233723.019948Z"></a>
-2009-11-30T23:37:23.019948Z Michael Vrhel</strong></p>
+<p><strong><a name="2010-06-06T180036.332831Z"></a>
+2010-06-06T18:00:36.332831Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Fix for bug 690218.   If the SeparationOrder was specified, then we should only allocate buffer space for those colorants.  See devn_put_params for details on this.  Right now, the PDF14 device will always include CMYK.  A future optimization is to be able to NOT have those included in the bufferallocations if we don't specify them.  In that case it would then be possible to output 8 separations at a time without using compressed color.  Note that if SeparationOrder is not specified, the number of colorants used in the pdf14 device buffer allocations is equal to the number of colorants in the document up to a maximum of 64.</pre>
-<p>[base/gstrans.c]</p>
+Fix for Bug 691367.  Seg fault should no longer occur.  If an attempt is made to set a color space in the graphic state and the ICC manager's profiles have not yet been initialized, it will be taken care of.  </pre>
+<p>[base/gsicc_manage.c base/gscspace.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-30T231219.025235Z"></a>
-2009-11-30T23:12:19.025235Z Marcos H. Woehrmann</strong></p>
+<p><strong><a name="2010-06-05T200355.912155Z"></a>
+2010-06-05T20:03:55.912155Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Change from batch job distribution system to polled system.
+Don't copy memory block into itself; clear a Valgrind warning.
 </pre>
-<p>[toolbin/localcluster/splitjobs.pl toolbin/localcluster/clustermaster.pl toolbin/localcluster/build.pl toolbin/localcluster/clusterpush.pl toolbin/localcluster/run.pl]</p>
+<p>[base/gsdparam.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-30T225724.661785Z"></a>
-2009-11-30T22:57:24.661785Z Ray Johnston</strong> (<a href="Details.htm#2009-11-30T225724.661785Z">details</a>)</p>
+<p><strong><a name="2010-06-05T192040.615579Z"></a>
+2010-06-05T19:20:40.615579Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Fix for segfault when image 'clues' are accessed during a GC after a
-restore has erased (set to zero) the contents. Bug 690915.
+Fix for indeterminisms in some PS files where the alternate tint transform color space for a DeviceN or Separation color space is CIE based.  Previously we were  returning either CMYK, or RGB based based upon the channel count for the CIE space.  Now we are returning an equivalent ICC based color space.  Also minor fix for uninitialized memory in generated profile.</pre>
+<p>[base/gscdevn.c base/gsicc_create.c base/gscsepr.c]</p>
+</blockquote>
 
-</pre>
-<p>[base/gxipixel.c]</p>
+<p><strong><a name="2010-06-03T165717.441589Z"></a>
+2010-06-03T16:57:17.441589Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+observe minst-&gt;search_here_first condition in file search; bug 691350</pre>
+<p>[psi/zfile.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-30T203448.913220Z"></a>
-2009-11-30T20:34:48.913220Z Henry Stiles</strong></p>
+<p><strong><a name="2010-06-03T003207.629281Z"></a>
+2010-06-03T00:32:07.629281Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Remove an unnecessary diagnostic debug printf which should not have
-been checked in.  No expected differences.
+Adding -P- and -dSAFER to many POSIX shell scripts, win32 and OS/2 batch scripts; bug 691355</pre>
+<p>[lib/bjc610b4.upp lib/bjc610b6.upp lib/lp386.bat lib/bjc610b7.upp lib/bjc610b8.upp lib/gsndt.bat lib/pdf2dsc lib/eps2eps.bat lib/st640plg.upp lib/ras8m.upp lib/ras24.upp lib/pv.sh lib/bj8oh06n.upp lib/necp2x.upp lib/stc600p.upp lib/pfbtopfa.bat lib/stc640p.upp lib/wftopfa lib/ps2ps lib/stc2s_h.upp lib/stc500ph.upp lib/ps2ps.cmd lib/pphs lib/stcany_h.upp lib/pf2afm lib/gsdj500 lib/dnj750c.upp lib/pf2afm.cmd lib/stc600pl.upp lib/stc800pl.upp lib/gsbj lib/ps2epsi lib/ps2epsi.cmd lib/dnj750m.upp lib/dumphint lib/gsnd lib/font2c lib/gsdj.bat lib/pdfopt lib/ras32.upp lib/ps2ps2.bat lib/pdf2ps lib/ps2pdf.cmd lib/pdf2ps.cmd lib/stc500p.upp lib/cdj690.upp lib/stc600ih.upp lib/st640p.upp lib/stc_h.upp lib/gslj.bat lib/stcany.upp lib/stc800ih.upp lib/bdftops.bat lib/stc_l.upp lib/ras1.upp lib/gslp.bat lib/lpgs.bat lib/st640ihg.upp lib/ras3.upp lib/stc1520h.upp lib/ras4.upp lib/stc300.upp lib/bj8ts06n.upp lib/eps2eps lib/ps2ascii.bat lib/eps2eps.cmd lib/stc2_h.upp lib/pdf2dsc.bat lib/stc.upp lib/stc300bl.upp lib/stc300bm.upp lib/bj8pp12f.upp lib/pfbtopfa lib/stc800p.upp lib/bjc610a0.upp lib/bj8gc12f.upp lib/st640pg.upp lib/bjc610a1.upp lib/cdj690ec.upp lib/bjc610a2.upp lib/ps2ps.bat lib/bjc610a3.upp lib/bjc610a4.upp lib/bjc610a5.upp lib/bj8hg12f.upp lib/stc2.upp lib/st640pl.upp lib/bjc610a6.upp lib/printafm lib/bjc610a7.upp lib/pf2afm.bat lib/gsdj500.bat lib/bjc610a8.upp lib/ps2pdfxx.bat lib/lpr2.bat lib/lp386r2.bat lib/stc200_h.upp lib/unix-lpr.sh lib/gsdj lib/necp2x6.upp lib/ps2ps2 lib/ps2epsi.bat lib/gsbj.bat lib/bj8pa06n.upp lib/ps2ps2.cmd lib/dumphint.bat lib/cdj550.upp lib/gslj lib/gsnd.bat lib/font2c.bat lib/bdftops lib/pdfopt.bat lib/pdf2ps.bat lib/st640ih.upp lib/gslp lib/ps2pdfwr lib/bjc610b1.upp lib/bjc610b2.upp lib/dvipdf lib/ps2ascii lib/bjc610b3.upp lib/pftogsf.bat]</p>
+</blockquote>
+
+<p><strong><a name="2010-06-02T174539.111970Z"></a>
+2010-06-02T17:45:39.111970Z Robin Watts</strong></p>
+<blockquote>
+<pre>
+Introduce new ENABLE_TRAP_AMALGAMATION build define. If set at build time
+then code is introduced to gxfillts.h to try to amalgamate some of the
+rectangles produced into the surrounding trapezoids.
+
+This can cause small rendering differences due to the difference in rounding
+within scan conversion and trap extraction.
+
+The option is disabled by default.
+
+No expected differences with it disabled. 439 non pdfwrite differences, 99
+differences with it enabled.
+
 </pre>
-<p>[base/gsalloc.c]</p>
+<p>[base/gxfillts.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-30T164008.309112Z"></a>
-2009-11-30T16:40:08.309112Z Henry Stiles</strong></p>
+<p><strong><a name="2010-06-02T083707.985901Z"></a>
+2010-06-02T08:37:07.985901Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-New procedure to dump memory chunks with less detail.  This will be
-used by the non garbage collecting client languages to print memory
-leak information at the end of jobs.  No expected differences.
+Revision 11348 accidentally included a number of font definitions in an updated cidfmap, 
+This removes those definitions, which should not be present.
 </pre>
-<p>[base/gsalloc.c]</p>
+<p>[Resource/Init/cidfmap]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-30T090526.245478Z"></a>
-2009-11-30T09:05:26.245478Z Ken Sharp</strong> (<a href="Details.htm#2009-11-30T090526.245478Z">details</a>)</p>
+<p><strong><a name="2010-06-02T082923.801870Z"></a>
+2010-06-02T08:29:23.801870Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI): Can't handle FontBBox as 't_mixedarray'
+Documentation change
+Updated the comments at the head of the file to make it plain that the entries in the
+CSI array must be strings, not names. Although this is clearly documented in use.htm
+we have recently had several reports in which users have been trying to set name values
+in the array. 
 
+Also added a pointer to the documentation as a further hint.
 </pre>
-<p>[psi/zfapi.c]</p>
+<p>[Resource/Init/cidfmap]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-30T024711.189285Z"></a>
-2009-11-30T02:47:11.189285Z Hin-Tak Leung</strong></p>
+<p><strong><a name="2010-06-02T074657.542525Z"></a>
+2010-06-02T07:46:57.542525Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-updating begin_image and fill_mask to cope with white/black+transparent
+Fix pdfwrite, faulty matrix transformations for Shading dictionaries
 
-Apparently not all black/white+transparent uses the copy_mono code path, which
-has been recently updated to do white-on-mask. There are two other ways
-black/white+transparent can pass through pxl - in begin_image() (as part of an
-RGB/Gray image with an alpha channel) which is most of the files in bug
-690947, and fill_mask() which has no known cases yet.
+Bug #691352 &quot;cairo pdf mis-distilled&quot;
 
-Note the new addition to fill_mask() and begin_image() is not identical to that
-in copy_mono() in the case of the drawing color being white - fill_mask() and
-begin_image() both try to draw white on the blacks of a black/white mask and
-transparent on the white, whereas copy_mono() draws white on the white and draw
-transparent on the opposite (set to black but really transparent), so the
-source is inverted in fill_mask() and begin_image() compared to copy_mono().
+Patterns in PDF are unpleasantly complicated by the need to transform the pattern to
+the 'default co-ordinate space'. Normally this means that we undo the resolution scaling
+which is normally applied to the CTM.
 
+For page streams this works well, but for forms the 'default co-ordinate space' is 
+the space of the parent. For one level of form there is therefore no difference between
+the page and the form. When forms are nested however, the lower form's space becomes
+that of the parent. This means that patterns inside forms, which are nested inside
+another form, need to be transformed to the parent form co-ordinate space, not the
+page space.
+
+Since we don't currently emit forms from pdfwrite for anything except transparency
+groups what this means in practice is that we don't undo the CTM transformation if 
+we are rendering a pattern inside a form, nested inside at least one other form.
+
 </pre>
-<p>[base/gdevpx.c]</p>
+<p>[base/gdevpdfx.h base/gdevpdft.c base/gdevpdfv.c base/gdevpdfb.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-30T024119.062276Z"></a>
-2009-11-30T02:41:19.062276Z Hin-Tak Leung</strong></p>
+<p><strong><a name="2010-06-01T174120.224359Z"></a>
+2010-06-01T17:41:20.224359Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-set ROP to paint through character glyphs (pattern tiles).
+Rename of gsicccache.c/h to gsicc_cache.c/h  and gsiccmanage.c/h to gsicc_manage.c/h to fall in line with the name space of the other files that came from the icc branch.  Currently working on the documentation and it is clear that this is needed (and I wish I had done it earlier).</pre>
+<p>[/trunk/ghostpdl/pxl/pxpthr.c /trunk/ghostpdl/pxl/pxl.mak /trunk/ghostpdl/xps/ghostxps.h base/gsiccmanage.c base/gxshade1.c base/gsiccmanage.h base/gscsepr.c base/gxshade4.c base/gxshade6.c /trunk/ghostpdl/pxl/pxtop.c base/gxcmap.c ghostscript.vcproj base/gsistate.c /trunk/ghostpdl/pcl/pcl.mak base/gdevrinkj.c base/gdevwts.c base/gdevxcf.c base/gxicolor.c base/devs.mak base/gsicc.c base/gdevimdi.c base/gscdevn.c base/gxclread.c base/gdevpsd.c base/lib.mak base/gxiscale.c base/gsicc_manage.c psi/int.mak /trunk/ghostpdl/pxl/pxgstate.c /trunk/ghostpdl/pcl/pctop.c base/gsicc_manage.h psi/zicc.c psi/zdevice.c base/gdevp14.c base/gsstate.c base/gsicc_cache.c base/gsicc_create.c psi/zcie.c base/gsicccache.c base/gxclist.c base/gsicc_cache.h base/gsicccache.h base/gstrans.c base/gscms.h base/gxidata.c base/gdevpdfc.c base/gxblend.c base/gxshade.c psi/zusparam.c base/gdevpdfg.c base/gxp1fill.c base/gxclrast.c base/gsciemap.c]</p>
+</blockquote>
 
-Apparently complete pattern tiles are sent as a character in a custom symbol
-font (rather than small rectangles for incomplete tiles), thus allowing re-use.
-The code set the fill color but never set ROP to &quot;paint with brush color&quot; thus
-glyphs appears as black. This patch set the ROP3 operation to paint through
-complete pattern tiles. Fixes bug 690949, also some of the problems in bug
-690585 (for ghostpdl).
+<p><strong><a name="2010-05-31T144914.514014Z"></a>
+2010-05-31T14:49:14.514014Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+for &quot;ln -s base/unix-gcc.mak Makefile; make&quot; builds, do not modularize X, nor build most of the modularzed linux modules, since they depend on the linux GNU linker</pre>
+<p>[base/unix-gcc.mak]</p>
+</blockquote>
 
-</pre>
-<p>[base/gdevpx.c]</p>
+<p><strong><a name="2010-05-31T144108.956692Z"></a>
+2010-05-31T14:41:08.956692Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+another attempt to make &quot;ln -s base/unix-gcc.mak Makefile; make&quot; to work; libtiff really want configure so we hook it in</pre>
+<p>[base/libtiff.mak]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-30T023644.876347Z"></a>
-2009-11-30T02:36:44.876347Z Hin-Tak Leung</strong></p>
+<p><strong><a name="2010-05-31T095814.532526Z"></a>
+2010-05-31T09:58:14.532526Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-fix typo introduced in r5556
+more icc branch merge related change to make &quot;make -f base/unix-gcc.mak&quot; and other targets work&quot;</pre>
+<p>[base/unix-gcc.mak base/unixansi.mak]</p>
+</blockquote>
 
-It appears that 'r5556: Added macros for assertions' introduced a typo.
-There is no known effect from this typo, except possibly stroke color 
-not being set where it should.
+<p><strong><a name="2010-05-28T180708.826907Z"></a>
+2010-05-28T18:07:08.826907Z Henry Stiles</strong></p>
+<blockquote>
+<pre>
+Fixes bug #690793.  PJL Formlines was not set correctly if the paper
+size changed.  Also, refactors such that PXL and PJL get paper sizes
+from the same source table.
 
 </pre>
-<p>[base/gdevpx.c]</p>
+<p>[/trunk/ghostpdl/pl/pl.mak /trunk/ghostpdl/pxl/pxl.mak /trunk/ghostpdl/pl/pjparse.c /trunk/ghostpdl/pxl/pxsessio.c /trunk/ghostpdl/pxl/pxstate.h base/gdevpxen.h base/gdevpxut.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-30T023052.552359Z"></a>
-2009-11-30T02:30:52.552359Z Hin-Tak Leung</strong></p>
+<p><strong><a name="2010-05-27T210221.460781Z"></a>
+2010-05-27T21:02:21.460781Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-another ID to name update</pre>
-<p>[doc/AUTHORS]</p>
+Fix so that shading strokes that go through the clist transparency code communicate the transparency device so that the proper color information is used as opposed to the color information related to the final target device.  This should fix the indeterminism with bug688807.pdf when going out to a monochrome device.</pre>
+<p>[base/gdevp14.c base/gxshade.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-30T022945.556262Z"></a>
-2009-11-30T02:29:45.556262Z Hin-Tak Leung</strong></p>
+<p><strong><a name="2010-05-27T153001.093150Z"></a>
+2010-05-27T15:30:01.093150Z Henry Stiles</strong></p>
 <blockquote>
 <pre>
-avoid setting join to invalid value; issue found in bug 690585</pre>
-<p>[base/gdevpx.c]</p>
+Forward declarations for statics functions were accidentally placed in
+the header file instead of the c file.
+</pre>
+<p>[base/gdevp14.c base/gdevp14.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-29T024331.722821Z"></a>
-2009-11-29T02:43:31.722821Z Ray Johnston</strong></p>
+<p><strong><a name="2010-05-27T004457.701730Z"></a>
+2010-05-27T00:44:57.701730Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Fix to correct mask offsets (bit order) for big_endian as well as sharing this
-array for the various devices. Bug 690954.
+Fix for indeterminism when using psdcmyk device and interpolated images.  For cases where the device profile has fewer components than the actual number of device colorants we need to use the slower interpolation code.  Otherwise we end up encoding uninitialized memory. </pre>
+<p>[base/gxiscale.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-05-26T220150.106123Z"></a>
+2010-05-26T22:01:50.106123Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Fix for bug690218.   For clist reader the pdf14 device was getting its color information set based upon the number of spot colorants in the page.  The real number should be based upon the number of actual components the device is capable of handling.  This occurs when using separation device with a limited set of colorants invoked via a command like -c &quot;&lt;&lt; /SeparationColorNames [ /Cyan /Magenta /Yellow /Black ]
+/SeparationOrder [ /Cyan /Magenta /Yellow /Black ] &gt;&gt; setpagedevice&quot;</pre>
+<p>[base/gdevp14.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-26T181652.113331Z"></a>
+2010-05-26T18:16:52.113331Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Improvements and fixes in icc search path description and bolder alert with respect to Windows delimiter \&quot; interpretation . Thanks to Ray.</pre>
+<p>[doc/Use.htm]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-26T160836.881438Z"></a>
+2010-05-26T16:08:36.881438Z Henry Stiles</strong></p>
+<blockquote>
+<pre>
+The languages (pcl, xps, pclxl) debug builds were broken with the icc
+branch merge, gs_abort() is not supported.  The code has been changed
+similarly to the old exit upon failed assertion code in gsalloc.c
+where gs_abort() is replaced with return, fixes bug #691340.
 </pre>
-<p>[base/gdevtsep.c]</p>
+<p>[base/gsicc_profilecache.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-28T105910.646748Z"></a>
-2009-11-28T10:59:10.646748Z Ken Sharp</strong> (<a href="Details.htm#2009-11-28T105910.646748Z">details</a>)</p>
+<p><strong><a name="2010-05-26T030702.463936Z"></a>
+2010-05-26T03:07:02.463936Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI) : segmentation violation with Multiple Master fonts
+Addition of lcms and new icc files to Visual studio solution.  Also did a little organizing of the files in the explorer window base folder.</pre>
+<p>[ghostscript.vcproj]</p>
+</blockquote>
 
+<p><strong><a name="2010-05-25T204302.039929Z"></a>
+2010-05-25T20:43:02.039929Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Update of documentation, clarifying the search methods used for finding the icc profiles.</pre>
+<p>[doc/Use.htm]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-25T193823.177347Z"></a>
+2010-05-25T19:38:23.177347Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Removal of iccprofiles/ from default icc profile names and post-pend %rom% with iccprofiles/ .  This is in preparation for having the ps init code initialize a default value for ICCProfilesDir (which will be ./iccprofiles/ )  so that code works with COMPILE_INITS=0 when not in the base directory and when -sICCProfilesDir is not specified on the command line.</pre>
+<p>[base/gsiccmanage.c base/gsiccmanage.h]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-25T171559.119523Z"></a>
+2010-05-25T17:15:59.119523Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+make static some private functions to remove compiler warnings</pre>
+<p>[contrib/gdevgdi.c base/gdevcairo.c contrib/gdevlx50.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-25T171427.480893Z"></a>
+2010-05-25T17:14:27.480893Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+make private functions static to silence some missing prototype warning</pre>
+<p>[imdi/cgen.c imdi/imdi_k.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-25T171318.238667Z"></a>
+2010-05-25T17:13:18.238667Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+silent one compiler warning</pre>
+<p>[base/gxstroke.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-25T135021.339560Z"></a>
+2010-05-25T13:50:21.339560Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Fix copy CIDFontType 2 properly
+Bug #690930 &quot;Unicode Output: DEVICE=pdfwrite&quot;
+
+When making a copy of a CIDFont with TrueType outlines (CIDFontType 2) for the
+benefit of pdfwrite, do not simply copy the subst_CID_on_WMode structure member as
+this will be restored away along with the font at end of page. Instead make a new
+structure and store that in the copied font.
+
+
+No differences expected, local cluster test shows a few but I think (hope) these are
+related to the ICC branch merge.</pre>
+<p>[base/gxfcopy.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-25T102209.642632Z"></a>
+2010-05-25T10:22:09.642632Z Chris Liddell</strong></p>
+<blockquote>
+<pre>
+Bug 691336: Resolve some confusion between the original global variable removal changes, and subsequent changes, that could result in warning emprintf calls using a memory pointer that could not exist at that stage.
 </pre>
-<p>[psi/zfapi.c]</p>
+<p>[psi/fapiufst.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-28T043943.983110Z"></a>
-2009-11-28T04:39:43.983110Z Marcos H. Woehrmann</strong></p>
+<p><strong><a name="2010-05-25T083157.775100Z"></a>
+2010-05-25T08:31:57.775100Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Changes to accomodate the transition from casper2 to casper3.
+Silence a couple of gcc compiler warnings introduced with the ICC merge.
 </pre>
-<p>[toolbin/localcluster/clustermonitor.pl toolbin/localcluster/clustermaster.pl toolbin/localcluster/clusterpull.sh toolbin/localcluster/build.pl toolbin/localcluster/clusterpush.pl toolbin/localcluster/run.pl]</p>
+<p>[base/gdevpdfk.c base/gdevpdfc.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-27T191508.980517Z"></a>
-2009-11-27T19:15:08.980517Z Ray Johnston</strong></p>
+<p><strong><a name="2010-05-24T230659.017275Z"></a>
+2010-05-24T23:06:59.017275Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix dereference of NULL when target device passed to gx_forward_put_params
-was NULL. This occurred with the standalone 'bbox' device.
+Another bunch of CRLF to LF's.
+
+find . -type f | grep -v 'svn-base' | xargs file | grep CRLF | grep -v -E '\.(dsp|dsw|sln|rc):' | grep -v -E '(cbuilder5|masm|dotzlib|vstudio|BorlandC_5.5|visualc6)' | cut -d ':' -f 1 | xargs -n 1 svn propset svn:eol-style native 
+find . -type f | grep -v 'svn-base' | xargs file | grep CRLF | grep -v -E '\.(dsp|dsw|sln|rc):' | grep -v -E '(cbuilder5|masm|dotzlib|vstudio|BorlandC_5.5|visualc6)' | cut -d ':' -f 1 | xargs dos2unix
+
 </pre>
-<p>[base/gdevnfwd.c]</p>
+<p>[tiff/nmake.opt psi/zcolor.h toolbin/color/icc_creator/ICC_Creator/stdafx.h lib/cat.ps toolbin/color/icc_creator/ICC_Creator/ICC_CreatorDlg.cpp toolbin/color/icc_creator/example/cielab_values.txt toolbin/color/icc_creator/ICC_Creator/icc34.h contrib/lxm3200-tweaked/LICENSE toolbin/color/icc_creator/README.txt toolbin/color/icc_creator/ICC_Creator/ICC_Creator.cpp toolbin/color/named_color/named_color_table.txt zlib/contrib/testzlib/testzlib.txt lib/Fontmap.URW-136.T1 toolbin/color/icc_creator/example/tritone_names.txt zlib/contrib/testzlib/testzlib.c toolbin/color/icc_creator/ICC_Creator/CIELAB.h toolbin/color/icc_creator/ICC_Creator/icc_create.h base/gsicc_profilecache.c toolbin/color/icc_creator/ICC_Creator/stdafx.cpp toolbin/color/icc_creator/ICC_Creator/resource.h base/gsicc_profilecache.h toolbin/color/icc_creator/example/tritone_cielab.txt base/gsicc_create.c toolbin/color/icc_creator/ICC_Creator/targetver.h toolbin/color/icc_creator/ICC_Creator/ICC_CreatorDlg.h toolbin/color/icc_creator/ICC_Creator/res/ICC_Creator.rc2 psi/zcie.h psi/write_t2.c base/gsicc_create.h toolbin/color/icc_creator/example/color_names.txt base/gscms.h toolbin/color/icc_creator/ICC_Creator/icc_create.cpp toolbin/color/icc_creator/ICC_Creator/ICC_Creator.h psi/fapibstm.c lib/Fontmap.URW-136.TT]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-27T190702.726122Z"></a>
-2009-11-27T19:07:02.726122Z Ray Johnston</strong></p>
+<p><strong><a name="2010-05-24T223400.748368Z"></a>
+2010-05-24T22:34:00.748368Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix for Device N capable device segfaults (psdcmyk, tiffsep, tiffsep1, ...) that use
-the gdevdevn.c parameter handling. A 'restore' could free up separation names but
-the pointers in the device were unchanged. Bug 690956.
+remove some more CR's and more eol-style native.
 
+find . -type f   -exec file {} \; |grep 'CRLF' | grep -v '/Projects' | grep -v 'svn-base' | cut -f 1 -d ':' | xargs -n 1 svn propset svn:eol-style native
+find . -type f   -exec file {} \; |grep 'CRLF' | grep -v '/Projects' | grep -v 'svn-base' | cut -f 1 -d ':' | xargs -n 1 dos2unix
+
 </pre>
-<p>[base/gdevdevn.c]</p>
+<p>[lcms/Delphi/delphidemo.dof lcms/src/makefile.simple lcms/Delphi/demo1.pas lcms/python/testbed/srgb2xyz.py lcms/Delphi/Samples/create.pas lcms/python/testbed/srgb2lab.py lcms/Delphi/delphidemo.dpr lcms/python/testbed/cam02.py lcms/makefile.simple lcms/samples/makefile.simple lcms/Delphi/Samples/TEST.PAS lcms/Delphi/delphidemo.cfg lcms/python/testbed/createmsh.py lcms/python/testbed/lab2adobe.py lcms/Delphi/Samples/testfrm.pas lcms/Delphi/Samples/testwp.pas lcms/src/lcms.def lcms/Delphi/Samples/getxyz.pas]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-27T141919.911778Z"></a>
-2009-11-27T14:19:19.911778Z Ken Sharp</strong> (<a href="Details.htm#2009-11-27T141919.911778Z">details</a>)</p>
+<p><strong><a name="2010-05-24T222637.131050Z"></a>
+2010-05-24T22:26:37.131050Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI) : invalid fonts resulting in errors
+manually fixing the last few files which escaped fileutils' identification.
 
 </pre>
-<p>[psi/fapi_ft.c]</p>
+<p>[lcms/python/lcms.py lcms/COPYING lcms/src/cmscam97.c lcms/aclocal.m4 lcms/ltmain.sh lcms/README.1ST lcms/configure.ac]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-27T005509.262519Z"></a>
-2009-11-27T00:55:09.262519Z Robin Watts</strong></p>
+<p><strong><a name="2010-05-24T222052.689626Z"></a>
+2010-05-24T22:20:52.689626Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Part 2 of commit 10391. Reinitroduce special cases in a way that doesn't change
-the output. A clustertest shows 33 differences overall, but testing of those
-files on my local machine shows them all to be identical.
+Changes c/c++/shell script/english text to native text and strip off CR.
 
-This fixes bug 687666.
+find . -type f   -exec grep -l '\r\n' {} \; | grep -v 'svn-base' | grep -v '\.vcproj' | grep -v '/Projects' | xargs -n 1 file |  grep -E '(ASCII C\+\+ program text|ISO\-8859 English text|ASCII C program text|shell script text executable)' | cut -f 1 -d ':'  | xargs dos2unix
+find . -type f   -exec grep -l '\r\n' {} \; | grep -v 'svn-base' | grep -v '\.vcproj' | grep -v '/Projects' | xargs -n 1 file |  grep -E '(ASCII C\+\+ program text|ISO\-8859 English text|ASCII C program text|shell script text executable)' | cut -f 1 -d ':'  | xargs svn propset svn:eol-style native
 
+
 </pre>
-<p>[base/gdevddrw.c]</p>
+<p>[lcms/doc/TUTORIAL.TXT lcms/matlab/icctrans.c lcms/src/cmswtpnt.c lcms/tifficc/getopt.c lcms/src/cmsgamma.c lcms/src/cmsnamed.c lcms/samples/vprf.c lcms/src/cmserr.c lcms/samples/mkcmy.c lcms/src/cmsmtrx.c lcms/src/cmsxform.c.orig lcms/samples/icc2ps.c lcms/python/lcms_wrap.cxx lcms/tifficc/tiffdiff.c lcms/src/cmssamp.c lcms/samples/xgetopt.c lcms/Delphi/lcmsdll.pas lcms/include/icc34.h.in lcms/src/cmsmatsh.c lcms/src/cmspack.c lcms/jpegicc/jpegicc.c lcms/jpegicc/iccjpeg.c lcms/samples/icctrans.c lcms/testbed/testcms.c lcms/samples/mktiff8.c lcms/jpegicc/iccjpeg.h lcms/tifficc/tifficc.c lcms/src/cmsvirt.c lcms/src/cmspcs.c lcms/samples/icclink.c lcms/src/cmsgmt.c lcms/src/cmsio0.c lcms/src/cmsio1.c lcms/samples/mkgrayer.c lcms/filter.c lcms/python/lcms.i lcms/src/cmsxform.c lcms/src/cmsintrp.c lcms/src/cmscnvrt.c lcms/include/lcms.h lcms/doc/LCMSAPI.TXT lcms/src/cmscgats.c lcms/src/cmscam02.c lcms/include/icc34.h lcms/src/cmslut.c lcms/src/cmsps2.c lcms/samples/wtpt.c lcms/samples/itufax.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-26T204831.400887Z"></a>
-2009-11-26T20:48:31.400887Z Robin Watts</strong></p>
+<p><strong><a name="2010-05-24T220741.207483Z"></a>
+2010-05-24T22:07:41.207483Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-First of a 2 part commit, fixing the special case horizontal/vertical
-rectangle code in the thin line code in gdevddrw.c, as it doesn't match
-the general case. This will cause many differences in the regression tests.
+remove executable bits from files which don't need them.
 
-Part 2 will commit a fixed version that will hopefully show none.
+find . -type f -executable  -exec file {} \; \
+| grep -v 'shell script text executable' \
+| cut -f 1 -d ':' |xargs -n 1 svn propdel svn:executable
 
+The last commit was created by:
+
+
+find . -type f -executable  -exec file {} \; \
+| grep 'script text executable' \
+| cut -f 1 -d ':' |xargs -n 1 svn propset svn:eol-style native 
+
 </pre>
-<p>[base/gdevddrw.c]</p>
+<p>[lcms/Projects/VC6/lcms.rc lcms/Projects/VC7/lcms.rc lcms/bin/Bin.txt lcms/Delphi/Samples/create.pas lcms/samples/vprf.c lcms/configure.ac lcms/README.1ST lcms/lcms.pc.in lcms/Projects/VC2008/lcms.sln lcms/testbed/sRGBSpac.icm lcms/Projects/VC2008/lcms.vcproj lcms/python/testbed/lab2adobe.py lcms/Delphi/demo1.dfm lcms/samples/xgetopt.c lcms/Projects/VC2005/icclink.vcproj lcms/Projects/VC6/icclink.dsp lcms/Projects/VC7/lcms.vcproj lcms/src/cmscam97.c lcms/testbed/testcms.c lcms/Projects/VC6/icc2ps.dsp lcms/Projects/VC7/icctrans.vcproj lcms/python/testbed/srgb2lab.py lcms/Projects/VC7/tifficc.vcproj lcms/filter.c lcms/Projects/VC6/lcms.dsp lcms/Delphi/delphidemo.cfg lcms/Projects/VC7/icc2ps.vcproj lcms/Projects/VC6/lcms.dsw lcms/Delphi/Samples/testwp.pas lcms/Projects/VC7/lcms.sln lcms/Projects/VC2008/tifficc.vcproj lcms/Projects/VC2005/resource.h lcms/python/testbed/whtpnt.py lcms/doc/TUTORIAL.TXT lcms/src/cmswtpnt.c lcms/Projects/VC2005/Python.vcproj lcms/Projects/BorlandC_5.5/mklcmsdll.bat lcms/include/Makefile.am lcms/Projects/VC7/jpegicc.vcproj lcms/install.gcc lcms/samples/wtpt.1 lcms/Projects/BorlandC_5.5/lcmsdll.lk lcms/src/cmserr.c lcms/makefile.simple lcms/Projects/BorlandC_5.5/lcms.rc lcms/samples/mkcmy.c lcms/src/cmsmtrx.c lcms/Makefile.am lcms/python/testbed/sRGB Color Space Profile.icm lcms/Projects/VC2008/jpegicc.vcproj lcms/Projects/VC7/lcmsdll.vcproj lcms/AUTHORS lcms/samples/icc2ps.1 lcms/Projects/VC2008/resource.h lcms/src/makefile.simple lcms/samples/mktiff8.c lcms/python/testbed/virtprf.py lcms/python/testbed/clamp.py lcms/Projects/BorlandC_5.5/lcmsdll.lst lcms/src/cmsvirt.c lcms/src/cmspcs.c lcms/src/cmsio0.c lcms/python/testbed/cam02.py lcms/Projects/VC6/resource.h lcms/src/cmsxform.c lcms/python/lcms.i lcms/src/cmsintrp.c lcms/Projects/VC2008/lcmsdll.vcproj lcms/jpegicc/jpegicc.1 lcms/COPYING lcms/Projects/VC2005/lcms.rc lcms/samples/icctrans.1 lcms/Projects/VC7/tiffdiff.vcproj lcms/src/cmscgats.c lcms/Projects/VC2008/lcms.rc lcms/tifficc/tifficc.1 lcms/src/cmscam02.c lcms/matlab/icctrans.matlab.pdf lcms/python/testbed/createmsh.py lcms/src/cmslut.c lcms/tifficc/Makefile.am lcms/Lib/MS/MS.TXT lcms/samples/wtpt.c lcms/Projects/VC6/tifficc.dsp lcms/Projects/VC7/Testbed.vcproj lcms/python/testbed/gamma.py lcms/samples/itufax.c lcms/python/Makefile.am lcms/Delphi/demo1.pas lcms/src/cmsgamma.c lcms/Projects/VC6/Python.dsp lcms/Projects/VC2008/Python.vcproj lcms/src/cmsnamed.c lcms/src/cmsxform.c.orig lcms/Projects/VC6/lcmsdll.dsp lcms/Projects/VC2008/Testbed.vcproj lcms/Projects/VC2005/lcms.vcproj lcms/python/testbed/AdobeRGB1998.icc lcms/samples/icc2ps.c lcms/tifficc/tiffdiff.c lcms/samples/makefile.simple lcms/Delphi/Samples/TEST.PAS lcms/src/cmssamp.c lcms/NEWS lcms/samples/Makefile.am lcms/Projects/VC2005/icctrans.vcproj lcms/Projects/VC2005/tifficc.vcproj lcms/Delphi/lcmsdll.pas lcms/Projects/VC2008/icctrans.vcproj lcms/include/icc34.h.in lcms/Delphi/delphidemo.dof lcms/Projects/VC6/lcms.opt lcms/src/cmsmatsh.c lcms/src/cmspack.c lcms/Projects/VC6/Python.plg lcms/jpegicc/jpegicc.c lcms/samples/icctrans.c lcms/Delphi/Samples/MAKETEST.BAT lcms/Projects/VC2005/icc2ps.vcproj lcms/ltmain.sh lcms/Delphi/Samples/gamutchk.pas lcms/tifficc/tifficc.c lcms/Projects/VC2005/lcms.sln lcms/src/cmsio1.c lcms/Projects/VC6/Testbed.dsp lcms/INSTALL lcms/Projects/VC7/icclink.vcproj lcms/jpegicc/makefile.simple lcms/jpegicc/Makefile.am lcms/Projects/VC2005/jpegicc.vcproj lcms/samples/icclink.1 lcms/Delphi/Samples/testfrm.pas lcms/Projects/VC6/jpegicc.dsp lcms/Projects/VC6/icctrans.dsp lcms/src/lcms.def lcms/Delphi/demo1.dcu lcms/Delphi/Samples/getxyz.pas lcms/matlab/icctrans.c lcms/ChangeLog lcms/Projects/VC2008/icclink.vcproj lcms/tifficc/getopt.c lcms/Lib/BC/BC.txt lcms/testbed/makefile.simple lcms/Projects/VC6/Testbed.plg lcms/Delphi/delphidemo.dpr lcms/testbed/Makefile.am lcms/Projects/VC2005/lcmsdll.vcproj lcms/Projects/VC7/resource.h lcms/Projects/VC7/Python.vcproj lcms/Delphi/demo1.ddp lcms/python/testbed/cam97.py lcms/jpegicc/iccjpeg.c lcms/python/testbed/constant.py lcms/Projects/VC2005/tiffdiff.vcproj lcms/python/testbed/srgb2xyz.py lcms/python/testbed/info.py lcms/jpegicc/iccjpeg.h lcms/Projects/VC2008/tiffdiff.vcproj lcms/Projects/VC2008/icc2ps.vcproj lcms/src/Makefile.am lcms/samples/icclink.c lcms/src/cmsgmt.c lcms/Projects/VC2005/Testbed.vcproj lcms/samples/mkgrayer.c lcms/include/lcms.h lcms/Delphi/delphidemo.res lcms/src/cmscnvrt.c lcms/python/swig_lcms lcms/doc/LCMSAPI.TXT lcms/python/testbed/sRGB2adobe.py lcms/tifficc/makefile.simple lcms/include/icc34.h lcms/src/cmsps2.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-26T165325.042900Z"></a>
-2009-11-26T16:53:25.042900Z Ken Sharp</strong></p>
+<p><strong><a name="2010-05-24T220213.500457Z"></a>
+2010-05-24T22:02:13.500457Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Removed commented out code that should not have been left behind in revision 10389
+make all shell scripts in the lcms directory eol-style native.
 </pre>
-<p>[psi/zfapi.c]</p>
+<p>[lcms/depcomp lcms/compile lcms/missing lcms/config.guess lcms/config.sub lcms/install-sh lcms/mkinstalldirs lcms/configure]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-26T164403.688193Z"></a>
-2009-11-26T16:44:03.688193Z Ken Sharp</strong> (<a href="Details.htm#2009-11-26T164403.688193Z">details</a>)</p>
+<p><strong><a name="2010-05-24T183616.496917Z"></a>
+2010-05-24T18:36:16.496917Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI) : intermittent crashes with TrueType fonts
-
+Add missing EOL to the last line in one of the new ICC files
+because MSVC 6 requires this.
 </pre>
-<p>[psi/zfapi.c]</p>
+<p>[base/gsiccmanage.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-26T101815.394246Z"></a>
-2009-11-26T10:18:15.394246Z Ken Sharp</strong> (<a href="Details.htm#2009-11-26T101815.394246Z">details</a>)</p>
+<p><strong><a name="2010-05-24T163158.315172Z"></a>
+2010-05-24T16:31:58.315172Z Michael Vrhel</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI) : Incorrect GID supplied to font interpreter for CIDFonts with TT outlines
+Merge of icc_work branch into trunk.
 
+These changes make the color architecture of the graphics library ICC-based.  All colors are now managed in terms of ICC profiles including PS CIE color spaces, for which equivalent ICC profiles are created.    A big feature of this change is that it makes it very easy to interface a color management module (CMM) to ghostscript.   The default CMM is now littleCMS and the interface to littleCMS is contained in gsicc_littlecms.c .
+
+New member variables were added to the imager state including an ICC manager, which stores the default ICC profiles; a link cache, which reduces the cost of creating links between ICC profiles, and a profile cache which stores color spaces created from PS CIE, PDF CalRGB and PDF CalGray colors spaces.
+
+A new directory named iccprofiles has been added.  It contains the default ICC profiles used if none are specified in the command line.  If COMPILE_INITS=1, these will be included in the ROM file system.  The new command line options related to ICC profiles are described in the Use.htm documentation.
+
+For c-list based rendering, all ICC profiles used in the rendering are stored in the c-list.   During multi-threaded c-list reading, a link cache is associated with the primary reader device and is shared amongst the various threads.
+
+Efficiency improvements were made in the handling of soft mask groups, shading smoothness calculations, and color image rendering.  
+
+For details on the branch, please see the commits that were made within the branch.  There remain indeterminisms to fix.  The files affected include Bug688807.pdf,  Bug688845.eps, Bug690208.pdf, 09-34.PS, CATX0988.pdf,  CATX1028.pdf,  CATX1101.pdf,  CATX5529.pdf.
+
+Rendering issues to investigate include Bug689830.pdf, fts43xx.xps (page 3) (shopping cart image), Bug689880.pdf, Bug691002.pdf, Bug689968.pdf, Bug688584.ps (page 4), catx4949.pdf.
+  
+Note that the number of differences generated with the merge amounts to pretty much every file.
+
+Thanks to everyone who helped and provided input in this work, especially Ray Johnston.
 </pre>
-<p>[psi/zfapi.c]</p>
+<p>[base/gdevpdfk.c base/gxclimag.c doc/Use.htm base/gdevdflt.c psi/icie.h base/gxpcmap.c base/gxpcolor.h lcms base/gscsepr.c base/gxshade4.c base/gxclthrd.c base/gxcmap.c base/gscscie.c base/gdevwts.c base/gsistate.c base/msvclib.mak base/gxclpage.c base/gscolor2.c base/gsicc_profilecache.c base/gxistate.h base/gscolor2.h base/gsicc_profilecache.h iccprofiles base/gdevp14.c base/gsicc_create.c base/gdevp14.h base/gsicc_create.h psi/write_t2.c psi/zusparam.c base/gdevpbm.c psi/zcolor.c psi/ztrans.c base/gdevpdft.c base/gxshade1.c /trunk/gs base/gdevpsdi.c psi/ireclaim.c psi/os2.mak base/watclib.mak Resource/Init/gs_lev2.ps base/gdevpsdu.c base/gscie.c base/gxclutil.c base/gscolor3.c base/gdevpsd.c base/gscie.h base/gxiscale.c base/gxcldev.h Resource/Init/gs_res.ps base/gxifast.c base/gxdevcli.h base/openvms.mak base/watcw32.mak base/gscms.h psi/msvc32.mak base/gsalloc.c base/lcms.mak base/gxp1fill.c base/gximage.h base/gsciemap.c base/gdevpx.c psi/zcsdevn.c base/ugcclib.mak base/unix-gcc.mak base/gsovrc.c base/gxcie.h base/macos-mcp.mak base/gxshade6.c base/macosx.mak base/gsccolor.h base/gdevrinkj.c base/unixansi.mak base/devs.mak base/gsicc.c base/gxipixel.c base/lib.mak psi/zimage.c base/gsicc.h psi/dxmain.c psi/dxmainc.c Resource/Init/pdf_draw.ps base/gscolor.c Resource/Init/pdf_ops.ps psi/zdevice.c psi/zcie.c psi/zdpnext.c base/gxclist.c psi/zcie.h base/gximono.c base/gxidata.c base/gstrans.c psi/iimage.h base/gdevpdfb.c base/gxclist.h base/gxshade.c base/gstrans.h base/gxclrast.c psi/zncdummy.c base/gxshade.h toolbin/color base/gsiccmanage.c base/Makefile.in base/gdevpdfv.c base/gsiccmanage.h base/gsicc_littlecms.c base/gxclpath.c base/gsicc_littlecms.h psi/icontext.c base/gxclpath.h base/gsstruct.h base/gdevxcf.c base/gxicolor.c base/gscspace.c base/gdevimdi.c base/gscdevn.c base/gscolor1.c base/gxclread.c base/gscspace.h base/bcwin32.mak base/gsdparam.c base/gs.mak psi/zshade.c base/gdevbbox.c psi/int.mak base/gxcspace.h psi/zicc.c base/gsstate.c base/winlib.mak base/gsicccache.c psi/zicc.h psi/zimage3.c base/gsicccache.h base/gdevpdfc.c base/gstparam.h base/gxblend.c base/gdevpdfg.c base/gxblend.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-26T101300.448002Z"></a>
-2009-11-26T10:13:00.448002Z Ken Sharp</strong> (<a href="Details.htm#2009-11-26T101300.448002Z">details</a>)</p>
+<p><strong><a name="2010-05-24T020113.653152Z"></a>
+2010-05-24T02:01:13.653152Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Fix (FAPI) : CIDFonts not working with fonts containing a CDevProc
+Recognize Corel tint transform function and replace it with an equivalent
+calculator function. Bug 690986.
+</pre>
+<p>[psi/zfunc4.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-05-23T001525.592930Z"></a>
+2010-05-23T00:15:25.592930Z Alex Cherepanov</strong></p>
+<blockquote>
+<pre>
+Decide whether load a CFF font as a simple font or a CIDFont based on the
+/Subtype of the font object instead of the /Subtype of the font stream.
+Acrobat appears to ignore the latter. Bug 691334.
 </pre>
-<p>[psi/zfapi.c]</p>
+<p>[Resource/Init/pdf_font.ps]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-26T071302.012525Z"></a>
-2009-11-26T07:13:02.012525Z Marcos H. Woehrmann</strong></p>
+<p><strong><a name="2010-05-22T091730.088324Z"></a>
+2010-05-22T09:17:30.088324Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Report enhancments as a separate category in the the weekly bug aging report.  Closes bug 690524.
+Explicit pointer cast to silence a gcc compiler warning.
 </pre>
-<p>[toolbin/bugsByEngineer.pl]</p>
+<p>[base/gxp1fill.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-26T004735.579155Z"></a>
-2009-11-26T00:47:35.579155Z Robin Watts</strong></p>
+<p><strong><a name="2010-05-21T151607.910956Z"></a>
+2010-05-21T15:16:07.910956Z Alex Cherepanov</strong></p>
 <blockquote>
 <pre>
-Fix for bug 688655: stroking of wide curves with high curvature would
-previously have left strange effects under the curve, and had nasty
-flattening artifacts on the outside of joins.
+Following Acrobat implementation but contrary to TTF spec, consider cmap entry
+that has endCode &lt; startCode as an entry with endCode == startCode.
+According to the spec, &quot;to use these arrays, it is necessary to search for the
+first endCode that is greater than or equal to the character code to be
+mapped. If the corresponding startCode is less than or equal to the character
+code ...&quot;. I.e. an entry with endCode &lt; startCode should have no effect.
+Thanks to Ken for the patch. Bug 691326.
+</pre>
+<p>[Resource/Init/gs_ttf.ps]</p>
+</blockquote>
 
-Here we alter the stroking logic to spot that line segments come from curves
-and we render using round joins both above and below the curve.
+<p><strong><a name="2010-05-21T081456.354805Z"></a>
+2010-05-21T08:14:56.354805Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Fix: device reference counting problem with patterns and clipping
 
-This gives us correct rendering of tests/ps/jointest.ps for the first time.
+Bug #690572 more details here. The problem was caused by installing a clip device while
+drawing a pattern tile. This patch initialises the finalize member of the structure
+where the clip device will be created to NULL. If a clip device is required, the member
+will be initialised to a real routine. After drawing the pattern cell, if the finalize
+routine is non-NULL we execute it.
 
-This causes about 4000 diffs. I've generated a huge number of them locally
-and they all seem to be the odd pixel changed do to rounding. Where differences
-are larger I've convinced myself that the difference is correct.
+This correctly dereferences the forwarded device if we create a clipping device.
 
 </pre>
-<p>[base/gxstroke.c]</p>
+<p>[base/gxp1fill.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-25T195911.063393Z"></a>
-2009-11-25T19:59:11.063393Z Henry Stiles</strong></p>
+<p><strong><a name="2010-05-21T063511.431787Z"></a>
+2010-05-21T06:35:11.431787Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Remove the string list implementation from the &quot;nogc&quot; allocator.  This
-makes the implementation much simpler and there was little or no
-performance improvement with the string lists.  Also this file has
-been cleaned up of archaic comments about VMS, compiler support
-comments, pragmas, etc.  No expected differences.
+adding missing dependencies so that setupgs and uninstgs can be built ahead or independent of the main targets</pre>
+<p>[psi/winint.mak psi/msvc32.mak]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-20T073106.101672Z"></a>
+2010-05-20T07:31:06.101672Z regression</strong></p>
+<blockquote>
+<pre>
+The clustermaster.pl code now checks the pid in the lock file to see if the
+task is running.  Also no longer test pdfwrite with the language switch build.
 </pre>
-<p>[base/gsnogc.c]</p>
+<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/build.pl]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-24T165112.328850Z"></a>
-2009-11-24T16:51:12.328850Z Robin Watts</strong></p>
+<p><strong><a name="2010-05-20T062443.585523Z"></a>
+2010-05-20T06:24:43.585523Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix for bug 690938. Revert revision 10294, an attempt to fix a valgrind bug,
-and instead initialise the bbox of paths to the maximally invalid bbox.
+Fix up the eol-style of the rest of the executable files by hand. 
+Remove executable bit from toolbin/bmpcmp.c
 
-As soon as any point is added to the bbox, we'll get a valid bbox. Note that
-the &quot;bbox_set&quot; flag does NOT mean &quot;the bbox is valid&quot;, it instead means &quot;the
-bbox has been set, as per the setbbox postscript operator&quot;.
+</pre>
+<p>[toolbin/bmpcmp.c jbig2dec/ltmain.sh tiff/config/ltmain.sh libpng/contrib/pngminim/encoder/gather.sh libpng/contrib/pngminim/preader/gather.sh libpng/scripts/libpng-config-body.in libpng/contrib/pngminim/decoder/gather.sh toolbin/tests/gsvalidate.py]</p>
+</blockquote>
 
+<p><strong><a name="2010-05-20T061020.265063Z"></a>
+2010-05-20T06:10:20.265063Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+Set other type of shell script as native text.
 
+find . -type f -executable  -exec file {} \; | \
+ grep 'script text executable'  | grep -v 'POSIX'  | \
+cut -f 1 -d ':' |xargs -n 1 svn propset svn:eol-style native
+
 </pre>
-<p>[base/gxpath.c base/gxpath2.c base/gxpath.h]</p>
+<p>[toolbin/localcluster/bmps2html.pl toolbin/tests/dump_checksum.py toolbin/tests/gscheck_testfiles.py toolbin/tests/dump_checksum_plus.py toolbin/localcluster/readlog.pl toolbin/search-svn-revs toolbin/localcluster/clustermonitor.cgi toolbin/localcluster/clusterpush.pl toolbin/tests/dump_checksum_raw.py toolbin/localcluster/compare.pl toolbin/localcluster/comparerevs.pl toolbin/tests/find_unique_file.py toolbin/localcluster/clustermaster.pl toolbin/localcluster/weekly.sh toolbin/localcluster/build.pl toolbin/tests/build_revision.py toolbin/htmldiff.pl toolbin/tests/compare_checksumdb.py toolbin/tests/update_baseline.py toolbin/tests/make_baselinedb.py toolbin/tests/validate.py toolbin/bugsByEngineer.pl toolbin/localcluster/clusterpull.sh toolbin/tests/regen_filelist.py toolbin/localcluster/pngs2html.pl toolbin/localcluster/nightly.pl freetype/builds/mac/ascii2mpw.py toolbin/tests/compare_checksums.py toolbin/tests/run_nightly.py toolbin/tests/regen_baseline.py toolbin/tests/myoptparse.py toolbin/tests/get_baselines.py toolbin/tests/run_regression.py toolbin/localcluster/setupcluster toolbin/localcluster/clustermonitor.pl toolbin/tests/testdiff.py toolbin/tests/updatelistpdf.py toolbin/tests/run_series.py toolbin/tests/updatelist.py toolbin/localcluster/run.pl toolbin/tests/get_baseline_log.py toolbin/performance.pl toolbin/localcluster/cachearchive.pl toolbin/tests/make_testdb.py toolbin/tests/collate.py]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-24T123117.678731Z"></a>
-2009-11-24T12:31:17.678731Z Robin Watts</strong></p>
+<p><strong><a name="2010-05-20T060141.643170Z"></a>
+2010-05-20T06:01:41.643170Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-In revision 10351 I commited a partial fix for Bug 690531 that added a new
-method for stroking a path. Due to a silly mistake on my part when stroking
-paths with round caps, we could occasionally fail due to a confusion over
-which caps to use.
+Set all identifiable shell script as native text
 
-Ralph reported this issue as bug 690639. The error is fixed here, but this
-doesn't solve all the rendering problems. Investigations continuing.
+find . -type f -executable  -exec file {} \; | \ 
+grep 'POSIX shell script text executable' | \
+cut -f 1 -d ':' |xargs -n 1 svn propset svn:eol-style native
 
 </pre>
-<p>[base/gxstroke.c]</p>
+<p>[libpng/missing cups/pstoraster.in libpng/test-pngtest.sh cups/pstopxl.in libpng/install-sh jbig2dec/configure libpng/configure contrib/pcl3/ppd/catppd toolbin/clusterpush.sh libpng/depcomp jpeg/install-sh jbig2dec/config.guess contrib/pcl3/lib/if-pcl3 freetype/configure libpng/config.guess jasper/configure tiff/config/missing jbig2dec/config.sub jpeg/configure libpng/config.sub tiff/config/install-sh jpeg/config.guess zlib/configure jpeg/config.sub tiff/config/depcomp libpng/scripts/libpng-config-head.in tiff/config/compile libpng/scripts/libpng-config.in libpng/autogen.sh tiff/config/config.guess jbig2dec/mkinstalldirs jpeg/ltconfig tiff/config/config.sub libpng/mkinstalldirs contrib/epson740/ps-to-printer.fpi_rh5.2 jasper/acaux/missing jasper/acaux/install-sh tiff/autogen.sh freetype/builds/unix/install-sh freetype/builds/unix/mkinstalldirs tiff/configure jasper/acaux/depcomp jasper/acaux/compile tiff/config/mkinstalldirs jasper/acaux/config.guess contrib/pcl3/lib/cups-pcl3 jasper/acaux/config.sub]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-24T083627.174072Z"></a>
-2009-11-24T08:36:27.174072Z Lars Uebernickel</strong></p>
+<p><strong><a name="2010-05-20T055235.456761Z"></a>
+2010-05-20T05:52:35.456761Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Don't use sed's extended regular expression syntax in configure.ac.
+Avoid raw carriage returns in configure which confuses svn
 
-GNU and Mac OS X have different command line options to enable them and since
-it was only used once, it's easier to simply use the standard regexp format.
+This is a known bug apparently of autoconf 2.63 which was fixed. Here is the upstream log entry:
+http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=cb34ecf
 
+ 2008-10-27  Eric Blake  &lt;ebb9 at byu.net&gt;
+
+       Avoid raw carriage return in scripts.
+       * lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE): Generate CR
+       via tr, rather than with literal byte.
+       * THANKS: Update.
+       Reported by Steven R. Loomis; patch suggested by Thomas Dickey.
+
+
 </pre>
-<p>[base/configure.ac]</p>
+<p>[jbig2dec/configure]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-24T013119.408746Z"></a>
-2009-11-24T01:31:19.408746Z Ralph Giles</strong></p>
+<p><strong><a name="2010-05-19T145138.835112Z"></a>
+2010-05-19T14:51:38.835112Z Robin Watts</strong></p>
 <blockquote>
 <pre>
-Implement JBIG2Decode generic regions using TPGDON.
+Some work towards (but not a complete cure for) bug 691030.
 
-Closes bug 690791.
+Previously XXX_slant_into_trapezoids would check for 2 'simple' cases,
+and bale into the fully general fill_slant_adjust function otherwise.
+The simple cases were where the top span was a subset of the bottom one, or
+vice versa.
+
+Unfortunately the way the code to test for these cases was originally written,
+one of these special cases could be used for shaped with vertical sides, and
+the other couldn't.
+
+By rewriting the test slightly, both cases can be used with trapezoids that
+have one vertical side.
+
+For good measure we also extract the 'rectangle' case out separately.
+
+Cluster testing shows no differences (barring a couple of indeterminisms).
+
+This reduces the output from 5 shapes (2 rectangles, 3 traps) to 3 (2
+rectangles, 1 trap). One of the rectangles is still a repeat, but it's
+a step in the right direction.
+
+
+
 </pre>
-<p>[jbig2dec/jbig2_generic.c]</p>
+<p>[base/gxfillts.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-23T173516.098214Z"></a>
-2009-11-23T17:35:16.098214Z Ray Johnston</strong> (<a href="Details.htm#2009-11-23T173516.098214Z">details</a>)</p>
+<p><strong><a name="2010-05-19T100905.486708Z"></a>
+2010-05-19T10:09:05.486708Z Masaki Ushizaka</strong></p>
 <blockquote>
 <pre>
-Fix for segfault reported in 690880 with separation devices. The is_open flag
-was not being properly maintained when put_params resulted in a target device
-closing due to DeviceN color state changing.
+Bug 691291. Fix reading uninitialized memory.
 
+The change I made in r10603 had a problem comparing with
+uninitialized data when using Roman fonts.
+The side effect was slowing down font rendering a little.
+In this change I added extra initializer and made 
+intention of the 'if' condition more clear.
+No difference on outputs expected nor observed by localcluster
+tests.</pre>
+<p>[base/gschar0.c]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-19T074220.717044Z"></a>
+2010-05-19T07:42:20.717044Z Masaki Ushizaka</strong></p>
+<blockquote>
+<pre>
+Follow-up to r11278.  Removing jbig2dec/config.h.
+
+r11278 enabled jbig2dec/configure to be run.
+I agree with the change but jbig2dec/config.h was also under
+subversion control.  With r11278, after someone runs
+'configure' or 'autogen.sh', jbig2dec/config.h become
+modified status.
+jbig2dec/config.h doesn't need to be here.  Deleting.
+
+Related bug: 691304 &amp; 691312.</pre>
+<p>[jbig2dec/config.h]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-18T224039.023883Z"></a>
+2010-05-18T22:40:39.023883Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+define -DHAVE_CONFIG_H and run jbig2dec/configure from top-level configure. The fixes some portability issues seen on opensolaris; further follow-up to bug 691304</pre>
+<p>[base/Makefile.in base/configure.ac]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-18T222947.346946Z"></a>
+2010-05-18T22:29:47.346946Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+typo in one word. bug 691323</pre>
+<p>[doc/Readme.htm]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-18T222313.250745Z"></a>
+2010-05-18T22:23:13.250745Z regression</strong></p>
+<blockquote>
+<pre>
+Minor changes to cluster code:
+
+  support language switch build testing
+  recover from disk full errors
+  automatically create directories needed for new nodes in run.pl
 </pre>
-<p>[base/gdevp14.c base/gdevnfwd.c]</p>
+<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/clusterpull.sh toolbin/localcluster/run.pl]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-23T024456.504420Z"></a>
-2009-11-23T02:44:56.504420Z Marcos H. Woehrmann</strong></p>
+<p><strong><a name="2010-05-18T122248.908526Z"></a>
+2010-05-18T12:22:48.908526Z Masaki Ushizaka</strong></p>
 <blockquote>
 <pre>
-Report pdfwrite differences separately from other differences.
+Disabling compiler warnings for discarding 'const'.
 
 </pre>
-<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/build.pl toolbin/localcluster/compare.pl]</p>
+<p>[jasper/src/libjasper/base/jas_image.c jasper/src/libjasper/include/jasper/jas_image.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-22T234621.529560Z"></a>
-2009-11-22T23:46:21.529560Z Ray Johnston</strong></p>
+<p><strong><a name="2010-05-18T085518.202611Z"></a>
+2010-05-18T08:55:18.202611Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Add description of the tiffsep1 device. It was mentioned in the previous update,
-but the basic device characteristics were missing.
+Bug 691313: remove the IBM Omni driver from the default build on Linux. Previously it could be excluded by giving configure &quot;--without-omni&quot;, this revision reverses the logic, so Omni can be include by giving configure &quot;--with-omni&quot;.</pre>
+<p>[base/configure.ac]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-18T043225.607601Z"></a>
+2010-05-18T04:32:25.607601Z Marcos H. Woehrmann</strong></p>
+<blockquote>
+<pre>
+Change the order in which jobs that take too long are killed on the cluster nodes to prevent leftover jobs when running bmpcmp.
 </pre>
-<p>[doc/Devices.htm]</p>
+<p>[toolbin/localcluster/run.pl]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-22T200944.171077Z"></a>
-2009-11-22T20:09:44.171077Z Lars Uebernickel</strong></p>
+<p><strong><a name="2010-05-17T154838.534341Z"></a>
+2010-05-17T15:48:38.534341Z Ken Sharp</strong></p>
 <blockquote>
 <pre>
-Added a -sCompression parameter to all TIFF devices.
+Fix - type 1/CFF font interpreter.
+The gs_type1_piece_codes routine interprets a type 1 or CFF glyph program to determine
+whether the glyph is composed of two subglyphs (a SEAC).
 
-This parameter sets the compression scheme of the resulting file and can take
-the values 'none', 'crle', 'g3', 'g4', 'lzw', and 'pack'.  crle, g3, and g4
-only work for 1-bit devices.  For tiffsep, it sets the compression scheme of
-the separation files, the composite cmyk file is always saved uncompressed.
+There was a problem with the CFF opcode cntrmask which did not cater for the case where
+it is called with a number of operands on the stack. In this case the operands are to
+be interpreted as vstem hints. Because this was not done, the interpreter had the wrong
+number of hints, and so did not interpret enough of the following bytes as mask data for
+the cntrmask operation. This led to attempting to interpret data as operands, which 
+caused corrupted glyphs as well as potential crashes.
 
-Libtiff supports many more compression formats (e.g. jpeg, deflate).  Adding
-them to this implementation is trivial.
+This does not appear to be tested by any of our current test files (according to a 
+cluster test), so no differences are expected.
+</pre>
+<p>[base/gxtype1.c]</p>
+</blockquote>
 
-doc/Devices.htm documents the parameter further.
+<p><strong><a name="2010-05-17T082506.874101Z"></a>
+2010-05-17T08:25:06.874101Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+white space change only, committed to make a regression run as the test for the 
+previous revision was interrupted.</pre>
+<p>[psi/write_t1.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-05-17T075543.268496Z"></a>
+2010-05-17T07:55:43.268496Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Silence some compiler and make warnings.
 </pre>
-<p>[base/gdevtifs.c base/gdevtifs.h base/gdevtsep.c doc/Devices.htm base/gdevtfnx.c base/gdevtfax.c]</p>
+<p>[psi/write_t1.c psi/int.mak psi/write_t1.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-21T094454.242928Z"></a>
-2009-11-21T09:44:54.242928Z Ken Sharp</strong> (<a href="Details.htm#2009-11-21T094454.242928Z">details</a>)</p>
+<p><strong><a name="2010-05-17T043957.140765Z"></a>
+2010-05-17T04:39:57.140765Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix (pdfwrite) : problems with type 3 fonts and glyphshow
+adding check for header stringprep.h; fix bug 691312</pre>
+<p>[base/configure.ac]</p>
+</blockquote>
 
+<p><strong><a name="2010-05-17T035931.965365Z"></a>
+2010-05-17T03:59:31.965365Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+Fixes portability issue properly with r11256 (which is identical with r11520),
+first discovered by Ralph 6 months ago with r10520 
+which results in its being reverted in r10540 .
+
+******************************
+    Revert c10520 which causes problems with the MSVC build.
+    
+    $(CC_) enforces 'ansi' C under msvc32.mak, disabling any Microsoft
+    extensions. This often causes problems with 3rd party libraries
+    which try to take advantage of those extensions.
+    
+    This means that the -fPIC flag is again not propagated in the GCC
+    build; this is just to unbreak the build until I can test a different
+    solution which works on both platforms.
+******************************
+As Ralph explained then, some of libtiff requires non-ansi extensions to work.
+
+The main culpit is tif_win32.c (which includes &lt;windows.h&gt;) and some of the 
+file IO flags not being defined. So this commit fix the ansi issue properly.
+
 </pre>
-<p>[base/gdevpdts.c]</p>
+<p>[tiff/libtiff/tiffiop.h base/libtiff.mak]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-20T200926.637666Z"></a>
-2009-11-20T20:09:26.637666Z Ray Johnston</strong></p>
+<p><strong><a name="2010-05-17T034702.654413Z"></a>
+2010-05-17T03:47:02.654413Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix segfaults in tiffsep and tiffsep1 -- After TIFFCleanup, need to set the tiff
-structure pointer to NULL to prevent later use. Fix separation file name logic
-to substitute a harmless '_' character for characters that cause file system
-action ('/'. '\' and ':').
+fix windows build breakage in r11249
 
-Set default compression for tiffsep output 'gray' pages to LZW and default for
-tiffsep1 to G4. While not strictly backwards compatible, any competent tiff
-reader will be able to handle this.
+This change (defining TIFFCONFIG_SUFFIX) should have been part of 
+   r11249 (create tif_config.h for non-autoconf build) 
+which in turn should have been part of 
+   r11241 (hook up libtiff with non-autoconf build via 
+      &quot;make -f base/unix-gcc.mak&quot; and &quot;make -f base/unixansi.mak&quot;)
 
+The explanation is that in r10317 where Lars originally hooked up libtiff,
+tif_config.h is generated by libtiff/configure (which is driven by the 
+top-level configure), but special provision is provided for non-autoconf build 
+(win32 and VMS) by copying from a canned header file.
+If one chooses to bypass the top-level configure, *on every platform* 
+(win32, VMS, and non-autoconf unix build), one must provide similiar special 
+provision as well.
+
+Personally I'll prefer not to support non-autoconf unix build.
+
 </pre>
-<p>[base/gdevtsep.c]</p>
+<p>[base/unix-gcc.mak base/unixansi.mak base/libtiff.mak]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-20T181012.230365Z"></a>
-2009-11-20T18:10:12.230365Z Ralph Giles</strong></p>
+<p><strong><a name="2010-05-16T183240.253209Z"></a>
+2010-05-16T18:32:40.253209Z Marcos H. Woehrmann</strong></p>
 <blockquote>
 <pre>
-Skip JBIG2Decode generic regions using TPGDON.
+Changes to the nightly regression testing system to support weekly testing.
+</pre>
+<p>[toolbin/localcluster/nightly.pl toolbin/localcluster/weekly.sh toolbin/localcluster/runNightly.pl toolbin/localcluster/run.pl]</p>
+</blockquote>
 
-We don't yet implement this, and discarding the data is better than
-proceeding with the incorrect decoding proceedures, which generally
-just produce noise. Work-around for bug 690791.</pre>
-<p>[jbig2dec/jbig2_generic.c]</p>
+<p><strong><a name="2010-05-15T105714.279373Z"></a>
+2010-05-15T10:57:14.279373Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+rename PDEP to TIFFDEP to avoid clashing with PDEP from libpng.mak; bug 691299</pre>
+<p>[base/libtiff.mak]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-19T201702.559183Z"></a>
-2009-11-19T20:17:02.559183Z Ray Johnston</strong> (<a href="Details.htm#2009-11-19T201702.559183Z">details</a>)</p>
+<p><strong><a name="2010-05-15T105547.722308Z"></a>
+2010-05-15T10:55:47.722308Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix for segfault reported in bug 690927 and two of the segfaults of bug 690880.
+comment out a later duplcate definition; bug 691299</pre>
+<p>[base/lib.mak]</p>
+</blockquote>
 
+<p><strong><a name="2010-05-15T095005.378608Z"></a>
+2010-05-15T09:50:05.378608Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+latest version of these files from Adobe's web site: http://download.macromedia.com/pub/opensource/cmap/</pre>
+<p>[Resource/CMap/UniGB-UTF8-H Resource/CMap/UniJIS2004-UTF32-H Resource/CMap/UniJIS2004-UTF16-H Resource/CMap/UniJIS2004-UTF8-H Resource/CMap/UniCNS-UTF32-H Resource/CMap/UniJISX0213-UTF32-H Resource/CMap/UniCNS-UTF16-H Resource/CMap/UniJIS-UTF32-H Resource/CMap/UniCNS-UTF8-H Resource/CMap/UniJIS-UTF16-H Resource/CMap/UniGB-UTF32-H Resource/CMap/UniJIS-UTF8-H Resource/CMap/UniJISX02132004-UTF32-H Resource/CMap/UniGB-UTF16-H]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-15T094615.270585Z"></a>
+2010-05-15T09:46:15.270585Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Add skeleton support for the Bitstream font engine. In its current form this only allows
+for type 1 PostScritp fonts, CFF is trivial to add, as should be support for Bitstream's
+own compressed format. Addition of type 42/TrueType fonts should be patterned after
+FreeType, as there is support in Bitstream for a callback to provide TrueType
+outlines. There is no such provision for PostScript fonts.
+
+To build; define BITSTREAM_BRIDGE=1 and BITSTREAM_ROOT=&quot;&quot;, the root should point one
+level above the 'core' directory. In the current code this would be :
+&quot;/bitstream/FontFusion 4.5a SDK&quot;
 </pre>
-<p>[base/gdevp14.c base/gxblend1.c]</p>
+<p>[psi/zfapi.c psi/ifapi.h psi/write_t1.c psi/int.mak psi/msvc32.mak psi/fapibstm.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-19T164811.876622Z"></a>
-2009-11-19T16:48:11.876622Z Robin Watts</strong></p>
+<p><strong><a name="2010-05-15T081759.395641Z"></a>
+2010-05-15T08:17:59.395641Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix stupid typo: ; for , - pointed out by tor. Sorry everyone.
+better way of defining SOC_LOADER when try ing to do &quot;make -f base/unix-gcc.mak so&quot;</pre>
+<p>[base/unix-dll.mak base/unix-gcc.mak]</p>
+</blockquote>
 
+<p><strong><a name="2010-05-15T080646.613460Z"></a>
+2010-05-15T08:06:46.613460Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+The final part of trying to &quot;ln -s base/unix-gcc.mak Makefile ; make so&quot; work.
+
+There were some fundamental problems with the older version: The so target really
+should be built in three distinct stages with three different FLAGS - the 
+utils (genarch, gechogs) executable part, the shared library part, and the two final
+executable part. The library should be built with the shared-object flags, but neither
+of the utils nor the final executables should be built with &quot;-shared&quot;, since they are
+executables and not libraries. Hope this is clear.
+
+There is also a little problem from SOC_LOADER not being defined if this file
+is not used from ./configure's Makefile.
+
 </pre>
-<p>[base/gspath.h]</p>
+<p>[base/unix-dll.mak]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-19T135618.594001Z"></a>
-2009-11-19T13:56:18.594001Z Robin Watts</strong></p>
+<p><strong><a name="2010-05-15T075816.778296Z"></a>
+2010-05-15T07:58:16.778296Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Fix for Bug 690531, excessive slowdown while rendering a complex stroked
-path with anti-aliasing.
+use CC_ instead of CC like everywhere else, to make the &quot;so&quot; target work</pre>
+<p>[base/libtiff.mak]</p>
+</blockquote>
 
-The problem is caused by the gs filling code grinding to a halt under the
-weight of an extremely complex path produced by stroking an already complex
-path and then filling it all at once.
+<p><strong><a name="2010-05-15T063020.380857Z"></a>
+2010-05-15T06:30:20.380857Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+&quot;-shared&quot; is a linker flag and not a compiler (object code generation) flag; another piece of trying to make &quot;make -f base/unix-gcc.mak&quot; work</pre>
+<p>[base/unix-gcc.mak]</p>
+</blockquote>
 
-This change can be seen as a workaround in that it does not change the
-filling code at all (this may be considered in future after the freetype
-changes have gone in), but instead adds a new mechanism for stroking that
-produces (broadly) equivalent strokes which happen to fill more easily.
+<p><strong><a name="2010-05-15T062741.486639Z"></a>
+2010-05-15T06:27:41.486639Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+try to make 'make -f base/unix-gcc.mak so' work
+When not run through ./configure, HAVE_CONFIG_H isn't defined and
+the jbig2 codes drop through to generic unknown unix platform - so we put some
+generic unix values here.
 
 </pre>
-<p>[base/gxpath2.c base/gxpath.h base/gxstroke.c]</p>
+<p>[jbig2dec/os_types.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-19T000915.456317Z"></a>
-2009-11-19T00:09:15.456317Z Ralph Giles</strong></p>
+<p><strong><a name="2010-05-15T062335.840946Z"></a>
+2010-05-15T06:23:35.840946Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Replace only the initial definition of the gs executable
-in the script wrappers.
+correct documentation on how make so should work - ./configure --enable-dynamic is required</pre>
+<p>[doc/Make.htm]</p>
+</blockquote>
 
-It is possible to change the name of the compiled gs executable; this is
-generally used to distinguish multiple installed versions. In r5212 a
-sed command was added to the unix build scripts to rewrite the name of
-the gs executable embedded in the various wrapper scripts so that they
-would call the corresponding version.
+<p><strong><a name="2010-05-15T033629.389869Z"></a>
+2010-05-15T03:36:29.389869Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+adding new header dependencies from the recent remove-globals effort</pre>
+<p>[base/lib.mak]</p>
+</blockquote>
 
-This was broken in r8107 where an extra clause was added to have the
-wrapper scripts prefer the gs executable in their local directory
-over any in the path. Unfortunately the sed command rewrites both
-attempts to set GS_EXECUTABLE.
+<p><strong><a name="2010-05-15T031349.664716Z"></a>
+2010-05-15T03:13:49.664716Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+adding a needed include to silent a compiler warning introduced by the recent remove-globals effort</pre>
+<p>[base/gslibctx.c]</p>
+</blockquote>
 
-This commit only rewrites the specific assignment of the default name.
-Thanks to Vince Dean for suggesting the fix. Bug 686863.</pre>
-<p>[base/unixinst.mak]</p>
+<p><strong><a name="2010-05-15T031231.280935Z"></a>
+2010-05-15T03:12:31.280935Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+another fix to bug 691306
+This was broken in r2746 (June 2002) which nobody has noticed for 8 years.
+This code path is only used for 'make -f unixansi.mak' (very generic unix cc compiler).
+
+</pre>
+<p>[base/gp_unifs.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-18T044621.000840Z"></a>
-2009-11-18T04:46:21.000840Z Alex Cherepanov</strong></p>
+<p><strong><a name="2010-05-15T030909.671905Z"></a>
+2010-05-15T03:09:09.671905Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Handle optional content following the default viewing optional content
-configuration dictionary. Skip invisible XObjects and render invisible
-parts of content streams to nulldevice. Bug 690633, customer 1110.
+generate tif_config.h if it is not there. part of fixes to bug 691306</pre>
+<p>[base/libtiff.mak]</p>
+</blockquote>
 
+<p><strong><a name="2010-05-15T030653.120732Z"></a>
+2010-05-15T03:06:53.120732Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+adding comments about the vga devices being Linux specific</pre>
+<p>[base/unix-gcc.mak]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-15T030554.250134Z"></a>
+2010-05-15T03:05:54.250134Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+part of fix to bug 691306.
+
+These two devices has been broken since r2925 (DeviceN, August 2002),
+but not built by default at all. They were blindly enabled in
+unix-gcc.mak amongst the ESP merge from Till, and it would appear that
+nobody has noticed since the merge (8.57-8.60) until now.
+
 </pre>
-<p>[Resource/Init/pdf_ops.ps Resource/Init/pdf_main.ps Resource/Init/pdf_draw.ps]</p>
+<p>[base/gdevl256.c base/gdevvglb.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-17T222638.187446Z"></a>
-2009-11-17T22:26:38.187446Z Lars Uebernickel</strong></p>
+<p><strong><a name="2010-05-15T025814.802157Z"></a>
+2010-05-15T02:58:14.802157Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Call libtiff's configure script when configuring ghostscript.
+freetype2 dependency in base/unixansi.mak to make &quot;make -f base/unixansi.mak&quot; work; another part for bug 691306</pre>
+<p>[base/unixansi.mak]</p>
+</blockquote>
 
-This also removes the (now) unnecessary tiff config files from the repository,
-which fixes build problems on compilers where headers are always first searched
-in the current directory.
+<p><strong><a name="2010-05-15T025722.770443Z"></a>
+2010-05-15T02:57:22.770443Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+freetype2 dependency in base/unix-gcc.mak to make &quot;make -f base/unix-gcc.mak&quot; work; bug 691306</pre>
+<p>[base/unix-gcc.mak]</p>
+</blockquote>
 
+<p><strong><a name="2010-05-15T025530.474135Z"></a>
+2010-05-15T02:55:30.474135Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+add documentation about the default internal resolution for pdfwrite is 720dpi</pre>
+<p>[doc/Ps2pdf.htm]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-15T025408.145913Z"></a>
+2010-05-15T02:54:08.145913Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+add documentation about how to force-embedding the basic 14 fonts</pre>
+<p>[doc/Ps2pdf.htm]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-15T025247.037525Z"></a>
+2010-05-15T02:52:47.037525Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+fix an obvious typo in the makefile</pre>
+<p>[base/libtiff.mak]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-14T164605.198340Z"></a>
+2010-05-14T16:46:05.198340Z Marcos H. Woehrmann</strong></p>
+<blockquote>
+<pre>
+Added support to unix-gcc.mak and unixansi.mak to build/use libtiff
+(also fixed some typos and made the device lists more similar).
+
+Note because of the FreeType code these files do not work with
+the current head (they work with ghostscript-8.71).
+
+Fixes Bug 691301.
+
 </pre>
-<p>[tiff/libtiff/tif_config.h tiff/libtiff/tiffconf.h base/configure.ac]</p>
+<p>[base/unix-gcc.mak base/unixansi.mak]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-17T201020.126305Z"></a>
-2009-11-17T20:10:20.126305Z Lars Uebernickel</strong></p>
+<p><strong><a name="2010-05-14T042314.678757Z"></a>
+2010-05-14T04:23:14.678757Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Use TIFFCleanup instead of TIFFClose in all tiff devices, as the fd is already
-closed in gp_prn_close.
+remove one extra tab introduced in r10994; non-GNU Make on Tru64 and HP-UX is picky. Bug 688184 and bug 691299</pre>
+<p>[psi/psromfs.mak]</p>
+</blockquote>
 
+<p><strong><a name="2010-05-14T042029.682174Z"></a>
+2010-05-14T04:20:29.682174Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+HP compiler quirk - apparently the same workaround is needed for SUN Pro C and GCC 1.x (see a few lines before this change) ; bug 688184</pre>
+<p>[contrib/opvp/opvp.h]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-14T041842.997881Z"></a>
+2010-05-14T04:18:42.997881Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+uint8_t type located in usual header on HP-UX needed for jbig2dec ; bug 688184</pre>
+<p>[jbig2dec/os_types.h]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-14T041654.357328Z"></a>
+2010-05-14T04:16:54.357328Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+fix conflicting types against HP-UX system header in jasper; bug 688184</pre>
+<p>[jasper/src/libjasper/include/jasper/jas_types.h]</p>
+</blockquote>
+
+<p><strong><a name="2010-05-13T200808.900471Z"></a>
+2010-05-13T20:08:08.900471Z Robin Watts</strong></p>
+<blockquote>
+<pre>
+Nudge the windows solution/makefiles closer to supporting 64 bit builds
+by defining WIN64 and amending makefiles to pass the define on through
+recursive calls.
+
 </pre>
-<p>[base/gdevtifs.c base/gdevtsep.c base/gdevtfax.c]</p>
+<p>[/trunk/ghostpdl/win32/xps.vcproj ghostscript-ufst.vcproj ghostscript.vcproj /trunk/ghostpdl/win32/pcl.vcproj /trunk/ghostpdl/win32/svg.vcproj psi/msvc32.mak /trunk/ghostpdl/main/pcl6_msvc.mak /trunk/ghostpdl/win32/language_switch.vcproj]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-17T180122.576735Z"></a>
-2009-11-17T18:01:22.576735Z Marcos H. Woehrmann</strong></p>
+<p><strong><a name="2010-05-13T164947.848287Z"></a>
+2010-05-13T16:49:47.848287Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Several small changes to the local cluster code:
+adding NULL check before closedevice - bug report 691296 and patch from Tim Waugh. Thanks.</pre>
+<p>[base/gdevbbox.c]</p>
+</blockquote>
 
-clusterpush.pl - you can now specify what products to test via the command line. 
+<p><strong><a name="2010-05-13T085542.013750Z"></a>
+2010-05-13T08:55:42.013750Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Changes only in white space, to provoke another regression test.
+</pre>
+<p>[psi/zfapi.c]</p>
+</blockquote>
 
-e.g. clusterpush.pl gs
-     clusterpush.pl 'svg pcl'
+<p><strong><a name="2010-05-13T083002.236776Z"></a>
+2010-05-13T08:30:02.236776Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+No changes, just an attempt to provoke some regression runs.</pre>
+<p>[psi/zfapi.c]</p>
+</blockquote>
 
-By default all products ('gs','pcl','xps','svg') are tested.
+<p><strong><a name="2010-05-13T080516.555333Z"></a>
+2010-05-13T08:05:16.555333Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Fix FAPI interface
+There is code in the FAPI interface for replacing a font's /FontBBox entry, this
+sometimes has to create a new array to insert into the dictionary, if the old array is
+not suitable for storing real values.
 
-compare.pl - no longer report not changed non-value return codes.
+The code to do this continued using ref_assign_old, as it had done for replacing the
+values in an existing array. This appears to be incorrect, when created the refs in a 
+new array are uninitialised so attempting to use ref_assign_old tries to use
+uninitialised data. 
 
-build.pl - remove all pcl tests except for 600 dpi/banded and most svg tests.
-no longer randomize jobs (helps with the indeterminisms and improves load balancing).
+Modified to use ref_assign_new instead, as indicated by the comments in store.h
 
-clustermaster.pl - changes to support new clusterpush.pl options and improvement in the
-load balancing algorithm.
+This *may* reduce some of the non-deterministic behaviour, possibly with files such
+as ShadowText.eps
+</pre>
+<p>[psi/zfapi.c]</p>
+</blockquote>
 
-run.pl - add support for semaphore to insure only on copy is run at a time
-(currently disabled pending additional testing).
+<p><strong><a name="2010-05-12T084416.052741Z"></a>
+2010-05-12T08:44:16.052741Z Chris Liddell</strong></p>
+<blockquote>
+<pre>
+Elimate an irksome compiler warning introduced in r11221</pre>
+<p>[psi/zcolor.c]</p>
+</blockquote>
 
+<p><strong><a name="2010-05-12T014318.946640Z"></a>
+2010-05-12T01:43:18.946640Z Hin-Tak Leung</strong></p>
+<blockquote>
+<pre>
+adding documentation about the -dDisableFAPI=true switch in various places</pre>
+<p>[doc/Use.htm doc/Make.htm]</p>
+</blockquote>
 
+<p><strong><a name="2010-05-11T220522.389565Z"></a>
+2010-05-11T22:05:22.389565Z regression</strong></p>
+<blockquote>
+<pre>
+The local cluster now tests the language switch build (ls).
 </pre>
-<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/build.pl toolbin/localcluster/clusterpush.pl toolbin/localcluster/run.pl toolbin/localcluster/compare.pl]</p>
+<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/build.pl toolbin/localcluster/clusterpush.pl toolbin/localcluster/run.pl toolbin/localcluster/clusterpush.txt]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-17T154542.467605Z"></a>
-2009-11-17T15:45:42.467605Z Ken Sharp</strong> (<a href="Details.htm#2009-11-17T154542.467605Z">details</a>)</p>
+<p><strong><a name="2010-05-11T212119.118628Z"></a>
+2010-05-11T21:21:19.118628Z Robin Watts</strong></p>
 <blockquote>
 <pre>
-Fix (TT font substitution) : Incorrect Widths applied to CIDFont glyphs from PDF file
+Add x64 platform target to Visual Studio projects. I can't
+test it myself due to not having a 64bit Windows setup,
+but it at least starts building and then falls over when
+it tries to run a 64bit exe as part of the build process.
 
+
+
 </pre>
-<p>[psi/zcharout.c]</p>
+<p>[/trunk/ghostpdl/win32/xps.vcproj ghostscript-ufst.vcproj /trunk/ghostpdl/win32/pcl.vcproj /trunk/ghostpdl/win32/svg.vcproj /trunk/ghostpdl/win32/language_switch.vcproj]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-16T170159.813716Z"></a>
-2009-11-16T17:01:59.813716Z Ken Sharp</strong> (<a href="Details.htm#2009-11-16T170159.813716Z">details</a>)</p>
+<p><strong><a name="2010-05-11T210209.407086Z"></a>
+2010-05-11T21:02:09.407086Z regression</strong></p>
 <blockquote>
 <pre>
+Minor improvement to cluster node log collection code.
 </pre>
-<p>[base/gxchar.c]</p>
+<p>[toolbin/localcluster/clustermaster.pl toolbin/localcluster/run.pl]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-16T164821.437679Z"></a>
-2009-11-16T16:48:21.437679Z Ken Sharp</strong> (<a href="Details.htm#2009-11-16T164821.437679Z">details</a>)</p>
+<p><strong><a name="2010-05-11T204110.123188Z"></a>
+2010-05-11T20:41:10.123188Z Robin Watts</strong></p>
 <blockquote>
 <pre>
-Fix (TT fonts) : regression with TrueType fonts
+bmpcmp was reporting the wrong page number for images, due to me forgetting
+to increment the imagecount when images were loaded. Fixed here.
 
 </pre>
-<p>[Resource/Init/pdf_font.ps Resource/Init/gs_ttf.ps]</p>
+<p>[toolbin/bmpcmp.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-14T182052.369823Z"></a>
-2009-11-14T18:20:52.369823Z Robin Watts</strong></p>
+<p><strong><a name="2010-05-11T172501.376580Z"></a>
+2010-05-11T17:25:01.376580Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-Bug fix for Bug 688604, &quot;incorrect rendering of a returning curve&quot;.
+Bugs 690356 and 690832: have the colour space object take a copy of string data associated with an indexed colour space lookup table. This prevents the colour space finalising code (gx_final_Indexed) freeing the contents of a Postscript object which may still be in use.</pre>
+<p>[psi/zcolor.c]</p>
+</blockquote>
 
-The code currently in ghostscript checks for the bbox of a beziers control
-points being of zero width/height and to avoid a division by zero just chooses
-not to subdivide this curve. This is wrong in some cases.
+<p><strong><a name="2010-05-11T154421.967848Z"></a>
+2010-05-11T15:44:21.967848Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Fix (FAPI)
+The PDF interpreter, when a font is missing, and it has the 'small caps' flag set,
+creates a substitute by altering the CharStrings of the substitute font, replacing
+the lower case glyph CharStrings with procedures which 'show' the upper case glyph at a
+reduced size.
 
-The fix here is a cheap and cheerful one; in the case where one dimension is
-zero and the other isn't, we basically do the same calculation as would be
-done in the two dimensional case, but just with a one dimensional distance
-as input.
+This ends up in the FAPI code as a t_mixedarray type which was being missed by the check
+for a t_array, added previously to handle arbitrary procedures in a type 1 font. After
+extending the check to include t_mixedarray it was clear that the SEAC processing was
+also messing up the dictionary lookup, so it was necessary to restore a value which
+had been overwritten in case a SEAC turned up.
 
-This causes various diff; all look good in my tests.
-
+zero-length-font.pdf should now work as it does without FAPI, no other differences
+expected.
 </pre>
-<p>[base/gxpcopy.c]</p>
+<p>[psi/fapi_ft.c psi/zfapi.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-13T001647.523271Z"></a>
-2009-11-13T00:16:47.523271Z Robin Watts</strong></p>
+<p><strong><a name="2010-05-11T143432.672494Z"></a>
+2010-05-11T14:34:32.672494Z Chris Liddell</strong></p>
 <blockquote>
 <pre>
-This patch fixes Bug 688269, by making ghostscript use pie joins rather than
-round ones when stroking in non CPSI_mode.
+Revise the UFST interface code for PCL/PXL and GS to work with the changes to eliminate global variables in the Artifex code base.
 
-This produces 3000 or so bitmap diffs, but after leaving my machine running
-all night generating lots of diffs for me to examine this morning, they all
-look like stray pixel changes (i.e. differences caused by rounding).
+NOTE: the UFST_REENTRANT configuration was broken, and still is (it has been since the creation of gxfapiu.[ch] files. To be resolved in the future. At this time, therefore, no build integrating UFST can be thread safe.
 
 
 </pre>
-<p>[base/gxstroke.c]</p>
+<p>[/trunk/ghostpdl/pl/plulfont.c psi/fapiufst.c base/gxfapiu.c base/gxfapiu.h]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-11T174222.705154Z"></a>
-2009-11-11T17:42:22.705154Z Robin Watts</strong></p>
+<p><strong><a name="2010-05-11T132443.420456Z"></a>
+2010-05-11T13:24:43.420456Z Robin Watts</strong></p>
 <blockquote>
 <pre>
-Final msvc makefile changes to make ghostPDL targets build with the new
-libtiff stuff.
+Fix for bug 691249 - error caused by failing to initialise new member of
+libctx that was previously a global.
 
+We now memset the contents of libctx to 0 after mallocing it, and then
+explicitly set the non-zero/NULL/false values. This is safer long term as
+it protects us from making the same mistake in future.
+
 </pre>
-<p>[/trunk/ghostpdl/svg/svg_msvc.mak base/gs.mak]</p>
+<p>[base/gslibctx.c]</p>
 </blockquote>
 
-<p><strong><a name="2009-11-11T155028.792827Z"></a>
-2009-11-11T15:50:28.792827Z Lars Uebernickel</strong></p>
+<p><strong><a name="2010-05-11T124144.704781Z"></a>
+2010-05-11T12:41:44.704781Z Hin-Tak Leung</strong></p>
 <blockquote>
 <pre>
-Changed all tiff devices to use libtiff.
+replace &quot;/*&quot; by &quot;&lt;slash&gt;&lt;star&gt;&quot; to avoid compiler warning about comments inside comment </pre>
+<p>[base/mkromfs.c]</p>
+</blockquote>
 
-Affected Devices are tiffgray, tiff12nc, tiff24nc, tiff32nc, tiffsep, tiffsep1,
-tiffcrle, tiffg3, tiffg32d, tiffg4, tifflzw, and tiffpack.  Also, two new
-devices: tiff48nc and tiff64nc (16 bits per component rgb and cmyk respectively)
-have been added.
+<p><strong><a name="2010-05-11T115510.416074Z"></a>
+2010-05-11T11:55:10.416074Z Michael Vrhel</strong></p>
+<blockquote>
+<pre>
+Debug code for helping in debug of 689737.  The pattern that is created is 1 bpp.  With this code the pattern bit map is dumped for opening with photoshop as a raw 8bit image.  The source of the problem appears to be incorrect creation of the pattern bit map when GraphicAlphaBits is set to greater than 1.</pre>
+<p>[base/gxpcmap.c]</p>
+</blockquote>
 
-Libtiff 3.9.2 is included in the source tree as tiff/.  It is possible to link
-to the system's libtiff by passing --with-system-libtiff to configure.  Passing
---without-system-libtiff will force the build to use the in-source version. By
-default, the newer library (based on TIFFLIB_VERSION in tiffvers.h) is used.
+<p><strong><a name="2010-05-11T093516.657505Z"></a>
+2010-05-11T09:35:16.657505Z Ken Sharp</strong></p>
+<blockquote>
+<pre>
+Fix (fonts)
+Bug #691290 &quot;new freetype code gives error /typecheck in definefont&quot;
 
+When creating a Decoding from an Encoding array, treat null objects the same as /.notdef
+(ie not encoded).
+
+No differences expected.
 </pre>
-<p>[tiff/libtiff/tif_predict.c tiff/contrib/addtiffo/tif_ovrcache.c tiff/html/images/bali.jpg tiff/libtiff/tif_predict.h tiff/man/tiffdither.1 tiff/contrib/addtiffo/tif_ovrcache.h tiff/libtiff/tiffconf.h tiff/libtiff/tif_apple.c tiff/html/v3.7.1.html tiff/html/v3.5.7.html tiff/test/check_tag.c tiff/man tiff/contrib/iptcutil/iptcutil.c tiff/html/addingtags.html tiff/contrib/dbs/tiff-palette.c tiff/html/man/TIFFbuffer.3tiff.html tiff/html/index.html tiff/contrib/win_dib/Tiffile.cpp base/gdevtifs.c base/gxcmap.c tiff/config/install-sh tiff/man/TIFFReadRGBATile.3tiff base/gdevtifs.h tiff/html/man/tiffsplit.1.html tiff/html/man/TIFFPrintDirectory.3tiff.html tiff/contrib/tags/xtif_dir.c tiff/contrib/stream/README tiff/contrib/acorn/SetVars tiff/contrib/mac-mpw/mactrans.c tiff/contrib/mfs/mfs_file.c tiff/test/short_tag.c tiff/tools/fax2tiff.c tiff/config/depcomp tiff/html/man/TIFFReadScanline.3tiff.html tiff/contrib/tags tiff/contrib/ras/Makefile.am tiff/libtiff/tif_aux.c tiff/libtiff/tif_packbits.c tiff/libtiff/tif_zip.c tiff/html/v3.5.4.html tiff/man/TIFFbuffer.3tiff tiff/contrib/mac-cw tiff/contrib/acorn/Makefile.am tiff/html/man/TIFFmemory.3tiff.html tiff/html/v3.5.6-beta.html tiff/m4/ltsugar.m4 tiff/tools/ycbcr.c tiff/html/man/TIFFRGBAImage.3tiff.html tiff/man/TIFFWriteRawStrip.3tiff tiff/html/v3.4beta007.html tiff/libtiff/tif_unix.c tiff/html/man/tiffinfo.1.html tiff/html/man/tiffset.1.html tiff/tools/rasterfile.h tiff/html/man/TIFFFlush.3tiff.html tiff/man/tiffdump.1 tiff/contrib/dbs/tiff-rgb.c tiff/contrib/dbs/Makefile.in tiff/html/man/fax2tiff.1.html tiff/contrib/mac-cw/mkg3_main.c tiff/contrib/win_dib/Makefile.in tiff/configure.com tiff/html/man/TIFFReadRGBAStrip.3tiff.html tiff/html/man/sgi2tiff.1.html tiff/tools/tiff2ps.c tiff/html/v3.5.1.html tiff/html/intro.html tiff/libtiff/tif_atari.c tiff/html/v3.8.0.html tiff/contrib/dbs/README tiff/config tiff/libtiff/tiffiop.h tiff/html/internals.html tiff/html/images/cover.jpg tiff/html/build.html tiff/libtiff/tiffconf.h.in tiff/html/man/TIFFWarning.3tiff.html tiff/contrib/mac-cw/metrowerks.note tiff/man/TIFFReadEncodedStrip.3tiff tiff/man/tiff2bw.1 tiff/HOWTO-RELEASE tiff/man/tiff2pdf.1 tiff/man/tiffsplit.1 tiff/html/man/TIFFcodec.3tiff.html tiff/man/bmp2tiff.1 tiff/html/v3.4beta016.html tiff/tools/fax2ps.c tiff/html/libtiff.html tiff/html/v3.4beta028.html tiff/html/man/tiffmedian.1.html tiff/html/man/TIFFWriteRawTile.3tiff.html tiff/man/TIFFError.3tiff tiff/tools/tiffmedian.c tiff/man/rgb2ycbcr.1 tiff/libtiff/uvcode.h tiff/html/images/dave.gif tiff/man/TIFFWriteEncodedStrip.3tiff tiff/html/man/Makefile.in tiff/contrib/dbs/xtiff/Makefile.am tiff/config/config.sub tiff/libtiff/Makefile.vc tiff/libtiff/tif_fax3.c tiff/man/TIFFWarning.3tiff tiff/tools/tiffgt.c tiff/man/TIFFWriteScanline.3tiff tiff/html/v3.9.2.html tiff/SConstruct tiff/contrib/tags/Makefile.am tiff/contrib/acorn/install tiff/libtiff/tif_fax3.h tiff/contrib/pds/tif_pdsdirwrite.c tiff/contrib/mac-mpw/Makefile.am tiff/man/TIFFcodec.3tiff tiff/man/tiffsv.1 tiff/html/Makefile.am tiff/contrib/mac-mpw/tools.make tiff/html/images/oxford.gif tiff/html/man/TIFFsize.3tiff.html tiff/contrib/iptcutil/Makefile.in tiff/html/man/TIFFReadEncodedTile.3tiff.html tiff/contrib/ras/tif2ras.c tiff/configure tiff/html/images/note.gif tiff/contrib/mfs/README tiff/html/man/tiff2bw.1.html tiff/config/mkinstalldirs tiff/libtiff/tif_jpeg.c psi/msvc32.mak tiff/test/Makefile.am tiff/html/man/TIFFGetField.3tiff.html tiff/m4/ltoptions.m4 tiff/html/man/TIFFReadRGBATile.3tiff.html tiff/libtiff/libtiff.def tiff/contrib/tags/listtif.c tiff/man/raw2tiff.1 tiff/html/v3.7.0beta.html tiff/tools/tiffdump.c tiff/html/man/TIFFWriteEncodedTile.3tiff.html tiff/man/ppm2tiff.1 tiff/html/v3.6.0.html tiff/contrib/addtiffo/Makefile.vc base/unix-gcc.mak tiff/man/TIFFDataWidth.3tiff tiff/contrib/mfs/Makefile.in tiff/contrib/pds/Makefile.in tiff/tools/Makefile.am tiff/contrib/dbs/tiff-bi.c tiff/contrib/iptcutil/test.iptc tiff/man/TIFFcolor.3tiff tiff/html/man/TIFFWriteScanline.3tiff.html tiff/man/tiff2rgba.1 tiff/contrib/addtiffo tiff/contrib/acorn/convert tiff/html/v3.4beta034.html tiff/tools/tiff2pdf.c tiff/port/libport.h tiff/html/man/TIFFSetDirectory.3tiff.html tiff/man/tiff2ps.1 base/devs.mak tiff/tools/bmp2tiff.c tiff/contrib/iptcutil/test.txt tiff/RELEASE-DATE tiff/contrib/iptcutil tiff/html/man/TIFFReadTile.3tiff.html tiff/test/strip.c tiff/man/libtiff.3tiff tiff/libtiff/tif_win32.c tiff/html/v3.7.2.html tiff/libtiff/tif_ojpeg.c tiff/html/contrib.html tiff/build/Makefile.am tiff/html/man/tiffcmp.1.html tiff/html/man/TIFFClose.3tiff.html tiff/html/man/TIFFquery.3tiff.html tiff/html/TIFFTechNote2.html tiff/html/images/ring.gif tiff/test tiff/libtiff/tif_config.h-vms tiff/html/v3.4beta031.html tiff/contrib/mfs tiff/contrib/win_dib/tiff2dib.c tiff/man/TIFFswab.3tiff tiff/html/images/Makefile.in tiff/contrib/mac-mpw/libtiff.make tiff/contrib/mac-cw/mac_main.c tiff/man/thumbnail.1 tiff/libtiff/tiff.h tiff/port/lfind.c tiff/libtiff/Makefile.in tiff/contrib/mac-cw/mac_main.h tiff/libtiff/tif_strip.c tiff/tools/raw2tiff.c tiff/html/v3.5.5.html tiff/TODO tiff/man/TIFFWriteTile.3tiff tiff/tools/ppm2tiff.c tiff/port/strcasecmp.c tiff/man/TIFFReadEncodedTile.3tiff tiff/html/man/tiffdither.1.html tiff/tools/sgisv.c tiff/contrib/tags/xtiffiop.h tiff/man/tiffmedian.1 tiff/libtiff/tif_config.h.in tiff/contrib/addtiffo/addtiffo.c tiff/html/images/quad.jpg tiff/html/images/warning.gif tiff/html/man/tiffsv.1.html tiff/html/images/cat.gif tiff/man/tiffcp.1