From: H. Peter Anvin Date: Thu, 16 May 2002 19:33:27 +0000 (+0000) Subject: Include the NASM logo from the specified EPS file rather than hard-coding it. X-Git-Tag: nasm-2.11.05~2408 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=365dc47adb09b11f5ac14b46e9cfed324c8b9d3b;p=platform%2Fupstream%2Fnasm.git Include the NASM logo from the specified EPS file rather than hard-coding it. --- diff --git a/doc/genps.pl b/doc/genps.pl index 761e2fb..e2b985e 100755 --- a/doc/genps.pl +++ b/doc/genps.pl @@ -930,7 +930,7 @@ foreach $fset ( @AllFonts ) { print "%!PS-Adobe-3.0\n"; print "%%Pages: $curpage\n"; print "%%BoundingBox: 0 0 ", $psconf{pagewidth}, ' ', $psconf{pageheight}, "\n"; -print "%%Creator: NASM psflow.pl\n"; +print "%%Creator: (NASM psflow.pl)\n"; print "%%DocumentData: Clean7Bit\n"; print "%%DocumentFonts: ", join(' ', keys(%ps_all_fonts)), "\n"; print "%%DocumentNeededFonts: ", join(' ', keys(%ps_all_fonts)), "\n"; @@ -1051,45 +1051,78 @@ sub ps_end_page($) { $ps_page = 0; -# Title page and inner cover +# Title page ps_start_page(); $title = $metadata{'title'}; $title =~ s/ \- / $emdash /; $pstitle = ps_string($title); -# FIX THIS: This shouldn't be hard-coded like this -print <) ) { + last if ( $line =~ /^%%EOF/ ); + if ( !defined($bbllx) && + $line =~ /^\%\%BoundingBox\:\s*([0-9\.]+)\s+([0-9\.]+)\s+([0-9\.]+)\s+([0-9\.]+)/i ) { + $bbllx = $1+0; $bblly = $2+0; + $bburx = $3+0; $bbury = $4+0; + } + push(@eps,$line); + } + close(EPS); + + if ( defined($bbllx) ) { + $width = $bburx-$bbllx; + $height = $bbury-$bblly; + + if ( $width > $maxwidth ) { + $scale = $maxwidth/$width; + } + if ( $height*$scale > $maxheight ) { + $scale = $maxheight/$height; + } + + $x = ($psconf{pagewidth}-$width*$scale)/2; + $y = ($psconf{pageheight}-$height*$scale)/2; + + print "BeginEPSF\n"; + print $x, ' ', $y, " translate\n"; + print $scale, " dup scale\n" unless ( $scale == 1 ); + print -$bbllx, ' ', -$bblly, " translate\n"; + print "$bbllx $bblly moveto\n"; + print "$bburx $bblly lineto\n"; + print "$bburx $bbury lineto\n"; + print "$bbllx $bbury lineto\n"; + print "$bbllx $bblly lineto clip newpath\n"; + print "%%BeginDocument: ",ps_string($metadata{epslogo}),"\n"; + print @eps; + print "%%EndDocument\n"; + print "EndEPSF\n"; + } +} ps_end_page(0); +# Emit the rest of the document (page 2 and on) $curpage = 2; ps_start_page(); foreach $line ( @pslines ) { diff --git a/doc/head.ps b/doc/head.ps index 4cfc0ea..b5e9153 100644 --- a/doc/head.ps +++ b/doc/head.ps @@ -367,3 +367,28 @@ % [/PageMode /UseOutlines /DOCVIEW pdfmark % Display bookmarks +% +% Functions to include EPS +% +/BeginEPSF { + /Before_EPSF_State save def + /dict_count countdictstack def + /op_count count 1 sub def + userdict begin + /showpage {} def + 0 setgray 0 setlinecap + 1 setlinewidth 0 setlinejoin + 10 setmiterlimit [ ] 0 setdash newpath + /languagelevel where + { + pop languagelevel + 1 ne { + false setstrokeadjust false setoverprint + } if + } if +} bind def +/EndEPSF { + count op_count sub {pop} repeat + countdictstack dict_count sub {end} repeat + Before_EPSF_State restore +} bind def