]> git.donarmstrong.com Git - lilypond.git/blobdiff - tex/lily-ps-defs.tex
front port
[lilypond.git] / tex / lily-ps-defs.tex
index 59e4d4e857e788e75f62999ea25a2a78e4964096..4efc3c418cb7c622207c37707adba1d3d897bb3c 100644 (file)
+% lily-ps-defs.tex
 %
-% WARNING: don't leave blank lines in the PS-code; they are
-% transformed into \par 
-%
-
-%
-% Should put in a lily-ps.ps header?
-%
-%
+\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.
 %
+% Escape the colon with \string to avoid problems with French while using
+% the Babel package.
 
-% Use of 
-% /foo { operatorname } bind def
-%
-% ``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\PSsetTeXdimen#1{
+  \expandafter\special{
+    ! /#1 (\csname #1\endcsname) set_tex_dimen
+  }
 }
-%
-% 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
-% PS helper: convert (0.2pt) to the token 0.2
-/settexdimen {  /thestring exch def
-        thestring 0 thestring length 2 sub
-        getinterval
-        token
-        pop exch pop } 
-def
-%
-/deftexdimen {
-        settexdimen
-        def     
-} def
+
+\def\lilySpace{ }
+
+\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}
 }
-%
-\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
-staffrulethickness 1.2 mul /plet_t exch def
-/draw_plet
-{
-       plet_t setlinewidth
-       true setstrokeadjust
-       1 setlinecap
-       1 setlinejoin
-       /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
-} bind def
-staffheight 2 div /slurhtlimit exch def
-/draw_slur
-{
-       staffrulethickness setlinewidth
-       moveto
-       curveto
-       lineto
-       curveto
-       gsave
-       fill
-       grestore
-       stroke
-       } bind def
-%
-staffheight 4 div /interline exch def
-%
-/bracket_traject
-{
-  /traject_ds exch def
-  /traject_alpha exch def
-  traject_ds traject_alpha sin mul add
-  exch
-  traject_ds traject_alpha cos mul add
-  exch
-} bind def
-%
-interline 2 div /bracket_b exch def
-interline 2 mul /bracket_w exch def
-staffrulethickness /stafflinethickness 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
-%
-/half_bracket
-{
-%6
-       0 0
-%5a
-       bracket_b bracket_v add bracket_h bracket_t sub bracket_u add
-       bracket_alpha bracket_v -0.15 mul bracket_traject
-%5b
-       1 bracket_h
-       0 bracket_v 0.5 mul bracket_traject
-%5c
-       0 bracket_h
-%4a
-       bracket_b bracket_h bracket_t sub
-       0 bracket_v 0.4 mul bracket_traject
-%4b
-       bracket_b bracket_v add bracket_h bracket_t sub bracket_u add
-       bracket_alpha bracket_v -0.25 mul bracket_traject
-%4c
-       bracket_b bracket_v add bracket_h bracket_t sub bracket_u add
-%3
-       bracket_b bracket_h bracket_t sub
-%2
-       bracket_b 0
-%1
-       0 0
-} bind def
-%
-/draw_half_bracket {
-       moveto
-       lineto
-       lineto
-       curveto
-       curveto
-       lineto
-       gsave
-       fill
-       grestore
-} bind def
-%
-/draw_bracket
-{
-       2 div bracket_b add /bracket_h exch def
-       bracket_t setlinewidth
-       true setstrokeadjust
-       1 setlinecap
-       1 setlinejoin
-       half_bracket
-       20 copy
-       1 -1 scale
-       draw_half_bracket
-       stroke
-       1 -1 scale
-% ugh, ugh:
-       0.05 0 translate
-       draw_half_bracket
-       stroke
-} bind def
-}}
 
-\def\turnOnExperimentalFeatures{%
-% draw a slur in embedded postscript
-\special{ps:
-}}
+\def\turnOnExperimentalFeatures{}
 
+\endlinechar \lilypsdefsELC
+\endinput