X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tex%2Flily-ps-defs.tex;h=d3c4fc07c675c2fb66f720c9af621933664aebb1;hb=9b725aa625683f62a56453c8900b6d007674236b;hp=bad2bdc0a68ec1e69feea709558232b1cfac6b8f;hpb=164f801e44a5263b1ba9ccc68d8eebaeaa0c5445;p=lilypond.git diff --git a/tex/lily-ps-defs.tex b/tex/lily-ps-defs.tex index bad2bdc0a6..d3c4fc07c6 100644 --- a/tex/lily-ps-defs.tex +++ b/tex/lily-ps-defs.tex @@ -1,65 +1,50 @@ +% lily-ps-defs.tex % -% WARNING: don't leave blank lines in the PS-code; they are -% transformed into \par -% +\edef\lilypsdefsELC{\the\endlinechar}% +\endlinechar -1\relax -% -% header info (macros/defs, etc) should go into a \special{! ... }, +% Header info (macros/defs, etc) should go into a \special{! ... }; % note the ! sign. See dvips.info for details. % - -% Use of -% /foo { operatorname } bind def -% -% ``compiles'' operatorname binding in the body of foo, making -% the code faster, and more reliable (less flexible) - -{% - \def\par{ }% %Ugh. Don't try this at home, kids! - % neat file-include trick by Piet van Oostrum - \newread\defin - \newtoks\toksfiledefi\newtoks\toksfiledefii - \def\ifnot#1{#1\else\expandafter\expandafter\fi\iffalse\iftrue\fi} - \def\filedef#1#2{%#1=command name, #2=file name - \openin\defin=#2\relax\def#1{} - \ifeof\defin - \message{***************** CAN NOT OPEN #2 ********************} - \end - \fi - \loop\ifnot{\ifeof\defin}\read\defin to\tempfiledef - \toksfiledefi=\expandafter{#1}% - \toksfiledefii=\expandafter{\tempfiledef}% - % \expandafter\special\expandafter{!\the\toksfiledefi\the\toksfiledefii}\repeat% - \global\edef#1{\the\toksfiledefi\the\toksfiledefii}\repeat% - } - % - % This seems a little backwards, but we don't want to include the PS - % stuff too early - % - \filedef\includelilyps{lily.ps}% - \expandafter\special{! \includelilyps } +% We protect punctuation characters with \string to avoid problems with +% language specific shorthands (e.g. `:' for French, `"' for German, etc.). + +\gdef\lilypondsetdimen#1{ + \expandafter\gdef\csname #1ps\endcsname{} + \special{ + \string! + /#1 (\csname #1\endcsname) set_tex_dimen + } } - -\def\turnOnPostScript{% - % This sets CTM so that you get to the currentpoint - % by executing a 0 0 moveto - \def\embeddedps##1{% - \special{ps: @beginspecial @setspecial ##1 @endspecial} - } - % - - \special{! -/stafflinethickness \mudelapaperstaffline\space def -/interline \mudelapaperinterline\space def -interline 3 div /bracket_b exch def -interline 2 mul /bracket_w exch def -stafflinethickness 2 mul /bracket_t exch def -interline 1.5 mul /bracket_v exch def -bracket_v /bracket_u exch def -50 /bracket_alpha exch def -1 setlinecap} +\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} + } } -\def\turnOnExperimentalFeatures{} +\gdef\lilypondexperimentalfeatures{} +\endlinechar \lilypsdefsELC +\endinput