From owner-freebsd-doc@FreeBSD.ORG Tue Dec 30 04:44:24 2003 Return-Path: Delivered-To: freebsd-doc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C54916A4CF; Tue, 30 Dec 2003 04:44:24 -0800 (PST) Received: from smtp.eos.ocn.ne.jp (eos.ocn.ne.jp [211.6.83.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2030743D1F; Tue, 30 Dec 2003 04:44:22 -0800 (PST) (envelope-from hrs@FreeBSD.org) Received: from delta.allbsd.org (p45245-adsao12honb4-acca.tokyo.ocn.ne.jp [219.114.52.245]) by smtp.eos.ocn.ne.jp (Postfix) with ESMTP id F2E0C7DB; Tue, 30 Dec 2003 21:44:20 +0900 (JST) Received: from localhost (alph.allbsd.org [192.168.0.10]) by delta.allbsd.org (8.12.9p2/8.12.9) with ESMTP id hBUChXAB065088; Tue, 30 Dec 2003 21:43:34 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 30 Dec 2003 21:42:23 +0900 (JST) Message-Id: <20031230.214223.26370366.hrs@eos.ocn.ne.jp> To: trhodes@FreeBSD.org From: Hiroki Sato 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> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart0(Tue_Dec_30_21:42:23_2003_568)--" Content-Transfer-Encoding: 7bit cc: freebsd-doc@FreeBSD.org cc: hrs@FreeBSD.org Subject: Re: GS A4 format workaround truncates images X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2003 12:44:24 -0000 ----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 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)----