Missed one undecorated ORG
[platform/upstream/nasm.git] / doc / head.ps
index d18d7b7..e73b45e 100644 (file)
@@ -26,7 +26,7 @@
 /max { 2 copy lt { exch } if pop } def
 
 /lkbegun 0 def
-/lkisuri false def
+/lktype null def
 /lkury 0 def
 /lkurx 0 def
 /lklly 0 def
 /lkymarg 1 def % Extra space for link in y dir
 /lktarget () def
 
-% target --
+% target type --
 /linkbegin {
   userdict begin
     /lkbegun 1 def
-    /lkisuri false def
+    /lktype exch def
     /lktarget exch def
+    colorlinks { 0 0 0.4 setrgbcolor } if
   end
 } def
 
+% target --
+/linkbegindest {
+  /Dest linkbegin
+} def
+
 % uristring --
 /linkbeginuri {
-  userdict begin
-    /lkbegun 1 def
-    /lkisuri true def
-    /lktarget exch def
-  end
+  /URI linkbegin
+} def
+
+% pageno --
+/linkbeginpage {
+  /Page linkbegin
 } def
 
 % string spacepadding --
 % --
 /linkend {
   userdict begin
-    [ lkisuri {
-        /Action
-        % << .. >> would be languagelevel 2 :(
-        2 dict dup /Subtype /URI put dup /URI lktarget put
+    [ lktype /URI eq {
+        /Action 2 dict dup /Subtype /URI put dup /URI lktarget put
       } {
-        /Dest lktarget
+       /Dest lktarget
       } ifelse
       /Border [0 0 0]
       /Rect [ lkllx lkxmarg sub
@@ -94,6 +99,7 @@
       /Subtype /Link
       /ANN pdfmark
     /lkbegun 0 def
+    colorlinks { 0 setgray } if
   end
 } def
 
 /subh2 { lmarg exch moveto sfont showstream } def
 /subh3 { sfont headlbl lmarg exch moveto sfont showstream } def
 
-/norm0 { lmarg exch moveto tfont lwidth showstreamjust } def
-/norm1 { lmarg exch moveto tfont lwidth showstreamjust } def
-/norm2 { lmarg exch moveto tfont showstream } def
-/norm3 { lmarg exch moveto tfont showstream } def
+/norm0 { lmarg exch moveto bfont lwidth showstreamjust } def
+/norm1 { lmarg exch moveto bfont lwidth showstreamjust } def
+/norm2 { lmarg exch moveto bfont showstream } def
+/norm3 { lmarg exch moveto bfont showstream } def
 
-/code0 { lmarg exch moveto tfont showstream } def
-/code1 { lmarg exch moveto tfont showstream } def
-/code2 { lmarg exch moveto tfont showstream } def
-/code3 { lmarg exch moveto tfont showstream } def
+/code0 { lmarg exch moveto bfont showstream } def
+/code1 { lmarg exch moveto bfont showstream } def
+/code2 { lmarg exch moveto bfont showstream } def
+/code3 { lmarg exch moveto bfont showstream } def
 
-/bull0 { bullmarg exch moveto tfont bwidth showstreamjust } def
-/bull1 { dup lmarg exch moveto [(\267)] tfont showstream
-        bullmarg exch moveto tfont bwidth showstreamjust } def
-/bull2 { bullmarg exch moveto tfont showstream } def
-/bull3 { dup lmarg exch moveto [(\267)] tfont showstream
-        bullmarg exch moveto tfont showstream } def
+/bull0 { bullmarg exch moveto bfont bwidth showstreamjust } def
+/bull1 { dup lmarg exch moveto bullet bfont showstream
+        bullmarg exch moveto bfont bwidth showstreamjust } def
+/bull2 { bullmarg exch moveto bfont showstream } def
+/bull3 { dup lmarg exch moveto bullet bfont showstream
+        bullmarg exch moveto bfont showstream } def
 
 /tocw0 lwidth tocpnz sub def
 /tocw1 tocw0 tocind sub def
 /tocx2 tocx1 tocind add def
 
 /tocpn {
-  tfont0 setfont
+  bfont0 setfont
   3 dict begin
     /s exch def
     /x s stringwidth pop pagewidth rmarg sub exch sub def
   linkend
 } def
 
-/toc00 { tocx0 exch moveto 0 rmoveto tfont showstream } def
+/toc00 { tocx0 exch moveto 0 rmoveto bfont showstream } def
 /toc01 { tocx0 exch moveto
-        linkbegin tfont0 setfont 0 linkshow tfont showstream } def
+        linkbegindest bfont0 setfont 0 linkshow bfont showstream } def
 /toc02 { tocx0 exch moveto 3 1 roll
-        0 rmoveto tfont showstream tocpn } def
+        0 rmoveto bfont showstream tocpn } def
 /toc03 { tocx0 exch moveto 4 1 roll
-        linkbegin tfont0 setfont 0 linkshow tfont showstream tocpn } def
+        linkbegindest bfont0 setfont 0 linkshow bfont showstream tocpn } def
 
-/toc10 { tocx1 exch moveto 0 rmoveto tfont showstream } def
+/toc10 { tocx1 exch moveto 0 rmoveto bfont showstream } def
 /toc11 { tocx1 exch moveto
-        linkbegin tfont0 setfont 0 linkshow tfont showstream } def
+        linkbegindest bfont0 setfont 0 linkshow bfont showstream } def
 /toc12 { tocx1 exch moveto 3 1 roll
-        0 rmoveto tfont showstream tocpn } def
+        0 rmoveto bfont showstream tocpn } def
 /toc13 { tocx1 exch moveto 4 1 roll
-        linkbegin tfont0 setfont 0 linkshow tfont showstream tocpn } def
+        linkbegindest bfont0 setfont 0 linkshow bfont showstream tocpn } def
 
-/toc20 { tocx2 exch moveto 0 rmoveto tfont showstream } def
+/toc20 { tocx2 exch moveto 0 rmoveto bfont showstream } def
 /toc21 { tocx2 exch moveto
-        linkbegin tfont0 setfont 0 linkshow tfont showstream } def
+        linkbegindest bfont0 setfont 0 linkshow bfont showstream } def
 /toc22 { tocx2 exch moveto 3 1 roll
-        0 rmoveto tfont showstream tocpn } def
+        0 rmoveto bfont showstream tocpn } def
 /toc23 { tocx2 exch moveto 4 1 roll
-        linkbegin tfont0 setfont 0 linkshow tfont showstream tocpn } def
+        linkbegindest bfont0 setfont 0 linkshow bfont showstream tocpn } def
+
+% Spacing between index columns
+/indexcolumn pagewidth lmarg sub rmarg sub idxgutter add idxcolumns div def
+% Width of an individual index column
+/indexcolwid indexcolumn idxgutter sub def
+
+/idx03 {
+  2 dict begin
+    indexcolumn mul lmarg add
+    /x exch def /y exch def x y moveto
+    exch bfont showstream
+    dup bfont streamwidth
+    x indexcolwid add exch sub exch pop y moveto
+    bfont showstream
+  end
+} def
+/idx00 {idx03} def
+/idx01 {idx03} def
+/idx02 {idx03} def
+
+/idx13 {
+  2 dict begin
+    indexcolumn mul lmarg add idxindent add
+    /x exch def /y exch def x y moveto
+    exch bfont showstream
+    dup bfont streamwidth
+    x indexcolwid idxindent sub add exch sub exch pop y moveto
+    bfont showstream
+  end
+} def
+/idx10 {idx13} def
+/idx11 {idx13} def
+/idx12 {idx13} def
 
 %
 % Page numbers
 % Functions invoked during parsing
 %
 /xa { linkdest } def
-/xl { linkbegin } def
+/pa { 0 pageheight moveto linkdest } def
+/xl { linkbegindest } def
 /wl { linkbeginuri } def
+/pl { linkbeginpage } def
 /el { linkend } def
 
 %
 %
 [/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