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
51 dup base-line-skip gt {
55 pop /line-height base-line-skip def
57 line-y top-margin sub base-line-skip lt {
59 /line-y vsize top-margin sub def
62 line-x line-y translate
71 line-y line-height output-scale mul sub /line-y exch def
74 % FIXME: font definitions should come from LilyPond
75 % built-in ps fonts are ugly
77 /Times-Bold findfont 20.7 scalefont setfont
81 /Times-Bold findfont 17.3 scalefont setfont
85 /Times-Bold findfont 14.4 scalefont setfont
89 /Times-Roman findfont 14.4 scalefont setfont
92 /large-smallcaps-font {
94 /Helvetica findfont 14.4 scalefont setfont
98 /Times-Roman findfont 12 scalefont setfont
102 /Times-Roman findfont 10 scalefont setfont
105 /get-text-dimensions % path .. width height
107 dup true charpath pathbbox
120 neg line-y add /line-y exch def
121 neg line-width add 2 div 0 rmoveto
129 neg line-y add /line-y exch def
138 neg line-y add /line-y exch def
139 neg line-width add 0 rmoveto
145 currentdict /lilyponddedication known {
146 normal-font lilyponddedication set-centered
147 line-y 10 sub /line-y exch def
149 currentdict /lilypondtitle known {
150 huge-bold-font lilypondtitle set-centered
151 line-y 5 sub /line-y exch def
153 currentdict /lilypondsubtitle known {
154 Large-bold-font lilypondsubtitle set-centered
155 line-y 5 sub /line-y exch def
157 currentdict /lilypondsubsubtitle known {
158 large-bold-font lilypondsubsubtitle set-centered
160 line-y /mini-page exch def
161 currentdict /lilypondcomposer known {
162 large-smallcaps-font lilypondcomposer set-right
163 line-y 2 sub /line-y exch def
165 currentdict /lilypondopus known {
166 normal-font lilypondopus set-right
167 line-y 3 sub /line-y exch def
169 currentdict /lilypondarranger known {
170 normal-font lilypondarranger set-right
171 line-y 3 sub /line-y exch def
173 currentdict /lilypondpoet known {
174 mini-page /line-y exch def
175 normal-font lilypondpoet set-left
176 line-y 3 sub /line-y exch def
178 currentdict /lilypondtexttranslator known {
179 normal-font lilypondtexttranslator set-left
180 line-y 3 sub /line-y exch def
182 currentdict /lilypondinstrument known {
183 large-font lilypondinstrument set-centered
185 currentdict /lilypondpiece known {
186 large-smallcaps-font lilypondpiece set-left
192 /line-y top-margin def
193 footnote-font lilypondtagline set-left
197 /turnOnExperimentalFeatures { } bind def
199 staff-line-thickness setlinewidth
201 % set postscript paper size
204 % initialise paper dimensions
205 staff-height init-paper
207 /line-x left-margin def
208 /line-y vsize top-margin sub def
212 % see if we're there...
213 % 10 setlinewidth 0 0 moveto 400 800 lineto stroke