]> git.donarmstrong.com Git - lilypond.git/commitdiff
Remove outdated Stencil code.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 17 Jan 2007 13:59:42 +0000 (14:59 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 17 Jan 2007 13:59:42 +0000 (14:59 +0100)
- Stencil::origin_
- Stencil::origin()
- Stencil::moved_to_edge()
- ly:stencil-moved-to-edge
- minimum argument for Stencil::add_at_edge and ly:stencil-combine-at-edge

24 files changed:
lily/accidental.cc
lily/arpeggio.cc
lily/bar-line.cc
lily/beam.cc
lily/dots.cc
lily/hairpin.cc
lily/include/stencil.hh
lily/key-signature-interface.cc
lily/line-spanner.cc
lily/multi-measure-rest.cc
lily/paper-column.cc
lily/percent-repeat-item.cc
lily/slur.cc
lily/stencil-scheme.cc
lily/stencil.cc
lily/sustain-pedal.cc
lily/system-start-delimiter.cc
lily/time-signature.cc
lily/volta-bracket.cc
scm/define-markup-commands.scm
scm/fret-diagrams.scm
scm/page.scm
scm/safe-lily.scm
scm/stencil.scm

index 46d7d53f8bbb750e035280e92d6d3c74b9d41a67..cf47ebcbe1aed5ae2102624afdad0a6e3a48dae3 100644 (file)
@@ -25,8 +25,8 @@ parenthesize (Grob *me, Stencil m)
   Stencil close
     = font->find_by_name ("accidentals.rightparen");
 
-  m.add_at_edge (X_AXIS, LEFT, Stencil (open), 0, 0);
-  m.add_at_edge (X_AXIS, RIGHT, Stencil (close), 0, 0);
+  m.add_at_edge (X_AXIS, LEFT, Stencil (open), 0);
+  m.add_at_edge (X_AXIS, RIGHT, Stencil (close), 0);
 
   return m;
 }
@@ -177,7 +177,7 @@ Accidental_interface::print (SCM smob)
       if (acc.is_empty ())
        me->warning (_ ("natural alteration glyph not found"));
       else
-       mol.add_at_edge (X_AXIS, LEFT, acc, 0.1, 0);
+       mol.add_at_edge (X_AXIS, LEFT, acc, 0.1);
     }
   
   if (to_boolean (me->get_property ("parenthesized")))
index 381f6fe48f63d4a63c42249ff10634fa97ae2142..234dbc44e3bd2575b9ffc5b87f9284ad49d7c4dc 100644 (file)
@@ -84,11 +84,11 @@ Arpeggio::print (SCM smob)
 
   for (Real y = heads[LEFT]; y < heads[RIGHT];
        y += squiggle.extent (Y_AXIS).length ())
-    mol.add_at_edge (Y_AXIS, UP, squiggle, 0.0, 0);
+    mol.add_at_edge (Y_AXIS, UP, squiggle, 0.0);
 
   mol.translate_axis (heads[LEFT], Y_AXIS);
   if (dir)
-    mol.add_at_edge (Y_AXIS, dir, arrow, 0, 0);
+    mol.add_at_edge (Y_AXIS, dir, arrow, 0);
 
   return mol.smobbed_copy ();
 }
index f87ebd4767ad7a00aa4732e797af0a008e2843d3..75dbc6c1be36779ab174971dd9a7cafc6f46aca4 100644 (file)
@@ -78,37 +78,37 @@ Bar_line::compound_barline (Grob *me, string str, Real h,
     return thin;
   else if (str == "|." || (h == 0 && str == ":|"))
     {
-      m.add_at_edge (X_AXIS, LEFT, thick, 0, 0);
-      m.add_at_edge (X_AXIS, LEFT, thin, kern, 0);
+      m.add_at_edge (X_AXIS, LEFT, thick, 0);
+      m.add_at_edge (X_AXIS, LEFT, thin, kern);
     }
   else if (str == ".|" || (h == 0 && str == "|:"))
     {
-      m.add_at_edge (X_AXIS, RIGHT, thick, 0, 0);
-      m.add_at_edge (X_AXIS, RIGHT, thin, kern, 0);
+      m.add_at_edge (X_AXIS, RIGHT, thick, 0);
+      m.add_at_edge (X_AXIS, RIGHT, thin, kern);
     }
   else if (str == ":|")
     {
-      m.add_at_edge (X_AXIS, LEFT, thick, 0, 0);
-      m.add_at_edge (X_AXIS, LEFT, thin, kern, 0);
-      m.add_at_edge (X_AXIS, LEFT, colon, kern, 0);
+      m.add_at_edge (X_AXIS, LEFT, thick, 0);
+      m.add_at_edge (X_AXIS, LEFT, thin, kern);
+      m.add_at_edge (X_AXIS, LEFT, colon, kern);
     }
   else if (str == "|:")
     {
-      m.add_at_edge (X_AXIS, RIGHT, thick, 0, 0);
-      m.add_at_edge (X_AXIS, RIGHT, thin, kern, 0);
-      m.add_at_edge (X_AXIS, RIGHT, colon, kern, 0);
+      m.add_at_edge (X_AXIS, RIGHT, thick, 0);
+      m.add_at_edge (X_AXIS, RIGHT, thin, kern);
+      m.add_at_edge (X_AXIS, RIGHT, colon, kern);
     }
   else if (str == ":|:")
     {
-      m.add_at_edge (X_AXIS, LEFT, thick, thinkern, 0);
-      m.add_at_edge (X_AXIS, LEFT, colon, kern, 0);
-      m.add_at_edge (X_AXIS, RIGHT, thick, kern, 0);
-      m.add_at_edge (X_AXIS, RIGHT, colon, kern, 0);
+      m.add_at_edge (X_AXIS, LEFT, thick, thinkern);
+      m.add_at_edge (X_AXIS, LEFT, colon, kern);
+      m.add_at_edge (X_AXIS, RIGHT, thick, kern);
+      m.add_at_edge (X_AXIS, RIGHT, colon, kern);
     }
   else if (str == ".|.")
     {
-      m.add_at_edge (X_AXIS, LEFT, thick, thinkern, 0);
-      m.add_at_edge (X_AXIS, RIGHT, thick, kern, 0);
+      m.add_at_edge (X_AXIS, LEFT, thick, thinkern);
+      m.add_at_edge (X_AXIS, RIGHT, thick, kern);
     }
   else if (str == "||")
     {
@@ -116,8 +116,8 @@ Bar_line::compound_barline (Grob *me, string str, Real h,
        should align to other side? this never appears
        on the system-start?
       */
-      m.add_at_edge (X_AXIS, RIGHT, thin, 0, 0);
-      m.add_at_edge (X_AXIS, RIGHT, thin, thinkern, 0);
+      m.add_at_edge (X_AXIS, RIGHT, thin, 0);
+      m.add_at_edge (X_AXIS, RIGHT, thin, thinkern);
     }
   else if (str == ":")
     {
index a782cdfac466447ee95429fc26b119488e021365..ecc9d0b5a6ea979dcec6546bb7078fe44cf8ebac 100644 (file)
@@ -554,7 +554,7 @@ Beam::print (SCM grob)
                                    (me->layout ()->self_scm (), properties, quant_score));
 
       if (!score.is_empty ())
-       the_beam.add_at_edge (Y_AXIS, stem_dir, score, 1.0, 0);
+       the_beam.add_at_edge (Y_AXIS, stem_dir, score, 1.0);
     }
 #endif
 
index 8a874c09b804587dfcc697461ddc4a285618b5b0..97ac61128e8e0ffe20901b1ec5ccec4313c6dd25 100644 (file)
@@ -52,7 +52,7 @@ Dots::print (SCM d)
       for (int i = scm_to_int (c); i--;)
        {
          d.translate_axis (2 * dw, X_AXIS);
-         mol.add_at_edge (X_AXIS, RIGHT, d, dw, 0);
+         mol.add_at_edge (X_AXIS, RIGHT, d, dw);
        }
     }
   return mol.smobbed_copy ();
index f11e78def56b17a95cfa46188ac42ce8a3dc17a0..20808956ae9607264d9ee84699bf778835e19cd2 100644 (file)
@@ -246,7 +246,7 @@ Hairpin::print (SCM smob)
        don't add another circle the hairpin is broken
       */
       if (!broken[tip_dir])
-       mol.add_at_edge (X_AXIS, tip_dir, Stencil (circle), 0, 0);
+       mol.add_at_edge (X_AXIS, tip_dir, Stencil (circle), 0);
     }
 
   mol.translate_axis (x_points[LEFT]
index 055728de0584c6dde0eb293868f156724ccc5441..445e461380b61550241da5920d200926b324561e 100644 (file)
@@ -46,12 +46,6 @@ using namespace std;
 */
 class Stencil
 {
-  /*
-    This provides the reference point of the symbol, for example with
-    characters, it is on the base line of the character. Usually,
-    ORIGIN is inside DIM_
-  */
-  Offset origin_;
   Box dim_;
   SCM expr_;
 
@@ -60,17 +54,12 @@ public:
   Stencil (Box, SCM s);
   Stencil ();
 
-  Offset origin () const;
   SCM expr () const;
 
   /**
      Set dimensions to empty, or to (Interval (0, 0), Interval (0, 0) */
   void set_empty (bool);
-  Stencil moved_to_edge (Axis a, Direction d, const Stencil &m, Real padding,
-                        Real minimum) const;
-
-  void add_at_edge (Axis a, Direction d, const Stencil &m, Real padding,
-                   Real minimum);
+  void add_at_edge (Axis a, Direction d, const Stencil &m, Real padding);
   void add_stencil (Stencil const &m);
   void translate (Offset);
   Stencil translated (Offset) const;
index 0db5cf7b69be290076c63ac55dc1668542ffde6c..7c88268b624b9a70d1542932e354b3bab760f73e 100644 (file)
@@ -97,7 +97,7 @@ Key_signature_interface::print (SCM smob)
              && last_pos > pos - 6)
            padding = 0.3;
 
-         mol.add_at_edge (X_AXIS, LEFT, acc, padding, 0);
+         mol.add_at_edge (X_AXIS, LEFT, acc, padding);
          last_pos = pos;
        }
     }
index 8baa5363e872e343025fe12191c9a919874af7e2..f6809cda266d7f69ffb33487cbe018f2d90129b3 100644 (file)
@@ -136,7 +136,7 @@ Line_spanner::line_stencil (Grob *me,
       Stencil mol;
 
       do
-       mol.add_at_edge (X_AXIS, RIGHT, m, 0, 0);
+       mol.add_at_edge (X_AXIS, RIGHT, m, 0);
       while (m.extent (X_AXIS).length ()
             && mol.extent (X_AXIS).length ()
             + m.extent (X_AXIS).length () < dz[X_AXIS])
index 5be417004b33b9a1711248bf6d7c3756d1395e44..1b66670a7c780bc05e22a2e0544edd17cc2d1852 100644 (file)
@@ -183,8 +183,8 @@ Multi_measure_rest::big_rest (Grob *me, Real width)
   Stencil m = Lookup::round_filled_box (b, blot);
   Stencil yb = Lookup::round_filled_box (Box (Interval (-0.5, 0.5) * ythick, Interval (-ss, ss)), blot);
 
-  m.add_at_edge (X_AXIS, RIGHT, yb, 0, 0);
-  m.add_at_edge (X_AXIS, LEFT, yb, 0, 0);
+  m.add_at_edge (X_AXIS, RIGHT, yb, 0);
+  m.add_at_edge (X_AXIS, LEFT, yb, 0);
 
   m.align_to (X_AXIS, LEFT);
 
@@ -268,7 +268,7 @@ Multi_measure_rest::church_rest (Grob *me, Font_metric *musfont, int measures,
   Stencil mol;
   for (SCM s = mols; scm_is_pair (s); s = scm_cdr (s))
     mol.add_at_edge (X_AXIS, LEFT, *unsmob_stencil (scm_car (s)),
-                    inner_padding, 0);
+                    inner_padding);
   mol.align_to (X_AXIS, LEFT);
   mol.translate_axis (outer_padding_factor * inner_padding, X_AXIS);
 
index c313475f49cdf0760d317bce8ad73a6b3461641c..4dba6bbbd58f08784b55e5cbef2e38e96edc8355 100644 (file)
@@ -160,7 +160,7 @@ Paper_column::print (SCM p)
                                                   properties,
                                                   ly_string2scm (when));
   Stencil t = *unsmob_stencil (scm_mol);
-  t.add_at_edge (Y_AXIS, DOWN, *unsmob_stencil (when_mol), 0.1, 0.1);
+  t.add_at_edge (Y_AXIS, DOWN, *unsmob_stencil (when_mol), 0.1);
   t.align_to (X_AXIS, CENTER);
   t.align_to (Y_AXIS, DOWN);
 
index 6d37c0c6198ae2bed2f71775d7641e8e286b3df5..451647fb5cc03739fc9a98ee58dc1f12e7621eb1 100644 (file)
@@ -38,14 +38,14 @@ Percent_repeat_item_interface::x_percent (Grob *me, int count,
   Stencil s = brew_slash (me);
 
   for (int i = count; i--;)
-    m.add_at_edge (X_AXIS, RIGHT, s, -slash_neg_kern, 0);
+    m.add_at_edge (X_AXIS, RIGHT, s, -slash_neg_kern);
   Stencil d1 = Font_interface::get_default_font (me)->find_by_name ("dots.dot");
   Stencil d2 = d1;
   d1.translate_axis (0.5, Y_AXIS);
   d2.translate_axis (-0.5, Y_AXIS);
 
-  m.add_at_edge (X_AXIS, LEFT, d1, -dot_neg_kern, 0);
-  m.add_at_edge (X_AXIS, RIGHT, d2, -dot_neg_kern, 0);
+  m.add_at_edge (X_AXIS, LEFT, d1, -dot_neg_kern);
+  m.add_at_edge (X_AXIS, RIGHT, d2, -dot_neg_kern);
 
   return m;
 }
index 269c6b551b5bf56c3fd42133a8b3c593b14c974b..1f9e605fb96f10d5e26bccb8507a87f7d9a0adbc 100644 (file)
@@ -153,7 +153,7 @@ Slur::print (SCM smob)
       Stencil tm = *unsmob_stencil (Text_interface::interpret_markup
                                    (me->layout ()->self_scm (), properties,
                                     quant_score));
-      a.add_at_edge (Y_AXIS, get_grob_direction (me), tm, 1.0, 0);
+      a.add_at_edge (Y_AXIS, get_grob_direction (me), tm, 1.0);
     }
 #endif
 
index 13c291da3526d04014b0f1c42c66ad8ae09758f4..6ef0e191fd4394bad150cf94dfc7aa45151f3e23 100644 (file)
@@ -85,60 +85,6 @@ LY_DEFINE (ly_stencil_empty_p, "ly:stencil-empty?",
   return scm_from_bool (s->is_empty ());
 }
 
-LY_DEFINE (ly_stencil_origin, "ly:stencil-origin",
-          2, 0, 0, (SCM stil, SCM axis),
-          "Return a pair of numbers signifying the origin @var{stil} in "
-          "@var{axis} direction (0 or 1 for x and y axis respectively).")
-{
-  Stencil *s = unsmob_stencil (stil);
-  SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
-  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
-
-  return scm_from_double (s->origin ()[Axis (scm_to_int (axis))]);
-}
-
-LY_DEFINE (ly_stencil_moved_to_edge, "ly:stencil-moved-to-edge",
-          4, 2, 0, (SCM first, SCM axis, SCM direction, SCM second,
-                    SCM padding, SCM minimum),
-          "Similar to @code{ly:stencil-combine-edge}, but returns "
-          "@var{second} positioned to be next to @var{first}. ")
-{
-  /*
-    C&P from combine-at-edge.
-
-    fixme: just used once.
-  */
-  Stencil *s1 = unsmob_stencil (first);
-  Stencil *s2 = unsmob_stencil (second);
-  Stencil first_stencil;
-
-  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
-  SCM_ASSERT_TYPE (is_direction (direction), direction, SCM_ARG4, __FUNCTION__, "dir");
-
-  Real p = 0.0;
-  if (padding != SCM_UNDEFINED)
-    {
-      SCM_ASSERT_TYPE (scm_is_number (padding), padding, SCM_ARG5, __FUNCTION__, "number");
-      p = scm_to_double (padding);
-    }
-  Real m = 0.0;
-  if (minimum != SCM_UNDEFINED)
-    {
-      SCM_ASSERT_TYPE (scm_is_number (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
-      m = scm_to_double (minimum);
-    }
-
-  if (s1)
-    first_stencil = *s1;
-
-  if (s2)
-    return first_stencil.moved_to_edge (Axis (scm_to_int (axis)),
-                                       Direction (scm_to_int (direction)),
-                                       *s2, p, m).smobbed_copy ();
-  else
-    return Stencil ().smobbed_copy ();
-}
-
 LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
           4, 2, 0, (SCM first, SCM axis, SCM direction,
                     SCM second,
@@ -181,7 +127,7 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
 
   if (s2)
     result.add_at_edge (Axis (scm_to_int (axis)),
-                       Direction (scm_to_int (direction)), *s2, p, m);
+                       Direction (scm_to_int (direction)), *s2, p);
 
   return result.smobbed_copy ();
 }
index 0da8031c4ba05e6e50dc27d67044a76aee16aa06..b88b0c8bdebb50581e275babe0a9fdb819e17f23 100644 (file)
@@ -72,11 +72,6 @@ Stencil::extent_box () const
 {
   return dim_;
 }
-Offset
-Stencil::origin () const
-{
-  return origin_;
-}
 
 /*
  * Rotate this stencil around the point [x, y]
@@ -143,7 +138,6 @@ Stencil::translate (Offset o)
                      expr_, SCM_UNDEFINED);
   if (!is_empty ())
     dim_.translate (o);
-  origin_ += o;
 }
 
 void
@@ -186,13 +180,9 @@ Stencil::align_to (Axis a, Real x)
   translate_axis (-i.linear_combination (x), a);
 }
 
-/* FIXME: unintuitive naming, you would expect *this to be moved.
-   Kept (keeping?) API for compat with add_at_edge ().
-
-   What is PADDING, what is MINIMUM, exactly?  */
-Stencil
-Stencil::moved_to_edge (Axis a, Direction d, Stencil const &s,
-                       Real padding, Real minimum) const
+/*  See scheme Function.  */
+void
+Stencil::add_at_edge (Axis a, Direction d, Stencil const &s, Real padding)
 {
   Interval my_extent = dim_[a];
   Interval i (s.extent (a));
@@ -210,20 +200,7 @@ Stencil::moved_to_edge (Axis a, Direction d, Stencil const &s,
 
   Stencil toadd (s);
   toadd.translate_axis (offset, a);
-
-  if (minimum > 0 && d * (-origin ()[a] + toadd.origin ()[a]) < minimum)
-    toadd.translate_axis (-toadd.origin ()[a]
-                         + origin ()[a] + d * minimum, a);
-
-  return toadd;
-}
-
-/*  See scheme Function.  */
-void
-Stencil::add_at_edge (Axis a, Direction d, Stencil const &s, Real padding,
-                     Real minimum)
-{
-  add_stencil (moved_to_edge (a, d, s, padding, minimum));
+  add_stencil (toadd);
 }
 
 Stencil
index d36bb8d432db95e3b5f57de847d2751d771fa3a2..8056ea89a2448a99bafb24493ad00eb9921ecb4c 100644 (file)
@@ -58,7 +58,7 @@ Sustain_pedal::print (SCM smob)
        idx += string (&text.c_str ()[i], 1);
       Stencil m = Font_interface::get_default_font (e)->find_by_name (idx);
       if (!m.is_empty ())
-       mol.add_at_edge (X_AXIS, RIGHT, m, 0, 0);
+       mol.add_at_edge (X_AXIS, RIGHT, m, 0);
     }
 
   return mol.smobbed_copy ();
index a42d73c16d9d5e35886f130deab3a8dd82f78e15..206ccd84db7cf68dfede69e5c67c0095b75b64a7 100644 (file)
@@ -42,7 +42,7 @@ System_start_delimiter::staff_bracket (Grob *me, Real height)
   Stencil bracket = Lookup::filled_box (box);
   Direction d = DOWN;
   do
-    bracket.add_at_edge (Y_AXIS, d, tips[d], -overlap, 0.0);
+    bracket.add_at_edge (Y_AXIS, d, tips[d], -overlap);
   while (flip (&d) != DOWN);
   bracket = Stencil (box, bracket.expr ());
 
index 273fe1c56c9ef013886d13ac0f94595ab39324e2..c4afd8caa0d2d092e24d339019c4f593006e7acd 100644 (file)
@@ -106,8 +106,8 @@ Time_signature::numbered_time_signature (Grob *me, int num, int den)
   Stencil m;
   if (den)
     {
-      m.add_at_edge (Y_AXIS, UP, n, 0.0, 0);
-      m.add_at_edge (Y_AXIS, DOWN, d, 0.0, 0);
+      m.add_at_edge (Y_AXIS, UP, n, 0.0);
+      m.add_at_edge (Y_AXIS, DOWN, d, 0.0);
     }
   else
     {
index 53636c709e94ed192210c0463520e5788e0ef79d..49018d8adb1692f4a3913bde223974ad6813a73f 100644 (file)
@@ -99,7 +99,7 @@ Volta_bracket_interface::print (SCM smob)
       num.align_to (Y_AXIS, UP);
       num.translate_axis (-0.5, Y_AXIS);
       total.add_at_edge (X_AXIS, LEFT, num, - num.extent (X_AXIS).length ()
-                        - 1.0, 0);
+                        - 1.0);
     }
   
   total.translate_axis (left, X_AXIS);
index aef9e3aa284eeab47ca7a76ffa09c0416f59c1fe..12dd691634b4bf127761ac77f29056e1dcf1145e 100644 (file)
@@ -716,7 +716,7 @@ alignment accordingly."
   (let* ((m1 (interpret-markup layout props arg1))
         (m2 (interpret-markup layout props arg2)))
 
-    (ly:stencil-combine-at-edge m1 axis dir m2 0.0 0.0)
+    (ly:stencil-combine-at-edge m1 axis dir m2 0.0)
   ))
 
 (define-builtin-markup-command (transparent layout props arg) (markup?)
@@ -1465,80 +1465,6 @@ that.
   (let ((th 0.1) ;; todo: take from GROB.
         (m (interpret-markup layout props arg)))
     (bracketify-stencil m Y th (* 2.5 th) th)))
-
-(define-builtin-markup-command (bracketed-y-column layout props indices args)
-  (list? markup-list?)
-  "Make a column of the markups in @var{args}, putting brackets around
-the elements marked in @var{indices}, which is a list of numbers.
-
-"
-;;
-;; DROPME? This command is a relic from the old figured bass implementation.
-;;
-  
-  (define (sublist lst start stop)
-    (take (drop lst start) (- (1+ stop) start)))
-
-  (define (stencil-list-extent ss axis)
-    (cons
-     (apply min (map (lambda (x) (car (ly:stencil-extent x axis))) ss))
-     (apply max (map (lambda (x) (cdr (ly:stencil-extent x axis))) ss))))
-  
-
-  (define (stack-stencils-vertically stencils bskip last-stencil)
-    (cond
-     ((null? stencils) '())
-     ((not (ly:stencil? last-stencil))
-      (cons (car stencils)
-           (stack-stencils-vertically (cdr stencils) bskip (car stencils))))
-     (else
-      (let* ((orig (car stencils))
-            (dir (chain-assoc-get 'direction  props DOWN))
-            (new (ly:stencil-moved-to-edge last-stencil Y dir
-                                           orig
-                                           0.1 bskip)))
-
-       (cons new (stack-stencils-vertically (cdr stencils) bskip new))))))
-
-  (define (make-brackets stencils indices acc)
-    (if (and stencils
-            (pair? indices)
-            (pair? (cdr indices)))
-       (let* ((encl (sublist stencils (car indices) (cadr indices)))
-              (x-ext (stencil-list-extent encl X))
-              (y-ext (stencil-list-extent encl Y))
-              (thick 0.10)
-              (pad 0.35)
-              (protusion (* 2.5 thick))
-              (lb
-               (ly:stencil-translate-axis 
-                (ly:bracket Y y-ext thick protusion)
-                (- (car x-ext) pad) X))
-              (rb (ly:stencil-translate-axis
-                   (ly:bracket Y y-ext thick (- protusion))
-                   (+ (cdr x-ext) pad) X)))
-
-         (make-brackets
-          stencils (cddr indices)
-          (append
-           (list lb rb)
-           acc)))
-       acc))
-
-  (let* ((stencils
-         (map (lambda (x)
-                (interpret-markup
-                 layout
-                 props
-                 x)) args))
-        (leading
-         (chain-assoc-get 'baseline-skip props))
-        (stacked (stack-stencils-vertically
-                  (remove ly:stencil-empty? stencils) 1.25 #f))
-        (brackets (make-brackets stacked indices '())))
-
-    (apply ly:stencil-add
-          (append stacked brackets))))
 \f
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
index a682a824be38baaa5d87f3c0f978e4028dd138b3..69194956f326c1810c1745c942e05103f1e461af 100644 (file)
@@ -80,44 +80,44 @@ Line thickness is given by @var{th}, fret & string spacing by
         (ly:stencil-combine-at-edge
          (draw-strings (- string-count 1) fret-range th size) X RIGHT
          string-stencil
-         gap 0))))
+         gap))))
 
 (define (draw-fret-lines fret-count string-count th size)
- "Draw @var{fret-count} frets (horizontal lines) for a fret diagram
 "Draw @var{fret-count} frets (horizontal lines) for a fret diagram
 with @var{string-count} strings.  Line thickness is given by @var{th},
 fret & string spacing by @var{size}. "
-   (let* ((fret-length (* (- string-count 1) size))
-          (sth (* size th))
-          (half-thickness (* sth 0.5))
-          (gap (- size sth))
-          (fret-line (ly:make-stencil (list 'draw-line sth half-thickness size (- fret-length half-thickness) size)
-                          (cons 0 fret-length)
-                          (cons (- size half-thickness) (+  size half-thickness)))))
-       (if (= fret-count 1)
-         fret-line
-         (ly:stencil-combine-at-edge fret-line Y UP
-          (draw-fret-lines (- fret-count 1) string-count th size)
-          gap 0))))
-          
+  (let* ((fret-length (* (- string-count 1) size))
+        (sth (* size th))
+        (half-thickness (* sth 0.5))
+        (gap (- size sth))
+        (fret-line (ly:make-stencil (list 'draw-line sth half-thickness size (- fret-length half-thickness) size)
+                                    (cons 0 fret-length)
+                                    (cons (- size half-thickness) (+  size half-thickness)))))
+    (if (= fret-count 1)
+       fret-line
+       (ly:stencil-combine-at-edge fret-line Y UP
+                                   (draw-fret-lines (- fret-count 1) string-count th size)
+                                   gap))))
+
 (define (draw-thick-top-fret props string-count th size)
- "Draw a thick top fret for a fret diagram whose base fret is not 1."
-   (let* ((sth (* th size))
-;          (top-fret-thick (* sth (chain-assoc-get 'top-fret-thickness props 3.0)))
-          (top-fret-thick (* sth 3.0))
-;          (top-half-thick (* top-fret-thick 0.5))
-          (half-thick (* sth 0.5))
-          (x1 half-thick)
-          (x2 (+ half-thick (* size (- string-count 1))))
-          (y1 (- half-thick))
-          (y2 (+ top-fret-thick half-thick))
-          (x-extent (cons (- x1) x2))
-          (y-extent (cons 0 y2)))
-          (ly:make-stencil (list 'round-filled-box x1 x2 y1 y2 sth)
-                            x-extent y-extent)))           
 "Draw a thick top fret for a fret diagram whose base fret is not 1."
+  (let* ((sth (* th size))
+                                       ;          (top-fret-thick (* sth (chain-assoc-get 'top-fret-thickness props 3.0)))
+        (top-fret-thick (* sth 3.0))
+                                       ;          (top-half-thick (* top-fret-thick 0.5))
+        (half-thick (* sth 0.5))
+        (x1 half-thick)
+        (x2 (+ half-thick (* size (- string-count 1))))
+        (y1 (- half-thick))
+        (y2 (+ top-fret-thick half-thick))
+        (x-extent (cons (- x1) x2))
+        (y-extent (cons 0 y2)))
+    (ly:make-stencil (list 'round-filled-box x1 x2 y1 y2 sth)
+                    x-extent y-extent)))           
+
+
 (define (draw-frets layout props fret-range string-count th size)
- "Draw the frets (horizontal lines) for a fret diagram with
 "Draw the frets (horizontal lines) for a fret diagram with
 @var{string-count} strings and frets as indicated in @var{fret-range}.
 Line thickness is given by @var{th}, fret & string spacing by
 @var{size}. "
@@ -125,13 +125,13 @@ Line thickness is given by @var{th}, fret & string spacing by
          (fret-length (* (- string-count 1) size))
          (half-thickness (* th 0.5))
          (base-fret (car fret-range)))
-       (ly:stencil-combine-at-edge
-          (draw-fret-lines fret-count string-count th size) Y UP
-             (if (= base-fret 1)
-                 (draw-thick-top-fret props string-count th size)
-                 (draw-fret-lines 1 string-count th size)) 
-                 (- size th) 0))) 
-                 
+    (ly:stencil-combine-at-edge
+     (draw-fret-lines fret-count string-count th size) Y UP
+     (if (= base-fret 1)
+        (draw-thick-top-fret props string-count th size)
+        (draw-fret-lines 1 string-count th size)) 
+     (- size th)))) 
+
 
 (define (draw-dots layout props string-count fret-range size finger-code 
                     dot-position dot-radius dot-thickness dot-list)
@@ -383,11 +383,11 @@ indications per string.
          (if (not (null? xo-list))
              (set! fret-diagram-stencil (ly:stencil-combine-at-edge
                                     fret-diagram-stencil Y UP
-                                    (draw-xo layout props string-count fret-range size xo-list) xo-padding 0)))
+                                    (draw-xo layout props string-count fret-range size xo-list) xo-padding)))
          (if (> (car fret-range) 1) 
              (set! fret-diagram-stencil
                    (ly:stencil-combine-at-edge fret-diagram-stencil X label-dir
-                                              (label-fret layout props string-count fret-range size) label-space 0)))
+                                              (label-fret layout props string-count fret-range size) label-space)))
          (ly:stencil-aligned-to fret-diagram-stencil X alignment)
         ))
          
index 40fd537557f0ad6b5c8f91d03e97c52f5620308e..3e25bdaaee3b46059ce22a90eb1578cb8b7b6426 100644 (file)
          (set! head-stencil
                (ly:stencil-combine-at-edge
                 stencil Y dir head-stencil
-                sep 0.0))
+                sep))
 
          
          ;; add arrow markers 
index 65c5bfa6dddc5d9f5c3b7946bb3967192e7b5e7f..c47f05583b26f21e3b2f888ef44f15a78090f1ce 100644 (file)
    ly:stencil-combine-at-edge
    ly:stencil-expr
    ly:stencil-extent
-   ly:stencil-moved-to-edge
    ly:stencil-translate
    ly:stencil-translate-axis
    ly:stencil?
index 62b43cebc260a13f4f2ec3402c99ba9475dbe4df..410e0eebe1ffb386a99e8d4dee089030c5e61b83 100644 (file)
@@ -240,11 +240,11 @@ encloses the contents.
          (set! annotation
                 (center-stencil-on-extent text-stencil))
          (set! annotation
-               (ly:stencil-combine-at-edge arrows X RIGHT annotation 0.5 0))
+               (ly:stencil-combine-at-edge arrows X RIGHT annotation 0.5))
          (set! annotation
                (ly:stencil-combine-at-edge annotation X LEFT
                                             (center-stencil-on-extent dim-stencil)
-                                            0.5 0))
+                                            0.5))
          (set! annotation
                (ly:make-stencil (list 'color color (ly:stencil-expr annotation))
                                 (ly:stencil-extent annotation X)