]> git.donarmstrong.com Git - lilypond.git/commitdiff
(note-by-number): read font-size
authorhanwen <hanwen>
Tue, 21 Sep 2004 22:06:04 +0000 (22:06 +0000)
committerhanwen <hanwen>
Tue, 21 Sep 2004 22:06:04 +0000 (22:06 +0000)
to determine stem length. Fixes: markup-note.ly

ChangeLog
lily/slur.cc
scm/define-markup-commands.scm

index f27f7846ec7f5ec1700a64961671cd78239d6225..2715b3a82e8596afed3950f5fb67bb6847de885f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,12 @@
+2004-09-22  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * scm/define-markup-commands.scm (note-by-number): read font-size
+       to determine stem length. Fixes: markup-note.ly
+
 2004-09-21  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
        * lily/slur.cc (outside_slur_callback): read #'padding for
-       slur-padding.
+       slur-padding. Fixes: slur-script.ly
 
        * lily/parser.yy (score_body): disallow \bookpaper in \score.
 
index 7c0580e154520a7aaa8dddefa07f6789ce4ea68b..83c181efe2992c7eee82d5a2c05ddc0bbd189cd1 100644 (file)
@@ -151,7 +151,7 @@ Slur::outside_slur_callback (SCM grob, SCM axis)
   Interval xext = robust_relative_extent (script, cx, X_AXIS);
 
 
-  Real slur_padding = robust_scm2double (me->get_property ("padding"),
+  Real slur_padding = robust_scm2double (script->get_property ("padding"),
                                         0.2);  // todo: slur property, script property?
   yext.widen (slur_padding);
   
index 8bc1a0c1564671bafa073978a5e581d5eb5bbfbd..efae9192a8a83d2093abe01ccd0df5674a10fec5 100644 (file)
@@ -405,22 +405,23 @@ and/or @code{extra-offset} properties. "
 @var{dir}, you can obtain longer or shorter stems."
   
   (let* ((font (ly:paper-get-font paper (cons '((font-encoding . fetaMusic)) props)))
-         (stemlen (max 3 (- log 1)))
-         (headgl (ly:find-glyph-by-name
+        (size (chain-assoc-get 'font-size props 0))
+         (stem-length (* (magstep size) (max 3 (- log 1))))
+         (head-glyph (ly:find-glyph-by-name
                   font
                   (string-append "noteheads-" (number->string (min log 2)))))
-         (stemth 0.13)
-         (stemy (* dir stemlen))
+         (stem-thickness 0.13)
+         (stemy (* dir stem-length))
          (attachx (if (> dir 0)
-                      (- (cdr (ly:stencil-extent headgl X)) stemth)
+                      (- (cdr (ly:stencil-extent head-glyph X)) stem-thickness)
                       0))
          (attachy (* dir 0.28))
-         (stemgl (and (> log 0)
+         (stem-glyph (and (> log 0)
                       (ly:round-filled-box
-                       (cons attachx (+ attachx  stemth))
+                       (cons attachx (+ attachx  stem-thickness))
                        (cons (min stemy attachy)
                              (max stemy attachy))
-                       (/ stemth 3))))
+                       (/ stem-thickness 3))))
          (dot (ly:find-glyph-by-name font "dots-dot"))
          (dotwid (interval-length (ly:stencil-extent dot X)))
          (dots (and (> dot-count 0)
@@ -435,25 +436,25 @@ and/or @code{extra-offset} properties. "
                                               (string-append "flags-"
                                                              (if (> dir 0) "u" "d")
                                                              (number->string log)))
-                       (cons (+ attachx (/ stemth 2)) stemy)))))
+                       (cons (+ attachx (/ stem-thickness 2)) stemy)))))
     (if flaggl
-        (set! stemgl (ly:stencil-add flaggl stemgl)))
-    (if (ly:stencil? stemgl)
-        (set! stemgl (ly:stencil-add stemgl headgl))
-        (set! stemgl headgl))
+        (set! stem-glyph (ly:stencil-add flaggl stem-glyph)))
+    (if (ly:stencil? stem-glyph)
+        (set! stem-glyph (ly:stencil-add stem-glyph head-glyph))
+        (set! stem-glyph head-glyph))
     (if (ly:stencil? dots)
-        (set! stemgl
+        (set! stem-glyph
               (ly:stencil-add
                (ly:stencil-translate-axis dots
                                            (+ (if (and (> dir 0) (> log 2))
                                                   (* 1.5 dotwid)
                                                   0)
                                               ;; huh ? why not necessary?
-                                              ;;(cdr (ly:stencil-extent headgl X))
+                                              ;;(cdr (ly:stencil-extent head-glyph X))
                                               dotwid)
                                            X)
-               stemgl)))
-    stemgl))
+               stem-glyph)))
+    stem-glyph))
 
 (use-modules (ice-9 regex))