Add a 'GREYSCALE_IMAGES' option to the print infrastructure to convert
screenshots to greyscale before embedding them in the PostScript output. Sponsored by: FreeBSD Mall, Inc.
This commit is contained in:
parent
4be4240714
commit
1d5eac4d80
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=19102
2 changed files with 15 additions and 0 deletions
share/mk
|
@ -93,6 +93,10 @@
|
||||||
# RLE Use Run-Length Encoding for EPS files, this will
|
# RLE Use Run-Length Encoding for EPS files, this will
|
||||||
# result in signficiantly smaller PostScript files,
|
# result in signficiantly smaller PostScript files,
|
||||||
# but may take longer for a printer to process.
|
# but may take longer for a printer to process.
|
||||||
|
#
|
||||||
|
# GREYSCALE_IMAGES Convert the screenshots to greyscale before
|
||||||
|
# embedding them into the PostScript output.
|
||||||
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# Documents should use the += format to access these.
|
# Documents should use the += format to access these.
|
||||||
|
|
|
@ -138,6 +138,8 @@ EPS2PNG?= ${PREFIX}/bin/peps
|
||||||
EPS2PNGOPTS?= -p -r ${EPS2PNG_RES} ${EPS2PNGFLAGS}
|
EPS2PNGOPTS?= -p -r ${EPS2PNG_RES} ${EPS2PNGFLAGS}
|
||||||
PNGTOPNM?= ${PREFIX}/bin/pngtopnm
|
PNGTOPNM?= ${PREFIX}/bin/pngtopnm
|
||||||
PNGTOPNMOPTS?= ${PNGTOPNMFLAGS}
|
PNGTOPNMOPTS?= ${PNGTOPNMFLAGS}
|
||||||
|
PPMTOPGM?= ${PREFIX}/bin/ppmtopgm
|
||||||
|
PPMTOPGMOPTS?= ${PPMTOPGMFLAGS}
|
||||||
PNMTOPS?= ${PREFIX}/bin/pnmtops
|
PNMTOPS?= ${PREFIX}/bin/pnmtops
|
||||||
PNMTOPSOPTS?= -noturn ${PNMTOPSFLAGS}
|
PNMTOPSOPTS?= -noturn ${PNMTOPSFLAGS}
|
||||||
EPSTOPDF?= ${PREFIX}/bin/epstopdf
|
EPSTOPDF?= ${PREFIX}/bin/epstopdf
|
||||||
|
@ -155,10 +157,19 @@ REALPATH?= /bin/realpath
|
||||||
.scr.png:
|
.scr.png:
|
||||||
${SCR2PNG} ${SCR2PNGOPTS} < ${.IMPSRC} > ${.TARGET}
|
${SCR2PNG} ${SCR2PNGOPTS} < ${.IMPSRC} > ${.TARGET}
|
||||||
|
|
||||||
|
## If we want grayscale, convert with ppmtopgm before running through pnmtops
|
||||||
|
.if defined(GREYSCALE_IMAGES)
|
||||||
|
.scr.eps:
|
||||||
|
${SCR2PNG} ${SCR2PNGOPTS} < ${.ALLSRC} | \
|
||||||
|
${PNGTOPNM} ${PNGTOPNMOPTS} | \
|
||||||
|
${PPMTOPGM} ${PPMTOPGMOPTS} | \
|
||||||
|
${PNMTOPS} ${PNMTOPSOPTS} > ${.TARGET}
|
||||||
|
.else
|
||||||
.scr.eps:
|
.scr.eps:
|
||||||
${SCR2PNG} ${SCR2PNGOPTS} < ${.ALLSRC} | \
|
${SCR2PNG} ${SCR2PNGOPTS} < ${.ALLSRC} | \
|
||||||
${PNGTOPNM} ${PNGTOPNMOPTS} | \
|
${PNGTOPNM} ${PNGTOPNMOPTS} | \
|
||||||
${PNMTOPS} ${PNMTOPSOPTS} > ${.TARGET}
|
${PNMTOPS} ${PNMTOPSOPTS} > ${.TARGET}
|
||||||
|
.endif
|
||||||
|
|
||||||
# The .txt files need to have any trailing spaces trimmed from
|
# The .txt files need to have any trailing spaces trimmed from
|
||||||
# each line, which is why the output from ${SCR2TXT} is run
|
# each line, which is why the output from ${SCR2TXT} is run
|
||||||
|
|
Loading…
Reference in a new issue