]> git.donarmstrong.com Git - lilypond.git/blob - tex/lily-ps-defs.tex
release: 1.2.4
[lilypond.git] / tex / lily-ps-defs.tex
1 %
2 % WARNING: don't leave blank lines in the PS-code; they are
3 % transformed into \par 
4 %
5
6 %
7 % header info (macros/defs, etc) should go into a \special{! ... }, 
8 % note the ! sign.  See dvips.info for details.
9 %
10
11 % Use of 
12 % /foo { operatorname } bind def
13 %
14 % ``compiles'' operatorname binding in the body of foo, making
15 % the code faster, and more reliable (less flexible)
16
17
18 %
19 % TODO : use GUILE for this kind of muckery.
20 %
21
22 {%
23    \def\par{ }%         %Ugh.  Don't try this at home, kids!
24    % neat file-include trick by Piet van Oostrum <piet@cs.uu.nl>
25    \newread\defin 
26    \newtoks\toksfiledefi\newtoks\toksfiledefii 
27    \def\ifnot#1{#1\else\expandafter\expandafter\fi\iffalse\iftrue\fi} 
28    \def\filedef#1#2{%#1=command name, #2=file name 
29            \openin\defin=#2\relax\def#1{} 
30            \ifeof\defin
31                    \message{***************** CAN NOT OPEN #2 ********************}
32                    \end
33            \fi 
34            \loop\ifnot{\ifeof\defin}\read\defin to\tempfiledef
35            \toksfiledefi=\expandafter{#1}% 
36            \toksfiledefii=\expandafter{\tempfiledef}% 
37    %        \expandafter\special\expandafter{!\the\toksfiledefi\the\toksfiledefii}\repeat%
38           \global\edef#1{\the\toksfiledefi\the\toksfiledefii}\repeat%
39    }
40    %
41    % This seems a little backwards, but we don't want to include the PS
42    % stuff too early
43    %
44    \filedef\includelilyps{lily.ps}%
45    \expandafter\special{! \includelilyps }
46 }
47
48
49 \def\turnOnPostScript{%
50         % This sets CTM so that you get to the currentpoint
51         % by executing a 0 0 moveto
52         \def\embeddedps##1{%
53                 \special{ps: @beginspecial @setspecial ##1 @endspecial}       
54         }
55         %
56
57         \special{! 
58 /stafflinethickness \mudelapaperstaffline\space def
59 /interline \mudelapaperinterline\space def
60 interline 3 div /bracket_b exch def
61 interline 2 mul /bracket_w exch def
62 stafflinethickness 2 mul /bracket_t exch def
63 interline 1.5 mul /bracket_v exch def
64 bracket_v /bracket_u exch def
65 50 /bracket_alpha exch def
66 1 setlinecap}
67 }
68
69 \def\turnOnExperimentalFeatures{}
70