summaryrefslogtreecommitdiff
path: root/doc/pspdf.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2017-04-26 00:16:57 -0700
committerH. Peter Anvin <hpa@zytor.com>2017-04-26 00:16:57 -0700
commit752781f2af43d7992d35eef0394b32dd565cce7f (patch)
tree53fc3113e70df0543e0b0b06ca2ad5f82bd24ed4 /doc/pspdf.pl
parente6eb87edc4ad9473dde526fb70950518819ebd11 (diff)
downloadnasm-752781f2af43d7992d35eef0394b32dd565cce7f.tar.gz
doc/pspdf.pl: fix spacing
Fix whitespace alignment, no functional change. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'doc/pspdf.pl')
-rwxr-xr-xdoc/pspdf.pl80
1 files changed, 41 insertions, 39 deletions
diff --git a/doc/pspdf.pl b/doc/pspdf.pl
index ae095576..23880668 100755
--- a/doc/pspdf.pl
+++ b/doc/pspdf.pl
@@ -9,9 +9,9 @@ use File::Spec;
my $compress = 1;
my $win32_ok = eval {
- require Win32::TieRegistry;
- Win32::TieRegistry->import();
- 1;
+ require Win32::TieRegistry;
+ Win32::TieRegistry->import();
+ 1;
};
while ($ARGV[0] =~ /^-(.*)$/) {
@@ -19,55 +19,57 @@ while ($ARGV[0] =~ /^-(.*)$/) {
shift @ARGV;
if ($opt eq '-nocompress') {
- $compress = 0;
+ $compress = 0;
}
}
my ($in, $out) = @ARGV;
if (!defined($out)) {
- die "Usage: $0 [-nocompress] infile ou{ tfile\n";
+ die "Usage: $0 [-nocompress] infile ou{ tfile\n";
}
# If Win32, help GhostScript out with some defaults
sub win32_gs_help() {
- return if (!$win32_ok);
-
- use Sort::Versions;
- use sort 'stable';
-
- my $Reg = $::Registry->Open('', {Access => 'KEY_READ', Delimiter => '/'});
- my $dir;
- my @gs;
-
- foreach my $k1 ('HKEY_CURRENT_USER/Software/', 'HKEY_LOCAL_MACHINE/SOFTWARE/') {
- foreach my $k2 ('Artifex/', '') {
- foreach my $k3 ('GPL Ghostscript/', 'AFPL Ghostscript/', 'Ghostscript/') {
- my $r = $Reg->{$k1.$k2.$k3};
- if (ref($r) eq 'Win32::TieRegistry') {
- foreach my $k (keys(%$r)) {
+ return if (!$win32_ok);
+
+ use Sort::Versions;
+ use sort 'stable';
+
+ my $Reg = $::Registry->Open('', {Access => 'KEY_READ', Delimiter => '/'});
+ my $dir;
+ my @gs;
+
+ foreach my $k1 ('HKEY_CURRENT_USER/Software/',
+ 'HKEY_LOCAL_MACHINE/SOFTWARE/') {
+ foreach my $k2 ('Artifex/', '') {
+ foreach my $k3 ('GPL Ghostscript/', 'AFPL Ghostscript/',
+ 'Ghostscript/') {
+ my $r = $Reg->{$k1.$k2.$k3};
+ if (ref($r) eq 'Win32::TieRegistry') {
+ foreach my $k (keys(%$r)) {
my $rk = $r->{$k};
if (ref($rk) eq 'Win32::TieRegistry' &&
defined($rk->{'/GS_LIB'})) {
push @gs, $rk;
}
- }
- }
- }
- }
- }
-
- @gs = sort {
- my($av) = $a->Path =~ m:^.*/([^/]+)/$:;
- my($bv) = $b->Path =~ m:^.*/([^/]+)/$:;
- versioncmp($av, $bv);
- } @gs;
-
- return unless (scalar(@gs));
-
- $ENV{'PATH'} .= ';' . $gs[0]->{'/GS_LIB'};
- $ENV{'GS_FONTPATH'} .= (defined($ENV{'GS_FONTPATH'}) ? ';' : '')
- . $ENV{'windir'}.'\\fonts';
+ }
+ }
+ }
+ }
+ }
+
+ @gs = sort {
+ my($av) = $a->Path =~ m:^.*/([^/]+)/$:;
+ my($bv) = $b->Path =~ m:^.*/([^/]+)/$:;
+ versioncmp($av, $bv);
+ } @gs;
+
+ return unless (scalar(@gs));
+
+ $ENV{'PATH'} .= ';' . $gs[0]->{'/GS_LIB'};
+ $ENV{'GS_FONTPATH'} .= (defined($ENV{'GS_FONTPATH'}) ? ';' : '')
+ . $ENV{'windir'}.'\\fonts';
}
# Remove output file
@@ -83,8 +85,8 @@ exit 0 if ( !$r && -f $out );
win32_gs_help();
my $o = $win32_ok ? '#' : '-';
my $r = system('ps2pdf', "-dOptimize${o}true", "-dEmbedAllFonts${o}true",
- "-dCompressPages${o}" . ($compress ? 'true' : 'false'),
- "-dUseFlateCompression${o}true", $in, $out);
+ "-dCompressPages${o}" . ($compress ? 'true' : 'false'),
+ "-dUseFlateCompression${o}true", $in, $out);
exit 0 if ( !$r && -f $out );
# 3. pstopdf (BSD/MacOS X utility)