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 staves
21 /base-line-skip lilypondpaperlineheight def
26 clippath pathbbox newpath
28 /hsize exch def pop pop pop
31 %vsize text-height sub 2 div /top-margin exch def
32 144 2 div /top-margin exch def
33 hsize line-width sub 2 div /left-margin exch def
50 dup base-line-skip gt {
54 pop /line-height base-line-skip def
56 line-y top-margin sub base-line-skip lt {
58 /line-y vsize top-margin sub def
61 line-x line-y translate
70 line-y line-height output-scale mul sub /line-y exch def
73 % FIXME: font definitions should come from LilyPond
74 % built-in ps fonts are ugly
76 /Times-Bold findfont 20.7 scalefont setfont
80 /Times-Bold findfont 17.3 scalefont setfont
84 /Times-Bold findfont 14.4 scalefont setfont
88 /Times-Roman findfont 14.4 scalefont setfont
91 /large-smallcaps-font {
93 /Helvetica findfont 14.4 scalefont setfont
97 /Times-Roman findfont 12 scalefont setfont
101 /Times-Roman findfont 10 scalefont setfont
104 /get-text-dimensions % path .. width height
106 dup true charpath pathbbox
119 neg line-y add /line-y exch def
120 neg line-width add 2 div 0 rmoveto
128 neg line-y add /line-y exch def
137 neg line-y add /line-y exch def
138 neg line-width add 0 rmoveto
144 currentdict /lilyponddedication known {
145 normal-font lilyponddedication set-centered
146 line-y 10 sub /line-y exch def
148 currentdict /lilypondtitle known {
149 huge-bold-font lilypondtitle set-centered
150 line-y 5 sub /line-y exch def
152 currentdict /lilypondsubtitle known {
153 Large-bold-font lilypondsubtitle set-centered
154 line-y 5 sub /line-y exch def
156 currentdict /lilypondsubsubtitle known {
157 large-bold-font lilypondsubsubtitle set-centered
159 line-y /mini-page exch def
160 currentdict /lilypondcomposer known {
161 large-smallcaps-font lilypondcomposer set-right
162 line-y 2 sub /line-y exch def
164 currentdict /lilypondopus known {
165 normal-font lilypondopus set-right
166 line-y 3 sub /line-y exch def
168 currentdict /lilypondarranger known {
169 normal-font lilypondarranger set-right
170 line-y 3 sub /line-y exch def
172 currentdict /lilypondpoet known {
173 mini-page /line-y exch def
174 normal-font lilypondpoet set-left
175 line-y 3 sub /line-y exch def
177 currentdict /lilypondtexttranslator known {
178 normal-font lilypondtexttranslator set-left
179 line-y 3 sub /line-y exch def
181 currentdict /lilypondinstrument known {
182 large-font lilypondinstrument set-centered
184 currentdict /lilypondpiece known {
185 large-smallcaps-font lilypondpiece set-left
191 /line-y top-margin def
192 footnote-font lilypondtagline set-left
196 /turnOnExperimentalFeatures { } bind def
198 staff-line-thickness setlinewidth
200 % set postscript paper size
203 % initialise paper dimensions
204 staff-height init-paper
206 /line-x left-margin def
207 /line-y vsize top-margin sub def
211 % see if we're there...
212 % 10 setlinewidth 0 0 moveto 400 800 lineto stroke