]> git.donarmstrong.com Git - lilypond.git/blobdiff - tex/lily-ps-defs.tex
Merge branch 'master' into nested-bookparts
[lilypond.git] / tex / lily-ps-defs.tex
index 4efc3c418cb7c622207c37707adba1d3d897bb3c..4a05f9d46fba820359d498e7d56eb8a9f41f3cef 100644 (file)
@@ -1,38 +1,43 @@
-% lily-ps-defs.tex
-%
+%% lily-ps-defs.tex
+%%
 \edef\lilypsdefsELC{\the\endlinechar}%
 \endlinechar -1\relax
 
-% Header info (macros/defs, etc) should go into a \special{! ... };
-% note the ! sign.  See dvips.info for details.
-%
-% Escape the colon with \string to avoid problems with French while using
-% the Babel package.
+%% Header info (macros/defs, etc) should go into a \special{! ... };
+%% note the ! sign.  See dvips.info for details.
+%%
+%% We protect punctuation characters with \string to avoid problems with
+%% language specific shorthands (e.g. `:' for French, `"' for German, etc.).
 
-\def\PSsetTeXdimen#1{
-  \expandafter\special{
-    ! /#1 (\csname #1\endcsname) set_tex_dimen
-  }
-}
+\gdef\lilypondsetdimen#1{
+  \expandafter\gdef\csname #1ps\endcsname{}
+  \special{
+    \string!
+    /#1 (\csname #1\endcsname) set_tex_dimen}}
 
-\def\lilySpace{ }
+\gdef\lilypondspace{ }
 
-\def\turnOnPostScript{
-  % This sets CTM so that you get to the currentpoint
-  % by executing a 0 0 moveto
+\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{
-      ps\string: @beginspecial @setspecial %
-                 \lilypondpaperoutputscale\lilySpace\scaletounit %
-                 \lilypondpaperoutputscale\lilySpace\scaletounit %
-                 % FUCKING REDHAT XDVI -- ARG!
-                 skeel ##1 @endspecial
-    }
-  }
-  \PSsetTeXdimen{lilypondpaperblotdiameter}
-}
-
-\def\turnOnExperimentalFeatures{}
+      \string"
+      lyscale\lilypondpaperoutputscale\lilypondspace ##1}}}
 
 \endlinechar \lilypsdefsELC
 \endinput
+
+%% end lily-ps-defs.tex