diff options
Diffstat (limited to 'doc/genps.pl')
-rwxr-xr-x | doc/genps.pl | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/doc/genps.pl b/doc/genps.pl index 4758bb9d..8d7a76d9 100755 --- a/doc/genps.pl +++ b/doc/genps.pl @@ -99,7 +99,7 @@ $epsdir = File::Spec->curdir(); # # Parse the command line # -undef $input; +undef $input, $fontpath; while ( $arg = shift(@ARGV) ) { if ( $arg =~ /^\-(|no\-)(.*)$/ ) { $parm = $2; @@ -119,6 +119,8 @@ while ( $arg = shift(@ARGV) ) { $epsdir = shift(@ARGV); } elsif ( $true && $parm eq 'headps' ) { $headps = shift(@ARGV); + } elsif ( $true && $parm eq 'fontpath' ) { + $fontpath = shift(@ARGV); } else { die "$0: Unknown option: $arg\n"; } @@ -166,6 +168,26 @@ foreach my $fset ( @AllFonts ) { } } +# Create a font path. At least some versions of Ghostscript +# don't seem to get it right any other way. +if (defined($fontpath)) { + my %fontdirs = (); + foreach my $fname (sort keys(%ps_all_fonts)) { + my $fdata = $ps_all_fonts{$fname}; + if (defined($fdata->{filename})) { + my($vol,$dir,$basename) = + File::Spec->splitpath(File::Spec->rel2abs($fdata->{filename})); + $dir = File::Spec->catpath($vol, $dir, ''); + $fontdirs{$dir}++; + } + } + open(my $fp, '>', $fontpath) or die "$0: $fontpath: $!\n"; + foreach $d (sort(keys(%fontdirs))) { + print $fp $d, "\n"; + } + close($fp); +} + # Custom encoding vector. This is basically the same as # ISOLatin1Encoding (a level 2 feature, so we dont want to use it), # but with the "naked" accents at \200-\237 moved to the \000-\037 |