1 %!PS-Adobe-1.0: lilyponddefs
3 % Functions for direct PostScript output
6 % /setgray { 1 add } bind def
8 /staff-line-thickness lilypondpaperlinethickness 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 /lily-output-units 2.83464 def %% milimeter
16 % /lily-output-units 0.996264 def %% true points.
19 lilypondpaperoutputscale lily-output-units mul
22 /set-ps-scale-to-lily-scale
24 output-scale output-scale scale
27 /paper-size { lilypondpaperpapersize } bind def
30 % urg, read from paper block
31 % fixed base line skip value, for single line staves
32 /base-line-skip lilypondpaperlineheight def
37 clippath pathbbox newpath
39 /hsize exch def pop pop pop
42 %vsize text-height sub 2 div /top-margin exch def
43 144 2 div /top-margin exch def
44 hsize line-width sub 2 div /left-margin exch def
59 /start-system % height
61 dup base-line-skip gt {
65 pop /line-height base-line-skip def
67 line-y top-margin sub base-line-skip lt {
69 /line-y vsize top-margin sub def
72 line-x line-y translate
81 line-y line-height output-scale mul sub /line-y exch def
84 % FIXME: font definitions should come from LilyPond
85 % built-in ps fonts are ugly
87 /Palatino-Bold findfont 20.7 scalefont setfont
91 /Palatino-Bold findfont 17.3 scalefont setfont
95 /Palatino-Bold findfont 14.4 scalefont setfont
99 /Palatino-Roman findfont 14.4 scalefont setfont
102 /large-smallcaps-font {
104 /Bookman-Light findfont 14.4 scalefont setfont
108 /Palatino-Roman findfont 12 scalefont setfont
112 /Palatino-Roman findfont 10 scalefont setfont
115 /get-text-dimensions % path .. width height
117 dup true charpath pathbbox
130 neg line-y add /line-y exch def
131 neg line-width add 2 div 0 rmoveto
139 neg line-y add /line-y exch def
148 neg line-y add /line-y exch def
149 neg line-width add 0 rmoveto
155 currentdict /lilyponddedication known {
156 normal-font lilyponddedication set-centered
157 line-y 10 sub /line-y exch def
159 currentdict /lilypondtitle known {
160 huge-bold-font lilypondtitle set-centered
161 line-y 5 sub /line-y exch def
163 currentdict /lilypondsubtitle known {
164 Large-bold-font lilypondsubtitle set-centered
165 line-y 5 sub /line-y exch def
167 currentdict /lilypondsubsubtitle known {
168 large-bold-font lilypondsubsubtitle set-centered
170 line-y /mini-page exch def
171 currentdict /lilypondcomposer known {
172 large-smallcaps-font lilypondcomposer set-right
173 line-y 2 sub /line-y exch def
175 currentdict /lilypondopus known {
176 normal-font lilypondopus set-right
177 line-y 3 sub /line-y exch def
179 currentdict /lilypondarranger known {
180 normal-font lilypondarranger set-right
181 line-y 3 sub /line-y exch def
183 currentdict /lilypondpoet known {
184 mini-page /line-y exch def
185 normal-font lilypondpoet set-left
186 line-y 3 sub /line-y exch def
188 currentdict /lilypondtexttranslator known {
189 normal-font lilypondtexttranslator set-left
190 line-y 3 sub /line-y exch def
192 currentdict /lilypondinstrument known {
193 large-font lilypondinstrument set-centered
195 currentdict /lilypondpiece known {
196 large-smallcaps-font lilypondpiece set-left
202 /line-y top-margin def
203 footnote-font lilypondtagline set-left
207 /turnOnExperimentalFeatures { } bind def
209 staff-line-thickness setlinewidth
211 % set postscript paper size
214 % initialise paper dimensions
215 staff-height init-paper
217 /line-x left-margin output-scale div def
218 /line-y vsize top-margin sub def
222 % see if we're there...
223 % 10 setlinewidth 0 0 moveto 400 800 lineto stroke