]> git.donarmstrong.com Git - lilypond.git/blobdiff - tex/lily-ps-defs.tex
release: 1.1.8
[lilypond.git] / tex / lily-ps-defs.tex
index 9ff22292d5a55c4b4e6e8a05168916dff2201ed3..92cf4e73b7be6a719b4c92538caa17ffbcae3c23 100644 (file)
@@ -3,11 +3,6 @@
 % transformed into \par 
 %
 
-%
-% Should put in a lily-ps.ps header?
-%
-%
-
 %
 % header info (macros/defs, etc) should go into a \special{! ... }, 
 % note the ! sign.  See dvips.info for details.
 % ``compiles'' operatorname binding in the body of foo, making
 % the code faster, and more reliable (less flexible)
 
-
 % transplant a TeX dimension into the PS output.
 \def\PSsetTeXdimen#1{\expandafter\special{! /#1 (\the\csname #1\endcsname) deftexdimen}}
-
-\def\turnOnPostScript{%
-\def\embeddedps##1{%
-        % This sets CTM so that you get to the currentpoint
-        % by executing a 0 0 moveto
-        \special{ps: @beginspecial @setspecial ##1 @endspecial}       
+{%
+   \def\par{ }%         %Ugh.  Don't try this at home, kids!
+   % neat file-include trick by Piet van Oostrum <piet@cs.uu.nl>
+   \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}
 }
-%
-% width, slope, height 
-%
-\special{! % round cappings
-1 setlinecap
-/draw_beam
-{
-        2 div /beam_thick exch def
-        /beam_slope exch def
-        /beam_wd exch def
-        beam_slope beam_wd mul /beam_ht exch def
-        0 beam_thick neg moveto 
-        beam_wd beam_ht rlineto 
-        0 beam_thick 2 mul rlineto
-        0 beam_thick lineto
-        closepath fill
-} bind def
+
+
+\special{!
 % PS helper: convert (0.2pt) to the token 0.2
-/settexdimen {  /thestring exch def
+/settexdimen
+{
+        /thestring exch def
         thestring 0 thestring length 2 sub
         getinterval
         token
-        pop exch pop 
-def
+        pop exch pop 
+def
 %
-/deftexdimen {
+/deftexdimen
+{
         settexdimen
         def     
 } def
 }
-%
-\PSsetTeXdimen{staffrulethickness}
-\PSsetTeXdimen{staffheight}
-\special{! %
-/draw_decresc
-        {
-                staffrulethickness setlinewidth
-                /cresc_cont exch def
-                /cresc_ht exch def
-                /cresc_wd exch def
-%
-                cresc_wd cresc_cont moveto
-                0 cresc_ht lineto
-                stroke
-                cresc_wd cresc_cont neg moveto
-                0 cresc_ht neg lineto
-                stroke
-        }
-        bind def
-        /draw_cresc
-        {
-                staffrulethickness setlinewidth
-                /cresc_cont exch def
-                /cresc_ht exch def
-                /cresc_wd exch def
-%
-                0 cresc_cont moveto
-                cresc_wd cresc_ht lineto
-                stroke
-                0 cresc_cont neg moveto
-                cresc_wd cresc_ht neg lineto
-                stroke
-        }
-        bind def
- /lily_distance {
-        1 copy mul exch 1 copy mul add sqrt
- } bind def
- /draw_plet
-        {
-                staffrulethickness setlinewidth
-                /dir exch def
-                /plet_dy exch def
-                /plet_dx exch def
-               staffheight 2 div /plet_gapx exch def
-               plet_dy plet_dx div plet_gapx mul /plet_gapy exch def
-               staffheight 4 div dir mul /plet_h exch def
-%
-               0 0 moveto
-                0 plet_h lineto 
-               plet_dx plet_gapx sub 2 div 
-                       plet_dy plet_gapy sub 2 div plet_h add lineto
-               plet_dx plet_gapx add 2 div 
-                       plet_dy plet_gapy add 2 div plet_h add moveto
-               plet_dx plet_dy plet_h add lineto
-               plet_dx plet_dy lineto
-               stroke
+
+\def\turnOnPostScript{%
+        \PSsetTeXdimen{stafflinethickness}
+        \PSsetTeXdimen{staffheight}
+        
+        % 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}       
         }
-        bind def
- staffheight 2 div /slurhtlimit exch def
-/draw_slur
-{
-       staffrulethickness setlinewidth
-       0 0 moveto
-       rcurveto
-       rcurveto
-       gsave
-       fill
-       grestore
-       stroke
-       } bind def
-}}
+        %
+
+        \special{! 
+/interline \mudelapaperinterline0  def % ugh.  Only works x.yyyy floats 
+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
+staffheight 4 div /interline exch def
+stafflinethickness 1.2 mul /tuplet_t exch def
+stafflinethickness 2.5 mul /volta_t exch def
+1 setlinecap}
+}
 
-\def\turnOnExperimentalFeatures{%
-% draw a slur in embedded postscript
-\special{ps:
-}}
+\def\turnOnExperimentalFeatures{}