1 %!PS-Adobe-1.0: lilyponddefs
3 % Functions for direct PostScript output
6 % /setgray { 1 add } bind def
8 /staff-line-thickness lilypondpaperstafflinethickness def
9 /staff-height lilypondpaperstaffheight def
10 /line-width lilypondpaperlinewidth def
12 % FIXME: why isn't this set (by default) by lily?
13 % /text-height lilypondpapertextheight def
15 /output-scale lilypondpaperoutputscale def
16 /paper-size { lilypondpaperpapersize } bind def
19 % urg, read from paper block
20 % fixed base line skip value, for single line staffs
21 /base-line-skip lilypondpaperlineheight def
27 clippath pathbbox newpath
29 /hsize exch def pop pop pop
32 %vsize text-height sub 2 div /top-margin exch def
33 144 2 div /top-margin exch def
34 hsize line-width sub 2 div /left-margin exch def
50 % FIXME. translate to middle of box.
53 /draw-box % breapth width depth height
66 closepath % 0 d h add neg rlineto
74 dup base-line-skip gt {
78 pop /line-height base-line-skip def
80 line-y top-margin sub base-line-skip lt {
82 /line-y vsize top-margin sub def
85 line-x line-y translate
94 line-y line-height output-scale mul sub /line-y exch def
97 % FIXME: font definitions should come from LilyPond
98 % built-in ps fonts are ugly
100 /Times-Bold findfont 20.7 scalefont setfont
104 /Times-Bold findfont 17.3 scalefont setfont
108 /Times-Bold findfont 14.4 scalefont setfont
112 /Times-Roman findfont 14.4 scalefont setfont
115 /large-smallcaps-font {
117 /Helvetica findfont 14.4 scalefont setfont
121 /Times-Roman findfont 12 scalefont setfont
125 /Times-Roman findfont 10 scalefont setfont
128 /get-text-dimensions % path .. width height
130 dup true charpath pathbbox
143 neg line-y add /line-y exch def
144 neg line-width add 2 div 0 rmoveto
152 neg line-y add /line-y exch def
161 neg line-y add /line-y exch def
162 neg line-width add 0 rmoveto
168 currentdict /lilypondtitle known {
169 huge-bold-font lilypondtitle set-centered
170 line-y 5 sub /line-y exch def
172 currentdict /lilypondsubtitle known {
173 Large-bold-font lilypondsubtitle set-centered
174 line-y 5 sub /line-y exch def
176 currentdict /lilypondsubsubtitle known {
177 large-bold-font lilypondsubsubtitle set-centered
179 currentdict /lilypondcomposer known {
180 large-smallcaps-font lilypondcomposer set-right
182 currentdict /lilypondopus known {
183 normal-font lilypondopus set-right
185 currentdict /lilypondarranger known {
186 normal-font lilypondarranger set-right
188 currentdict /lilypondinstrument known {
189 large-font lilypondinstrument set-centered
191 currentdict /lilypondpiece known {
192 large-smallcaps-font lilypondpiece set-left
198 /line-y top-margin def
199 footnote-font lilypondtagline set-left
203 /turnOnExperimentalFeatures { } bind def
205 staff-line-thickness setlinewidth
207 % set postscript paper size
210 % initialise paper dimensions
211 staff-height init-paper
213 /line-x left-margin def
214 /line-y vsize top-margin sub def
218 % see if we're there...
219 % 10 setlinewidth 0 0 moveto 400 800 lineto stroke