]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/tie.cc (print): idem.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 8 Apr 2005 18:34:41 +0000 (18:34 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 8 Apr 2005 18:34:41 +0000 (18:34 +0000)
* lily/slur.cc (print): don't use thickness property for
slur shape-thickness.

* lily/stencil-scheme.cc (LY_DEFINE): don't reverse the order
while adding stencils.

* scm/define-markup-commands.scm (with-color): with-color markup
command.
(whiteout): new markup command
(filled-box): new markup command

ChangeLog
input/regression/beam-quarter.ly
input/regression/markup-syntax.ly
input/regression/whiteout.ly [new file with mode: 0644]
lily/slur.cc
lily/stencil-scheme.cc
lily/tie.cc
scm/define-grobs.scm
scm/define-markup-commands.scm
scm/framework-tex.scm

index 24576f549e5d655c0306f6c69f0d5bf1299a12a8..840652e63353b3c92781824cdae8ac8b4fc339a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2005-04-08  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/tie.cc (print): idem.
+
+       * lily/slur.cc (print): don't use thickness property for
+       slur shape-thickness.
+
+       * lily/stencil-scheme.cc (LY_DEFINE): don't reverse the order
+       while adding stencils.
+
+       * scm/define-markup-commands.scm (with-color): with-color markup
+       command.
+       (whiteout): new markup command 
+       (filled-box): new markup command
+
 2005-04-07  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * Documentation/topdocs/NEWS.tely (Top): Make tex-able.  Handy
index f2967d7b7c22f21ace69a8d91f90cbf63a18329c..a6eb5ec5cd0d5de8dcf131f99916218752748cce 100644 (file)
@@ -2,11 +2,12 @@
 \version "2.4.0"
 \header
 {
-    texidoc= "Quarter notes may be beamed: the beam is halted momentarily."
+  texidoc= "Quarter notes may be beamed: the beam is halted momentarily."
 }
 
-\score { \relative c'' {
-        c8[ c4 c8] % should warn here!
-}
-\layout { raggedright = ##t} 
+\score {
+  \relative c'' {
+    c8[ c4 c8] % should warn here!
+  }
+  \layout { raggedright = ##t }
 }
index ca59620d6d3ce541159953251cbe2c661fa4ceb1..b4ac17530ad7e30e38acdeb3a608966a7dd8ca0f 100644 (file)
@@ -8,7 +8,7 @@ texidoc = "With the new markup syntax, text may be written in various manners."
 \score {
   
    {
-    f'-\markup {
+    f'1-\markup {
                foo
                \raise #0.2 \hbracket \bold bar
                \override #'(baseline-skip . 4)
@@ -24,6 +24,8 @@ texidoc = "With the new markup syntax, text may be written in various manners."
                
                \combine "X" "+"   
                \combine "o" "/"
+               }
+    g'1-\markup {
 %              \char-number #"abc1234abc"
                \box \column { \line { "string 1" } \line { "string 2" } }
                "$\\emptyset$"
@@ -32,7 +34,9 @@ texidoc = "With the new markup syntax, text may be written in various manners."
                \italic Norsk
                \super "2"
                " "
+               \raise #3.0 \whiteout white-out
                \circle \dynamic p
+               \with-color #green Green
                \dynamic sfzp
                \huge { "A" \smaller "A" \smaller \smaller "A"
                        \smaller \smaller \smaller "A" }
diff --git a/input/regression/whiteout.ly b/input/regression/whiteout.ly
new file mode 100644 (file)
index 0000000..a173f64
--- /dev/null
@@ -0,0 +1,18 @@
+\header {
+
+  texidoc = "The whiteout command underlays a white box under a
+markup.  The whitening effect only is only guaranteed for staff lines,
+since staff lines are in a different layer.  "
+
+}
+\version "2.5.18"
+
+\paper
+{
+  raggedright = ##t
+}
+
+{
+  \override TextScript #'extra-offset = #'(2 . 4)
+  c'4-\markup  { \whiteout foo } c
+} 
index a35784eb3d2475e89965aa8375bce045f4454527..929353c00a6f19d0abde93a866f3fc11a526b358 100644 (file)
@@ -57,8 +57,9 @@ Slur::print (SCM smob)
       return SCM_EOL;
     }
 
+  Real staff_thick = Staff_symbol_referencer::line_thickness (me);
   Real base_thick = robust_scm2double (me->get_property ("thickness"), 1);
-  Real thick = base_thick * Staff_symbol_referencer::line_thickness (me);
+  Real thick = base_thick * staff_thick;
 
   Real ss = Staff_symbol_referencer::staff_space (me);
   Bezier one = get_curve (me);
@@ -74,7 +75,8 @@ Slur::print (SCM smob)
     a = Lookup::dashed_slur (one, thick, robust_scm2double (p, 1.0),
                             robust_scm2double (f, 0));
   else
-    a = Lookup::slur (one, get_grob_direction (me) * base_thick * ss / 10.0,
+    a = Lookup::slur (one,
+                     get_grob_direction (me) * staff_thick * 1.0,
                      thick);
 
 #if DEBUG_SLUR_SCORING
index e51fc41bcb8346d6112d4e28ef075b1158511b13..b69c9d70e3051b07951da315f92430d0321c3f0c 100644 (file)
@@ -192,19 +192,26 @@ LY_DEFINE (ly_stencil_add, "ly:stencil-add",
 #define FUNC_NAME __FUNCTION__
   SCM_VALIDATE_REST_ARGUMENT (args);
 
-  Stencil result;
-
+  SCM expr = SCM_EOL;
+  SCM *tail = &expr; 
+  Box extent;
+  extent.set_empty ();
+  
   while (!SCM_NULLP (args))
     {
       Stencil *s = unsmob_stencil (scm_car (args));
       if (!s)
        SCM_ASSERT_TYPE (s, scm_car (args), SCM_ARGn, __FUNCTION__, "Stencil");
 
-      result.add_stencil (*s);
+
+      extent.unite (s->extent_box ());
+      *tail = scm_cons (s->expr (), SCM_EOL);
+      tail = SCM_CDRLOC (*tail);
       args = scm_cdr (args);
     }
 
-  return result.smobbed_copy ();
+  expr = scm_cons (ly_symbol2scm ("combine-stencil"), expr);
+  return Stencil (extent, expr).smobbed_copy ();
 }
 
 LY_DEFINE (ly_make_stencil, "ly:make-stencil",
index 3f9037d57798a8f0eba8734b0586cf8cc4922745..4f28e224642561852e7654add8dd93dc81a8a056 100644 (file)
@@ -332,9 +332,11 @@ Tie::print (SCM smob)
   if (!scm_is_pair (cp))
     return Stencil ().smobbed_copy ();
 
-  Real thick
-    = Staff_symbol_referencer::line_thickness (me)
-    * robust_scm2double (me->get_property ("thickness"), 1);
+
+  Real staff_thick = Staff_symbol_referencer::line_thickness (me);
+  Real base_thick = robust_scm2double (me->get_property ("thickness"), 1);
+  Real thick = base_thick * staff_thick;
+
 
   Bezier b;
   int i = 0;
@@ -344,7 +346,9 @@ Tie::print (SCM smob)
       i++;
     }
 
-  Stencil a = Lookup::slur (b, get_grob_direction (me) * thick, thick);
+  Stencil a = Lookup::slur (b,
+                           get_grob_direction (me) * staff_thick,
+                           thick);
 
   return a.smobbed_copy ();
 }
index d831ce8d72dbed642172881495711b7fadc0f32e..bc401414e967b7371a53692a773aede8c89972f7 100644 (file)
     (PhrasingSlur
      . ((slur-details . ,default-slur-details)
        (print-function . ,Slur::print)
-       (thickness . 1.2)               
+       (thickness . 1.1)               
        (spacing-procedure . ,Spanner::set_spacing_rods)                
        (minimum-length . 1.5)
        (after-line-breaking-callback . ,Slur::after_line_breaking)
     (Slur
      . ((slur-details . ,default-slur-details)
        (print-function . ,Slur::print)
-       (thickness . 1.2)               
+       (thickness . 1.0)               
        (spacing-procedure . ,Spanner::set_spacing_rods)                
        (minimum-length . 1.5)
        (after-line-breaking-callback . ,Slur::after_line_breaking)
        (spacing-procedure . ,Spanner::set_spacing_rods)
        (staffline-clearance . 0.35)
        (details . ((ratio . 0.333) (height-limit . 1.0)))
-       (thickness . 1.2)
+       (thickness . 1.0)
        (x-gap . -0.1)
        (y-offset . 0.6)
        (minimum-length . 2.5)
index f411d539c251565361c6de7a89e0d5e4e86fea5f..7c807d77b79266fb654395e959f940849a296ec0 100644 (file)
@@ -371,6 +371,14 @@ recommend font for this is bold and italic"
   "Draw a double flat symbol."
   (interpret-markup layout props (markup #:musicglyph "accidentals.M4")))
 
+(def-markup-command (with-color layout props color arg) (color? markup?)
+  "Draw @var{arg} in color specified by @var{color}"
+
+  (let* ((stil (interpret-markup layout props arg)))
+
+    (ly:make-stencil (list 'color color (ly:stencil-expr stil))
+                    (ly:stencil-extent stil X)
+                    (ly:stencil-extent stil Y))))
 
 ;;
 ;; TODO: should extract baseline-skip from each argument somehow..
@@ -490,6 +498,28 @@ and/or @code{extra-offset} properties. "
       (ly:stencil-translate-axis stack 0.75 Y))))
 
 
+
+(def-markup-command (filled-box layout props xext yext blot)
+  (number-pair? number-pair? number?)
+  "Draw a box with rounded corners of dimensions @var{xext} and @var{yext}."
+  (ly:round-filled-box
+   xext yext blot))
+
+(def-markup-command (whiteout layout props arg) (markup?)
+  "Provide a white underground for @var{arg}"
+  (let* ((stil (interpret-markup layout props
+                                (make-with-color-markup black arg)))
+        (white
+         (interpret-markup layout props
+                           (make-with-color-markup
+                            white
+                            (make-filled-box-markup
+                             (ly:stencil-extent stil X)
+                             (ly:stencil-extent stil Y)
+                             0.0)))))
+
+    (ly:stencil-add white stil)))
+
 ;; TODO: better syntax.
 
 (def-markup-command (note-by-number layout props log dot-count dir) (number? number? number?)
index be72b57981c15df10deedc75c039b60d4c0d23bb..3674054c6822b02c7c216bc41b27e4b5c486e86f 100644 (file)
     (if (not (ly:get-option 'verbose))
        (begin
          (format (current-error-port)
-                 (_ "Converting to `~a'...") (string-append base ".psbl"))
+                 (_ "Converting to `~a'...") (string-append base ".ps"))
          (newline (current-error-port))))
     (ly:system cmd)))