-% for true printers points to postscript points:
-%\def\scaletounit{1.00375}
-\def\turnOnPostScript{%
- % This sets CTM so that you get to the currentpoint
- % by executing a 0 0 moveto
- \def\embeddedps##1{%
- \special{ps\string: @beginspecial @setspecial
- \lilypondpaperoutputscale\lilySpace\scaletounit
- \lilypondpaperoutputscale\lilySpace\scaletounit
- % FUCKING REDHAT XDVI -- ARG!
- skeel ##1 @endspecial}%
- }
- \PSsetTeXdimen{lilypondpaperblotdiameter}
+\gdef\lilypondspace{ }
+
+\gdef\lilypondpostscript{
+ % A document processed with lilypond-book can contain music fragments in
+ % different sizes. To reduce overhead, we define `lyscaleXXX' PS macros
+ % only once.
+ \lilypondifundefined{lyscale\lilypondpaperoutputscale}
+ {
+ \expandafter\gdef\csname lyscale\lilypondpaperoutputscale\endcsname{}
+ % This sets CTM so that you get to the currentpoint
+ % by executing a 0 0 moveto
+ \special{
+ \string!
+ /lyscale\lilypondpaperoutputscale
+ {\lilypondpaperoutputscale\lilypondspace\scaletounit %
+ dup scale} def
+ }
+ }
+ {}
+
+ \def\embeddedps##1{
+ \special{
+ \string"
+ lyscale\lilypondpaperoutputscale\lilypondspace ##1}
+ }
+
+ \lilypondifundefined{lilypondpaperblotdiameterps}
+ {\lilypondsetdimen{lilypondpaperblotdiameter}}
+ {}