From e0372c8c05e436ea84e7a3aa215afa721a32c305 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sat, 18 May 2002 20:36:25 +0000 Subject: [PATCH] Add version number to the cover page, generated from the version file. --- doc/Makefile.in | 6 ++++-- doc/genps.pl | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/doc/Makefile.in b/doc/Makefile.in index b5b90bd..da96237 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -37,8 +37,10 @@ nasmdoc.dip: nasmdoc.src rdsrc.pl nasmdoc.texi: nasmdoc.dip : Generated by side effect -nasmdoc.ps: nasmdoc.dip nasmlogo.eps genps.pl psfonts.ph pswidth.ph head.ps - $(PERL) $(srcdir)/genps.pl nasmdoc.dip > nasmdoc.ps +nasmdoc.ps: nasmdoc.dip nasmlogo.eps ../version \ + genps.pl psfonts.ph pswidth.ph head.ps + $(PERL) $(srcdir)/genps.pl -subtitle "version `cat ../version`" \ + nasmdoc.dip > nasmdoc.ps nasmdoc.pdf: nasmdoc.ps $(PS2PDF) nasmdoc.ps nasmdoc.pdf diff --git a/doc/genps.pl b/doc/genps.pl index e2b985e..6bf0d38 100755 --- a/doc/genps.pl +++ b/doc/genps.pl @@ -66,6 +66,8 @@ while ( $arg = shift(@ARGV) ) { $psbool{$parm} = $true; } elsif ( $true && defined($psconf{$parm}) ) { $psconf{$parm} = shift(@ARGV); + } elsif ( $parm =~ /^(title|subtitle|year|author|license)$/ ) { + $metadata{$parm} = shift(@ARGV); } else { die "$0: Unknown option: $arg\n"; } @@ -1053,17 +1055,24 @@ $ps_page = 0; # Title page ps_start_page(); -$title = $metadata{'title'}; +$title = $metadata{'title'} || ''; $title =~ s/ \- / $emdash /; -$pstitle = ps_string($title); + +$subtitle = $metadata{'subtitle'} || ''; +$subtitle =~ s/ \- / $emdash /; # Print title +print "/ti ", ps_string($title), " def\n"; +print "/sti ", ps_string($subtitle), " def\n"; print "lmarg pageheight 2 mul 3 div moveto\n"; print "tfont0 setfont\n"; -print "/title linkdest ${pstitle} show\n"; +print "/title linkdest ti show\n"; print "lmarg pageheight 2 mul 3 div 10 sub moveto\n"; print "0 setlinecap 3 setlinewidth\n"; -print "pagewidth lmarg sub rmarg sub 0 rlineto stroke\n"; +print "pagewidth lmarg sub rmarg sub 0 rlineto currentpoint stroke moveto\n"; +print "hfont1 setfont sti stringwidth pop neg ", + -$HeadFont{leading}, " rmoveto\n"; +print "sti show\n"; # Print logo, if there is one # FIX: To be 100% correct, this should look for DocumentNeeded* -- 2.7.4