From 36c9ad50d5284ab11c55375c60902da12df61726 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Sat, 22 May 2010 22:10:30 +0200 Subject: Imported Upstream version 3.0.2-20050705 --- foomatic-rip.in | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'foomatic-rip.in') diff --git a/foomatic-rip.in b/foomatic-rip.in index 177b372..5b0415b 100755 --- a/foomatic-rip.in +++ b/foomatic-rip.in @@ -5,7 +5,7 @@ use strict; use POSIX; use Cwd; -my $ripversion='$Revision: 3.43.2.9 $'; +my $ripversion='$Revision: 3.43.2.11 $'; #'# Fix emacs syntax highlighting # foomatic-rip is a spooler-independent filter script which takes @@ -664,6 +664,18 @@ if ($spooler eq 'ppr') { my( $cups_jobid, $cups_user, $cups_jobtitle, $cups_copies, $cups_options, $cups_filename ); if ($spooler eq 'cups') { + + # Use CUPS font path ("FontPath" in /etc/cups/cupsd.conf) + if ($ENV{'CUPS_FONTPATH'}) { + $ENV{'GS_LIB'} = $ENV{'CUPS_FONTPATH'} . + ($ENV{'GS_LIB'} ? ":$ENV{'GS_LIB'}" : ""); + } else { + if ($ENV{'CUPS_DATADIR'}) { + $ENV{'GS_LIB'} = "$ENV{'CUPS_DATADIR'}/fonts" . + ($ENV{'GS_LIB'} ? ":$ENV{'GS_LIB'}" : ""); + } + } + # Get all command line parameters $cups_jobid = removeshellescapes($rargs[0]); $cups_user = removeshellescapes($rargs[1]); @@ -1661,6 +1673,8 @@ if (($debug) || ($spooler ne 'cups')) { } print $logh "Job title: $jobtitle\n"; print $logh "File(s) to be printed: ${added_lf}@filelist${added_lf}\n"; +print $logh "GhostScript extra search path ('GS_LIB'): $ENV{'GS_LIB'}\n" + if $ENV{'GS_LIB'}; @@ -2417,8 +2431,7 @@ for $file (@filelist) { } } else { # Do we have a DSC-conforming document? - if (($line =~ m/^.?%!PS-Adobe-/) && - ($line !~ m/EPSF/)) { + if ($line =~ m/^.?%!PS-Adobe-/) { # Do not stop parsing the document if (!$dontparse) { $maxlines = 0; @@ -5073,6 +5086,8 @@ sub stringvalid { # Allowed characters if ($arg->{'allowedchars'}) { my $chars = $arg->{'allowedchars'}; + # Quote the slashes (if a slash is preceeded by an even number of + # backslashes, it is not already quoted) $chars =~ s/(?{'allowedregexp'}) { my $regexp = $arg->{'allowedregexp'}; + # Quote the slashes (if a slash is preceeded by an even number of + # backslashes, it is not already quoted) $regexp =~ s/(?