]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 10 Mar 2005 15:05:07 +0000 (15:05 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 10 Mar 2005 15:05:07 +0000 (15:05 +0000)
lily/accidental.cc
lily/ledger-line-spanner.cc
lily/spanner.cc
lily/stencil-scheme.cc
lily/stencil.cc

index 6522a843cd54fd8f83e5a17d10fc3e821c8e79f9..3d1f6270dc5426b3d7b9dff475917a390bd901b6 100644 (file)
@@ -131,128 +131,128 @@ Accidental_interface::accurate_boxes (Grob *a, Grob **common)
 
 
 /*
      * Some styles do not provide all flavours of accidentals, e.g. there
      * is currently no sharp accidental in vaticana style.  In these cases
      * this function falls back to one of the other styles.
      */
+ * Some styles do not provide all flavours of accidentals, e.g. there
+ * is currently no sharp accidental in vaticana style.  In these cases
+ * this function falls back to one of the other styles.
+ */
 
-      /*
-       todo: this sort of stuff in Scheme. --hwn.
-      */
-      String
-       Accidental_interface::get_fontcharname (String style, int alteration)
-      {
-       if (alteration == DOUBLE_FLAT
-           || alteration == DOUBLE_SHARP)
-         {
-           return to_string (alteration);
-         }
+/*
+  todo: this sort of stuff in Scheme. --hwn.
+*/
+String
+Accidental_interface::get_fontcharname (String style, int alteration)
+{
+  if (alteration == DOUBLE_FLAT
+      || alteration == DOUBLE_SHARP)
+    {
+      return to_string (alteration);
+    }
 
-       if (style == "hufnagel")
-         switch (alteration)
-           {
-           case FLAT: return "hufnagel-1";
-           case 0: return "vaticana0";
-           case SHARP: return "mensural1";
-           }
-       if (style == "medicaea")
-         switch (alteration)
-           {
-           case FLAT: return "medicaea-1";
-           case 0: return "vaticana0";
-           case SHARP: return "mensural1";
-           }
-       if (style == "vaticana")
-         switch (alteration)
-           {
-           case FLAT: return "vaticana-1";
-           case 0: return "vaticana0";
-           case SHARP: return "mensural1";
-           }
-       if (style == "mensural")
-         switch (alteration)
-           {
-           case FLAT: return "mensural-1";
-           case 0: return "vaticana0";
-           case SHARP: return "mensural1";
-           }
-
-       if (style == "neomensural")
-         style = ""; // currently same as default
-       if (style == "default")
-         style = "";
-       return style + to_string (alteration);
+  if (style == "hufnagel")
+    switch (alteration)
+      {
+      case FLAT: return "hufnagel-1";
+      case 0: return "vaticana0";
+      case SHARP: return "mensural1";
       }
-
-      MAKE_SCHEME_CALLBACK (Accidental_interface, print, 1);
-      SCM
-       Accidental_interface::print (SCM smob)
+  if (style == "medicaea")
+    switch (alteration)
+      {
+      case FLAT: return "medicaea-1";
+      case 0: return "vaticana0";
+      case SHARP: return "mensural1";
+      }
+  if (style == "vaticana")
+    switch (alteration)
+      {
+      case FLAT: return "vaticana-1";
+      case 0: return "vaticana0";
+      case SHARP: return "mensural1";
+      }
+  if (style == "mensural")
+    switch (alteration)
       {
-       Grob *me = unsmob_grob (smob);
-       bool smaller = false;
-       bool parens = false;
+      case FLAT: return "mensural-1";
+      case 0: return "vaticana0";
+      case SHARP: return "mensural1";
+      }
 
-       bool caut = to_boolean (me->get_property ("cautionary"));
-       if (caut)
-         {
-           SCM cstyle = me->get_property ("cautionary-style");
-           parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses"));
-           smaller = ly_c_equal_p (cstyle, ly_symbol2scm ("smaller"));
-         }
+  if (style == "neomensural")
+    style = ""; // currently same as default
+  if (style == "default")
+    style = "";
+  return style + to_string (alteration);
+}
 
-       SCM scm_style = me->get_property ("style");
-       String style;
-       if (scm_is_symbol (scm_style))
-         {
-           style = ly_symbol2string (scm_style);
-         }
-       else
-         {
-           /*
-             preferably no name for the default style.
-           */
-           style = "";
-         }
+MAKE_SCHEME_CALLBACK (Accidental_interface, print, 1);
+SCM
+Accidental_interface::print (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
+  bool smaller = false;
+  bool parens = false;
 
-       Font_metric *fm = 0;
-       if (smaller)
-         {
-           SCM ac = Font_interface::music_font_alist_chain (me);
-           /*
-             TODO: should calc font-size by adding -2 to current font-size
-           */
-           ac = scm_cons (scm_list_1 (scm_cons
-                                      (ly_symbol2scm ("font-size"),
-                                       scm_int2num (-2))),
-                          ac);
-           fm = select_font (me->get_layout (), ac);
-         }
-       else
-         fm = Font_interface::get_default_font (me);
+  bool caut = to_boolean (me->get_property ("cautionary"));
+  if (caut)
+    {
+      SCM cstyle = me->get_property ("cautionary-style");
+      parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses"));
+      smaller = ly_c_equal_p (cstyle, ly_symbol2scm ("smaller"));
+    }
 
-       Stencil mol;
-       for (SCM s = me->get_property ("accidentals");
-            scm_is_pair (s); s = scm_cdr (s))
-         {
-           int alteration = scm_to_int (scm_car (s));
-           String font_char = get_fontcharname (style, alteration);
-           Stencil acc (fm->find_by_name ("accidentals." + font_char));
-
-           if (acc.is_empty ())
-             {
-               me->warning (_f ("accidental `%s' not found", font_char));
-             }
-           else
-             {
-               mol.add_at_edge (X_AXIS, RIGHT, acc, 0.1, 0);
-             }
-         }
+  SCM scm_style = me->get_property ("style");
+  String style;
+  if (scm_is_symbol (scm_style))
+    {
+      style = ly_symbol2string (scm_style);
+    }
+  else
+    {
+      /*
+       preferably no name for the default style.
+      */
+      style = "";
+    }
 
-       if (parens)
-         mol = parenthesize (me, mol);
+  Font_metric *fm = 0;
+  if (smaller)
+    {
+      SCM ac = Font_interface::music_font_alist_chain (me);
+      /*
+       TODO: should calc font-size by adding -2 to current font-size
+      */
+      ac = scm_cons (scm_list_1 (scm_cons
+                                (ly_symbol2scm ("font-size"),
+                                 scm_int2num (-2))),
+                    ac);
+      fm = select_font (me->get_layout (), ac);
+    }
+  else
+    fm = Font_interface::get_default_font (me);
 
-       return mol.smobbed_copy ();
-      }
+  Stencil mol;
+  for (SCM s = me->get_property ("accidentals");
+       scm_is_pair (s); s = scm_cdr (s))
+    {
+      int alteration = scm_to_int (scm_car (s));
+      String font_char = get_fontcharname (style, alteration);
+      Stencil acc (fm->find_by_name ("accidentals." + font_char));
+
+      if (acc.is_empty ())
+       {
+         me->warning (_f ("accidental `%s' not found", font_char));
+       }
+      else
+       {
+         mol.add_at_edge (X_AXIS, RIGHT, acc, 0.1, 0);
+       }
+    }
+
+  if (parens)
+    mol = parenthesize (me, mol);
+
+  return mol.smobbed_copy ();
+}
 
 /*
   TODO: should move inside-slur into item?
index 186f976fd78e77f104d28011c0fc7f30a0a33584..76b5eb4dd3039fd835c49671a0e3228e4a29dd07 100644 (file)
@@ -147,7 +147,7 @@ Ledger_line_spanner::set_spacing_rods (SCM smob)
          Direction d = DOWN;
          do
            {
-             if (!extents_right[d].is_empty () && !extents_right[d].is_empty ())
+             if (!extents_left[d].is_empty () && !extents_right[d].is_empty ())
                {
                  Real l1 = extents_right[d].length () * min_length_fraction;
                  Real l2 = extents_left[d].length () * min_length_fraction;
index 0a72592b3218c6917758d3637bb72179916ea794..e7221000c766ea4cba97766f8730cb84c8e1618a 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <math.h>
 
-#include <libc - extension.hh>
+#include <libc-extension.hh>
 
 #include "warn.hh"
 #include "paper-column.hh"
index 4ef10f4e08914228e30eb05e2632105ce54ed1a3..826ffe17aa1fc48a05a9074a35fa9c787e27df10 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <math.h>
 
-#include <libc - extension.hh> // isinf
+#include <libc-extension.hh>   // isinf
 
 #include "font-metric.hh"
 #include "stencil.hh"
index 0c314964aea70fa44976ad827e76c76fb94da4a8..5e102dd5fc0a99cddaf03185f35848764b3ee2c5 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <math.h>
 
-#include <libc - extension.hh> // isinf
+#include <libc-extension.hh>   // isinf
 
 #include "input-smob.hh"
 #include "font-metric.hh"