diff --git a/make-includes/build_content_rules.make b/make-includes/build_content_rules.make index 2a95483..798256b 100755 --- a/make-includes/build_content_rules.make +++ b/make-includes/build_content_rules.make @@ -90,45 +90,74 @@ ################################################################################ # -# Build correctly cropped EPS (for printing) from original source EPS. +# Build correctly cropped EPS (for printing) from original source EPS or PS. +# +# Notes on ps2eps options: +# +# --loose expands the bounding box by one "point" (= pixel?), preventing +# it from cropping too closely. However, even this doesn't seem to be +# enough in all cases, thus: +# +# --nohires (not --no-hires as specified in the help) prevents it +# generating a hi-res bounding box, which seems to fix things in most +# cases. +# +# --ignoreBB because it seems to occasionally wig out and generate +# bizarre crap for the bounding box, which then causes GhostScript to +# crash (e.g., I've seen it generate a bounding box of 246 53 0 0, which +# is just plain impossible). The help suggests using this if +# "BoundingBox in output seems to be wrong". I think this counts :) +# +# Notes on gs options: +# +# -dEPSCrop forces gs to crop the EPS image to its bounding box. If not +# specified, gs renders the EPS on the default paper size. +# +# If the fonts go weird in generated PDFs (in particular, they go jaggy +# at high resolutions), add -dNOCACHE to the gs commands. While this is +# supposedly only "only for debugging" according to the documentation, +# in GhostScript 8.15 this seemed to fix the font rendering issue. It +# appears to have been fixed in GhostScript 8.51? # %-print.pdf: %.eps @announce "Generating $@ (print)" - @ps2eps -l < $< | ps2pdf -dEPSCrop -dNOCACHE - $@ + @ps2eps --ignoreBB --nohires --loose < $< | ps2pdf -dEPSCrop - $@ @mv $@ $(BUILD_DIR) %-print.pdf: %.ps @announce "Generating $@ (print)" - @ps2eps -l < $< | ps2pdf -dEPSCrop -dNOCACHE - $@ + @ps2eps --ignoreBB --nohires --loose < $< | ps2pdf -dEPSCrop - $@ @mv $@ $(BUILD_DIR) ################################################################################ # # Build correctly cropped PNGs for web display from the original source -# EPS. +# EPS or PS. # # It might seem to make more sense to generate the PNGs from the print -# EPS, which has already been appropriately cropped. However, the results -# of directory searches using vpath are rather unpredictable when the -# source file is not guaranteed to exist. If we depended on %-print.eps, -# which is generated by the rule above, it's not guaranteed that the file -# will exist at the time that make performs its directory search (which -# seems to be done statically). The source EPS isn't generated and can -# thus be guaranteed to always exist. Give me guaranteed correct operation -# over efficiency any day! :) +# EPS, which has already been appropriately cropped (see above). However, +# the results of directory searches using vpath are rather unpredictable +# when the source file is not guaranteed to exist. If we depended on +# %-print.eps, which is generated by the rule above, it's not guaranteed +# that the file will exist at the time that make performs its directory +# search (which seems to be done statically). The source EPS isn't +# generated and can thus be guaranteed to always exist. Give me guaranteed +# correct operation over efficiency any day! :) # # Build 96 DPI version for normal web display # %-web.png: %.eps @announce "Generating $@ (web)" - @ps2eps -l < $< | gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=png16m -dEPSCrop -r96 \ + @ps2eps --ignoreBB --nohires --loose < $< | \ + gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=png16m -dEPSCrop -r96 \ -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=$@ - @mv $@ $(BUILD_DIR) %-web.png: %.ps @announce "Generating $@ (web)" - @ps2eps -l < $< | gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=png16m -dEPSCrop -r96 \ + @ps2eps --ignoreBB --nohires --loose < $< | \ + gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=png16m -dEPSCrop -r96 \ -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=$@ - @mv $@ $(BUILD_DIR) # @@ -136,13 +165,15 @@ # %-web-zoom.png: %.eps @announce "Generating $@ (zoomed web)" - @ps2eps -l < $< | gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=png16m -dEPSCrop -r144 \ + @ps2eps --ignoreBB --nohires --loose < $< | \ + gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=png16m -dEPSCrop -r144 \ -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=$@ - @mv $@ $(BUILD_DIR) %-web-zoom.png: %.ps @announce "Generating $@ (zoomed web)" - @ps2eps -l < $< | gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=png16m -dEPSCrop -r144 \ + @ps2eps --ignoreBB --nohires --loose < $< | \ + gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=png16m -dEPSCrop -r144 \ -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=$@ - @mv $@ $(BUILD_DIR)