]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-head.cc
Improves parmesan noteheads.
[lilypond.git] / lily / note-head.cc
index 614ba547ad42d27fd46622ca75084ac18a1f2c08..0ddba1fe1390353140eda215e1f833b609d7c1a1 100644 (file)
@@ -50,26 +50,31 @@ internal_print (Grob *me, string *font_char)
 
   Font_metric *fm = Font_interface::get_default_font (me);
 
+  string prefix = "noteheads.";
   string idx_symmetric;
   string idx_directed;
-  string idx_either;
-  idx_symmetric = idx_either = "noteheads.s" + suffix;
-  Stencil out = fm->find_by_name (idx_symmetric);
+  string idx_either = idx_symmetric = prefix + "s";
+  Stencil out = fm->find_by_name (idx_either + suffix);
   if (out.is_empty ())
     {
-      string prefix = "noteheads.";
-
       Grob *stem = unsmob_grob (me->get_object ("stem"));
       Direction stem_dir = stem ? get_grob_direction (stem) : CENTER;
 
       if (stem_dir == CENTER)
         programming_error ("must have stem dir for note head");
 
-      idx_directed = idx_either
-                     = prefix + ((stem_dir == UP) ? "u" : "d") + suffix;
-      out = fm->find_by_name (idx_directed);
+      idx_either = idx_directed = prefix + ((stem_dir == UP) ? "u" : "d");
     }
 
+  out = fm->find_by_name (idx_either + "r" + suffix);
+  if (!out.is_empty () && scm_is_false (
+                            scm_zero_p (
+                              scm_modulo (me->get_property ("staff-position"),
+                                          scm_from_int (2)))))
+      idx_either += "r";
+
+  idx_either += suffix;
+  out = fm->find_by_name (idx_either);
   if (out.is_empty ())
     {
       me->warning (_f ("none of note heads `%s' or `%s' found",