]> git.donarmstrong.com Git - lilypond.git/blob - ps/lilyponddefs.ps
Remove trailing whitespace.
[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 {
14     lily-output-units output-scale mul
15     lily-output-units output-scale mul scale } bind def
16
17 /init-paper {
18         gsave
19         .1 setlinewidth
20         clippath pathbbox newpath
21         /vsize exch def
22         /hsize exch def pop pop pop
23         % FIXME
24         /top-margin 2 def
25         hsize line-width sub 2 div /left-margin exch def
26         grestore
27 } bind def
28
29
30 /place-box
31 {
32         /object exch def
33         gsave
34         %exch translate
35         translate
36         0 0 moveto
37         object
38         grestore
39 } bind def
40
41 %% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html
42
43 %/FONTLENGTH 256 bind def
44
45 %<font> <encoding> <name> reencode-font
46 /reencode-dict 5 dict def
47 /reencode-font
48 {
49     reencode-dict
50     begin
51     /name exch def
52     /encoding exch def
53     /base-font exch def
54     % note: Needs ps level 2
55     /font base-font maxlength dict def
56     base-font {
57         exch dup dup /FID ne exch /Encoding ne and
58         { exch font 3 1 roll put }
59         { pop pop } ifelse
60     } forall
61     font /FontName name put
62     font /Encoding encoding put
63     name font definefont pop
64     end
65 } bind def
66
67 /start-system % x y
68 {
69     gsave
70     0
71     vsize translate
72 } bind def
73
74 /stop-system
75 {
76     /the-line exch def
77     the-line stroke grestore
78 } bind def
79
80 /end-lilypond-output
81 {
82 %    showpage
83 } bind def
84
85 staff-line-thickness setlinewidth
86
87
88 staff-height init-paper
89
90 pstack
91
92 % end lilyponddefs.ps