aboutsummaryrefslogtreecommitdiffstats
path: root/doc/genps.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2019-06-06 20:51:10 -0700
committerH. Peter Anvin <hpa@zytor.com>2019-06-06 20:51:10 -0700
commit186f9a0514f466c36677b515622ba1c4fa96e32d (patch)
tree164f59a875f8f093f2909c5452584261ea880d68 /doc/genps.pl
parente678020878c79830bf59db3ad0bddebab4537409 (diff)
downloadnasm-daily-186f9a0514f466c36677b515622ba1c4fa96e32d.tar.gz
nasm-daily-186f9a0514f466c36677b515622ba1c4fa96e32d.tar.xz
nasm-daily-186f9a0514f466c36677b515622ba1c4fa96e32d.zip
doc: fix yet another set of Ghostscript font problems
Seems like Ghostscript has managed to break fontconfig support again, at least in Fedora 30. Help Ghostscript along by giving it an explicit font path. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'doc/genps.pl')
-rwxr-xr-xdoc/genps.pl24
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