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 {
77 line-y top-margin sub base-line-skip lt {
79 /line-y vsize top-margin sub def
82 line-x line-y translate
91 line-y line-height output-scale mul sub /line-y exch def
94 % FIXME: font definitions should come from LilyPond
95 % built-in ps fonts are ugly
97 /Times-Bold findfont 20.7 scalefont setfont
101 /Times-Bold findfont 17.3 scalefont setfont
105 /Times-Bold findfont 14.4 scalefont setfont
109 /Times-Roman findfont 14.4 scalefont setfont
112 /large-smallcaps-font {
114 /Helvetica findfont 14.4 scalefont setfont
118 /Times-Roman findfont 12 scalefont setfont
122 /Times-Roman findfont 10 scalefont setfont
125 /get-text-dimensions % path .. width height
127 dup true charpath pathbbox
140 neg line-y add /line-y exch def
141 neg line-width add 2 div 0 rmoveto
149 neg line-y add /line-y exch def
158 neg line-y add /line-y exch def
159 neg line-width add 0 rmoveto
165 currentdict /lilypondtitle known {
166 huge-bold-font lilypondtitle set-centered
167 line-y 5 sub /line-y exch def
169 currentdict /lilypondsubtitle known {
170 Large-bold-font lilypondsubtitle set-centered
171 line-y 5 sub /line-y exch def
173 currentdict /lilypondsubsubtitle known {
174 large-bold-font lilypondsubsubtitle set-centered
176 currentdict /lilypondcomposer known {
177 large-smallcaps-font lilypondcomposer set-right
179 currentdict /lilypondopus known {
180 normal-font lilypondopus set-right
182 currentdict /lilypondarranger known {
183 normal-font lilypondarranger set-right
185 currentdict /lilypondinstrument known {
186 large-font lilypondinstrument set-centered
188 currentdict /lilypondpiece known {
189 large-smallcaps-font lilypondpiece set-left
195 /line-y top-margin def
196 footnote-font lilypondtagline set-left
200 /turnOnExperimentalFeatures { } bind def
202 staff-line-thickness setlinewidth
204 % set postscript paper size
207 % initialise paper dimensions
208 staff-height init-paper
210 /line-x left-margin def
211 /line-y vsize top-margin sub def
215 % see if we're there...
216 % 10 setlinewidth 0 0 moveto 400 800 lineto stroke