Date: Tue, 30 Dec 2003 21:42:23 +0900 (JST) From: Hiroki Sato <hrs@FreeBSD.org> To: trhodes@FreeBSD.org Cc: hrs@FreeBSD.org Subject: Re: GS A4 format workaround truncates images Message-ID: <20031230.214223.26370366.hrs@eos.ocn.ne.jp> In-Reply-To: <20031228224305.551990d9.trhodes@FreeBSD.org> References: <20031228153032.D52833@abigail.blackend.org> <20031229.004849.59647608.hrs@eos.ocn.ne.jp> <20031228224305.551990d9.trhodes@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
----Security_Multipart0(Tue_Dec_30_21:42:23_2003_568)-- Content-Type: Multipart/Mixed; boundary="--Next_Part(Tue_Dec_30_21:42:23_2003_006)--" Content-Transfer-Encoding: 7bit ----Next_Part(Tue_Dec_30_21:42:23_2003_006)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Tom Rhodes <trhodes@FreeBSD.org> wrote in <20031228224305.551990d9.trhodes@FreeBSD.org>: trhodes> > I think we can replace ps2epsi with a make target using gs directly. trhodes> > Does anyone have other ideas? I will commit the workaround in a couple trhodes> > of days. trhodes> trhodes> So, let me get this straight. A workaround to a workaround. trhodes> I like the way it sounds! :) FYI, a patch what I made is attached. -- | Hiroki SATO ----Next_Part(Tue_Dec_30_21:42:23_2003_006)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="doc.images.mk.diff" Index: doc.images.mk =================================================================== RCS file: /home/ncvs/doc/share/mk/doc.images.mk,v retrieving revision 1.25 diff -d -u -I\$FreeBSD:.*\$ -I\$NetBSD:.*\$ -I\$OpenBSD:.*\$ -I\$Id:.*\$ -I\$hrs:.*\$ -r1.25 doc.images.mk --- doc.images.mk 8 Dec 2003 02:37:02 -0000 1.25 +++ doc.images.mk 30 Dec 2003 12:42:02 -0000 @@ -144,15 +144,19 @@ PNMTOPSOPTS?= -noturn ${PNMTOPSFLAGS} EPSTOPDF?= ${PREFIX}/bin/epstopdf EPSTOPDFOPTS?= ${EPSTOPDFFLAGS} -PS2EPS?= ${PREFIX}/bin/ps2epsi # -# ps2epsi in ghostscript built with A4=yes fails to convert -# grops outputs without -p option. -PIC2PS?= ${GROFF} -P -p -P a4 -p -S -Wall -mtty-char -man +PIC2PS?= ${GROFF} -p -S -Wall -mtty-char -man +# +PS2EPS?= ${PREFIX}/bin/gs +PS2EPSOPTS?= -q -dNOPAUSE -dSAFER -dDELAYSAFER \ + -sPAPERSIZE=letter -r72 -sDEVICE=bit \ + -sOutputFile=/dev/null ${PS2EPSFLAGS} ps2epsi.ps +# +SETENV?= /usr/bin/env REALPATH?= /bin/realpath # Use suffix rules to convert .scr files to other formats -.SUFFIXES: .scr .pic .png .eps .txt +.SUFFIXES: .scr .pic .png .ps .eps .txt .scr.png: ${SCR2PNG} ${SCR2PNGOPTS} < ${.IMPSRC} > ${.TARGET} @@ -184,9 +188,23 @@ ${EPS2PNG} ${EPS2PNGOPTS} -o ${.TARGET} \ `${REALPATH} ${.TARGET:S/.png$/.eps/}` -.pic.eps: - ${PIC2PS} ${.ALLSRC} > ${.TARGET:S/.eps$/.ps/} - ${PS2EPS} ${.TARGET:S/.eps$/.ps/} ${.TARGET} +.pic.ps: + ${PIC2PS} ${.ALLSRC} > ${.TARGET} + +.ps.eps: + ${SETENV} outfile=${.TARGET} ${PS2EPS} ${PS2EPSOPTS} < ${.ALLSRC} 1>&2 + echo "save countdictstack mark newpath /showpage {} def /setpagedevice {pop} def" >> ${.TARGET} + echo "%%EndProlog" >> ${.TARGET} + echo "%%Page: 1 1" >> ${.TARGET} + echo "%%BeginDocument: ${.ALLSRC}" >> ${.TARGET} + ${SED} -e '/^%%BeginPreview:/,/^%%EndPreview[^!-~]*$$/d' \ + -e '/^%!PS-Adobe/d' \ + -e '/^%%[A-Za-z][A-Za-z]*[^!-~]*$$/d'\ + -e '/^%%[A-Za-z][A-Za-z]*: /d' < ${.ALLSRC} >> ${.TARGET} + echo "%%EndDocument" >> ${.TARGET} + echo "%%Trailer" >> ${.TARGET} + echo "cleartomark countdictstack exch sub { end } repeat restore" >> ${.TARGET} + echo "%%EOF" >> ${.TARGET} # We can't use suffix rules to generate the rules to convert EPS to PNG and # PNG to EPS. This is because a .png file can depend on a .eps file, and ----Next_Part(Tue_Dec_30_21:42:23_2003_006)---- ----Security_Multipart0(Tue_Dec_30_21:42:23_2003_568)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQA/8XKvTyzT2CeTzy0RAjHJAKDACEeRD2mgSsX7urWEjcn7ctCmnACfVK3U eBpuu9Jucgr0h70qwqgZX/o= =fhsi -----END PGP SIGNATURE----- ----Security_Multipart0(Tue_Dec_30_21:42:23_2003_568)----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031230.214223.26370366.hrs>