]> git.donarmstrong.com Git - lilypond.git/blob - ps/lilyponddefs.ps
* flower/file-path.cc (find): try to open directly as well, so we
[lilypond.git] / ps / lilyponddefs.ps
1 %!PS-Adobe-2.0: lilyponddefs.ps
2 % TODO:
3 %  * junk all magic, start-line/stop-line just: placebox @ x.y
4 %
5 % Functions for direct PostScript output
6
7 % /setgray { 1 add } bind def
8
9 % To let gs load fonts from builddir, do:
10 % export GS_LIB=$(pwd)/mf/out:/usr/share/texmf/fonts/type1/bluesky/cm
11
12
13 /set-ps-scale-to-lily-scale { output-scale output-scale scale } bind def
14
15 /init-paper {
16         gsave
17         .1 setlinewidth
18         clippath pathbbox newpath
19         /vsize exch def
20         /hsize exch def pop pop pop 
21         % FIXME
22         /top-margin 2 def
23         hsize line-width sub 2 div /left-margin exch def
24         grestore
25 } bind def
26
27   
28 /place-box
29 {
30         /object exch def
31         gsave
32         %exch translate
33         translate
34         0 0 moveto
35         object
36         grestore
37 } bind def
38
39 %% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html
40
41 %/FONTLENGTH 256 bind def
42
43 %<font> <encoding> <name> reencode-font
44 /reencode-dict 5 dict def
45 /reencode-font
46 {
47     reencode-dict
48     begin
49     /name exch def
50     /encoding exch def
51     /base-font exch def
52     % note: Needs ps level 2
53     /font base-font maxlength dict def
54     base-font {
55         exch dup dup /FID ne exch /Encoding ne and
56         { exch font 3 1 roll put }
57         { pop pop } ifelse
58     } forall
59     font /FontName name put
60     font /Encoding encoding put
61     name font definefont pop
62     end
63 } bind def
64
65 /start-system % x y
66 {
67     gsave
68     0
69     vsize translate
70 } bind def
71
72 /stop-system
73
74     /the-line exch def
75     the-line stroke grestore
76 } bind def
77
78 /end-lilypond-output
79 {
80 %    showpage
81 } bind def
82
83 staff-line-thickness setlinewidth
84
85
86 staff-height init-paper
87  
88 pstack
89
90 % end lilyponddefs.ps