]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-head.cc
* VERSION (MY_PATCH_LEVEL): make 1.7.0
[lilypond.git] / lily / note-head.cc
index 39aeb99c7a170ddcabc45fb44d392d601318c879..16c58ebaea15aa1137b235a6ea3dc07e50862290 100644 (file)
@@ -103,7 +103,7 @@ Note_head::brew_ledger_lines (Grob *me,
 }
 
 Molecule
-internal_brew_molecule (Grob *me,  bool ledger_take_space)
+internal_brew_molecule (Grob *me, bool ledger_take_space)
 {
   SCM style  = me->get_grob_property ("style");
   if (!gh_symbol_p (style))
@@ -120,13 +120,16 @@ 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);
+  SCM scm_font_char = scm_primitive_eval (exp);
+  String font_char = "noteheads-" + ly_scm2string (scm_font_char);
+
+  Font_metric * fm = Font_interface::get_default_font (me);
+  Molecule out = fm->find_by_name (font_char);
   if (out.empty_b())
     {
-      warning (_f("Symbol not found, ", name.to_str0 ()));
+      me->warning (_f ("note head `%s' not found", font_char.to_str0 ()));
     }
-  
+
   int interspaces = Staff_symbol_referencer::line_count (me)-1;
   int pos = (int)rint (Staff_symbol_referencer::get_position (me));
   if (abs (pos) - interspaces > 1)
@@ -179,7 +182,8 @@ Note_head::brew_molecule (SCM smob)
 Interval
 Note_head::head_extent (Grob *me, Axis a)
 {
-  return me->get_molecule()->extent (a);
+  Molecule * mol = me->get_molecule();
+  return mol ? mol ->extent (a) : Interval(0,0);
 }
 
 
@@ -202,7 +206,7 @@ Note_head::brew_ez_molecule (SCM smob)
   s[0] = (pit->notename_ + 2)%7 + 'a';
   s[0] = toupper (s[0]);
   
-  SCM charstr = ly_str02scm (s);
+  SCM charstr = scm_makfrom0str (s);
   
   SCM at = scm_list_n (ly_symbol2scm ("ez-ball"),
                       charstr,
@@ -235,7 +239,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;
@@ -245,7 +250,6 @@ Note_head::stem_attachment_coordinate (Grob *me, Axis a)
   return gh_number_p (result) ?  gh_scm2double (result) : 0.0;
 }
 
-
 int
 Note_head::get_balltype (Grob*me) 
 {