]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 27 Jul 2002 00:58:29 +0000 (00:58 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 27 Jul 2002 00:58:29 +0000 (00:58 +0000)
ChangeLog
lily/note-head.cc
scm/output-lib.scm

index ad257c8e5060bf8d9c054232f9674cd1b9e39a1d..b9194ec07f9c629186e4bea171729711d2a40da4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-07-27  Juergen Reuter  <reuter@ipd.uka.de>
+
+       * scm/output-lib.scm, lily/note-head.cc: fixed broken baroque
+       note-head style by setting grob property font-family
+       automatically.
+
 2002-07-26  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * Documentation/user/lilypond-book.itely (Insert music snippets
index 39aeb99c7a170ddcabc45fb44d392d601318c879..cd9bc3729c4fd2a5614d67a71c02ff1a9e8f57f5 100644 (file)
@@ -120,11 +120,18 @@ internal_brew_molecule (Grob *me,  bool ledger_take_space)
   SCM exp = scm_list_n (ly_symbol2scm ("find-notehead-symbol"), log,
                        ly_quote_scm (style),
                        SCM_UNDEFINED);
-  String name = "noteheads-" + ly_scm2string (scm_primitive_eval (exp));
-  Molecule out = Font_interface::get_default_font (me)->find_by_name (name);
-  if (out.empty_b())
-    {
-      warning (_f("Symbol not found, ", name.to_str0 ()));
+  SCM scm_pair = scm_primitive_eval (exp);
+  SCM scm_font_char = ly_car (scm_pair);
+  SCM scm_font_family = ly_cdr (scm_pair);
+  String font_char = "noteheads-" + ly_scm2string (scm_font_char);
+  String font_family = ly_scm2string (scm_font_family);
+  
+   me->set_grob_property("font-family", ly_symbol2scm (font_family.to_str0 ()));
+   Molecule out =
+     Font_interface::get_default_font (me)->find_by_name (font_char);
+   if (out.empty_b())
+     {
+       warning (_f("Symbol not found, ", font_char.to_str0()));
     }
   
   int interspaces = Staff_symbol_referencer::line_count (me)-1;
@@ -235,7 +242,8 @@ Note_head::stem_attachment_coordinate (Grob *me, Axis a)
     return 0.0;
 
   SCM st = me->get_grob_property ("style");
-  SCM result = gh_apply (v, scm_list_n (st, SCM_UNDEFINED));
+  SCM log = gh_int2scm (get_balltype (me));
+  SCM result = gh_apply (v, scm_list_n (st, log, SCM_UNDEFINED));
 
   if (!gh_pair_p (result))
     return 0.0;
index 6f992dd3bb1263683710ca0e548ce79c06d2310f..889e4e61019af5d7d24b037f85704c44415b1afd 100644 (file)
 ;; silly, use alist? 
 (define (find-notehead-symbol duration style)
   (case style
-   ((xcircle) "2xcircle")
-   ((harmonic) "0neo_mensural")
+   ((xcircle) (cons "2xcircle" "music"))
+   ((harmonic) (cons "0neo_mensural" "music"))
    ((baroque) 
-    (string-append (number->string duration)
-                  (if (< duration 0) "neo_mensural" "")))
-   ((mensural) (string-append (number->string duration) (symbol->string style)))
-   ((neo_mensural) (string-append (number->string duration) (symbol->string style)))
-   ((default) (number->string duration))
+    ;; Oops, I actually would not call this "baroque", but, for
+    ;; backwards compatibility to 1.4, this is supposed to take
+    ;; brevis, longa and maxima from the neo-mensural font and all
+    ;; other note heads from the default font.  -- jr
+    (if (< duration 0)
+       (cons (string-append (number->string duration) "neo_mensural") "ancient")
+       (cons (number->string duration) "music")))
+   ((mensural)
+    (cons (string-append (number->string duration) (symbol->string style))
+     "ancient"))
+   ((neo_mensural)
+    (cons (string-append (number->string duration) (symbol->string style))
+     "ancient"))
+   ((default)
+    ;; The default font in mf/feta-bolletjes.mf defines a brevis, but
+    ;; neither a longa nor a maxima.  Hence let us, for the moment,
+    ;; take these from the neo-mensural font.  TODO: mf/feta-bolletjes
+    ;; should define at least a longa for the default font.  The longa
+    ;; should look exactly like the brevis of the default font, but
+    ;; with a stem exactly like that of the quarter note. -- jr
+    (if (< duration -1)
+       (cons (string-append (number->string duration) "neo_mensural") "ancient")
+       (cons (number->string duration) "music")))
    (else
-    (string-append (number->string (max 0 duration)) (symbol->string style)))))
+    (cons (string-append (number->string (max 0 duration)) (symbol->string style))
+     "music"))))
 
 
-(define (note-head-style->attachment-coordinates style)
+(define (note-head-style->attachment-coordinates style duration)
   "Return pair (X . Y), containing multipliers for the note head
 bounding box, where to attach the stem. e.g.: X==0 means horizontally
 centered, X==1 is at the right, X == -1 is at the left."
 
   (case style
-    ((default) '(1.0 . 0.5))
+    ((default)
+     (if (< duration -1)
+        '(0.0 . 0.6) ;; neo-mensural
+        '(1.0 . 0.5) ;; default
+        ))
     ((cross) '(1.0 . 0.75))
     ((mensural) '(0.0 . 0.6))
     ((neo_mensural) '(0.0 . 0.6))
@@ -122,6 +145,11 @@ centered, X==1 is at the right, X == -1 is at the left."
     ((slash) '(1.0 . 1.0))
     ((harmonic) '(1.0 0.0))
     ((triangle) '(0.75 . 0.15))
+    ((baroque)
+     (if (< duration 0)
+        '(0.0 . 0.6) ;; neo-mensural
+        '(1.0 . 0.5) ;; default
+        ))
     (else
 
      ;; this also works for easy notation.