]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
authorJoe Neeman <joeneeman@gmail.com>
Mon, 18 Dec 2006 18:59:33 +0000 (20:59 +0200)
committerJoe Neeman <joeneeman@gmail.com>
Mon, 18 Dec 2006 18:59:33 +0000 (20:59 +0200)
23 files changed:
.gitignore
Documentation/user/changing-defaults.itely
SConstruct
VERSION
buildscripts/output-distance.py
buildscripts/pfx2ttf.fontforge
input/regression/accidentals-modern.ly [new file with mode: 0644]
input/regression/spacing-loose-grace-error.ly [new file with mode: 0644]
input/regression/system-separator.ly
lily/accidental-engraver.cc
lily/collision-engraver.cc
lily/general-scheme.cc
lily/include/spacing-spanner.hh
lily/note-collision.cc
lily/pointer-group-interface.cc
lily/spacing-determine-loose-columns.cc
lily/tie-column.cc
scm/backend-library.scm
scm/define-grob-properties.scm
scm/define-grobs.scm
scm/ps-to-png.scm
scripts/lilypond-book.py
stepmake/bin/add-html-footer.py

index 2489b9e8d237bcd275fbeab48955c00807a30ece..9ceca56c963d17cb1ca69d500b346a7dde89955c 100644 (file)
@@ -1,4 +1,3 @@
-config.hh
 *-midi.ly
 *-systems.tex
 *-systems.texi
@@ -20,22 +19,25 @@ config.hh
 .htaccess
 /.sconf_temp
 /.sconsign.dblite
+/GNUmakefile
 /scons.cache
+/x
 ?.*
 AUTHORS.txt
-/GNUmakefile
 INSTALL.txt
 TAGS
 \#*
 a.out
 aclocal.m4
 autom4te.cache
+config.hh
 config.log
 config.make
 config.status
 config.status.lineno
 configure
 gcstat*.scm
-lily-[0-9][0-9][0-9]*
+lily-[0-9a-f][0-9a-f][0-9a-f]*
 out-scons
 tags
+test-output-distance
index a784db0e08d0d7040ab7ae7e16053ff2a6e74bb7..3b681cb22decee6e4c8f0c2fc42cfac2e1e6af65 100644 (file)
@@ -626,8 +626,8 @@ To have it interpreted at the @context{Score} or @context{Staff} level use
 these forms
 
 @example
-\context \applyOutput #'Score #@var{function}
-\context \applyOutput #'Staff #@var{function}
+\applyOutput #'Score #@var{function}
+\applyOutput #'Staff #@var{function}
 @end example
 
 @end itemize
index 7e86f13cb10f7e2d31815338f44b0d5f1d2e7e26..5a07e1b33aec49b71850c3d4c66e19032abea440 100644 (file)
@@ -176,11 +176,14 @@ import packagepython
 package = packagepython.Package (srcdir)
 version = packagepython.version_tuple_to_str (package.version)
 
-ENV = { 'PATH' : os.environ['PATH'] }
-for key in ['LD_LIBRARY_PATH', 'GUILE_LOAD_PATH', 'PKG_CONFIG_PATH', 'TEXMF']:
+ENV = { 'PYTHONPATH': '' }
+for key in ['GUILE_LOAD_PATH', 'LD_LIBRARY_PATH', 'PATH', 'PKG_CONFIG_PATH',
+            'PYTHONPATH', 'TEXMF']:
     if os.environ.has_key (key):
         ENV[key] = os.environ[key]
 
+ENV['PYTHONPATH'] = os.path.join (srcdir, 'python') + ':' + ENV['PYTHONPATH']
+
 env = Environment (
     ENV = ENV,
     BYTEORDER = sys.byteorder.upper (),
diff --git a/VERSION b/VERSION
index 7616dcf40b55846af3137b405098c1fb44510c43..e65077869d7326a719adfcc087e53bf668652761 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=11
-PATCH_LEVEL=2
+PATCH_LEVEL=3
 MY_PATCH_LEVEL=
 
index 92768454dc4c80f5247137aa21386209f2aa46b0..8f1b68633c89e0959cccd24b1f7e6184770ce9b7 100644 (file)
@@ -268,6 +268,38 @@ def read_signature_file (name):
 
 ################################################################
 # different systems of a .ly file.
+def read_pipe (c):
+    print 'pipe' , c
+    return os.popen (c).read ()
+
+def system (c):
+    print 'system' , c
+    s = os.system (c)
+    if s :
+        raise Exception ("failed")
+    return
+
+def compare_png_images (old, new, dir):
+    def png_dims (f):
+        m = re.search ('([0-9]+) x ([0-9]+)', read_pipe ('file %s' % f))
+        
+        return tuple (map (int, m.groups ()))
+
+    dims1 = png_dims (old)
+    dims2 = png_dims (new)
+
+    dims = (min (dims1[0], dims2[0]),
+            min (dims1[1], dims2[1]))
+
+    system ('convert -crop %dx%d+0+0 %s crop1.png' % (dims + (old,)))
+    system ('convert -crop %dx%d+0+0 %s crop2.png' % (dims + (new,)))
+
+    system ('compare crop1.png crop2.png diff.png')
+
+    system ("convert diff.png -border 2 -blur 0x3 -negate -channel alpha,blue -type TrueColorMatte     -fx 'intensity'    matte.png")
+
+    dest = os.path.join (dir, new.replace ('.png', '.compare.png'))
+    system ("composite matte.png %(new)s %(dest)s" % locals ())
 
 class FileLink:
     def __init__ (self):
@@ -341,11 +373,19 @@ class FileLink:
         self.add_system_link (link, system_index[0])
 
     def link_files_for_html (self, old_dir, new_dir, dest_dir):
+        png_linked = [[], []]
         for ext in ('.png', '.ly', '-page*png'):
+            
             for oldnew in (0,1):
                 for f in glob.glob (self.base_names[oldnew] + ext):
-                    print f
-                    link_file (f, dest_dir + '/' + f)
+                    dst = dest_dir + '/' + f
+                    link_file (f, dst)
+
+                    if f.endswith ('.png'):
+                        png_linked[oldnew].append (f)
+
+        for (old,new) in zip (png_linked[0], png_linked[1]):
+            compare_png_images (old, new, dest_dir)
 
     def html_record_string (self,  old_dir, new_dir):
         def img_cell (ly, img, name):
@@ -387,8 +427,9 @@ class FileLink:
 
 
         def cell (base, name):
-            pages = glob.glob (base + '-page*.png')
-            
+            pat = base + '-page*.png'
+            pages = glob.glob (pat)
+
             if pages:
                 return multi_img_cell (base + '.ly', sorted (pages), name)
             else:
@@ -410,7 +451,7 @@ class FileLink:
 </tr>
 ''' % (self.distance (), html_2,
        cell (self.base_names[0], name),
-       cell (self.base_names[1], name))
+       cell (self.base_names[1], name).replace ('.png', '.compare.png'))
 
         return html_entry
 
@@ -598,6 +639,7 @@ class ComparisonData:
 
             link.link_files_for_html (dir1, dir2, dest_dir) 
             link.write_html_system_details (dir1, dir2, dest_dir)
+            
             html += link.html_record_string (dir1, dir2)
 
 
@@ -699,7 +741,10 @@ def test_compare_trees ():
 
     ## introduce differences
     system ('cp 19-1.signature dir2/20-1.signature')
+    system ('cp 19.png dir2/20.png')
+    system ('cp 19multipage-page1.png dir2/20multipage-page1.png')
     system ('cp 20-1.signature dir2/subdir/19-sub-1.signature')
+    system ('cp 20.png dir2/subdir/19-sub.png')
 
     ## radical diffs.
     system ('cp 19-1.signature dir2/20grob-1.signature')
@@ -811,7 +856,7 @@ def test_compare_signatures (names, timing=False):
 
 
 def run_tests ():
-    dir = 'output-distance-test'
+    dir = 'test-output-distance'
 
     do_clean = not os.path.exists (dir)
 
index cdb82475f67079612a02a406c5b6593b619e1df5..53b9de980e4e4cf2dce67dfdb7ade5f0bb0d5fd4 100644 (file)
@@ -4,30 +4,24 @@ Open($1);
 MergeKern($2)
 
 
-# 
-# NCSB is broken as shipped by Fedora Core 6
-# it contains bogus ligatures TM and No in the AFM file.
+# The AFM files of `New Century Schoolbook' family as distributed within the
+# urw-fonts-1.0.7pre41.tar.bz2 archive contain a bunch of ligatures which
+# shouldn't be active by default:
 #
-# Remove the TM glyph - for want of better FF fix.  
-err = SelectIf("trademark");
-if ( err > 0 )
-   Cut();
-elseif ( err == 0 )
-   Print("Could not find \"trademark\" glyph");
-elseif ( err < 0 )
-   Print("An error occurred while searching for the \"trademark\" glyph");
-endif
-
+#   T + M -> trademark
+#   N + o -> afii61352
+#   i + j -> ij
+#   I + J -> IJ
+#
+# This font bundle is shipped by Fedora Core 6 and other GNU/Linux
+# distributions; we simply remove those ligatures.
 
-# Remove the No. glyph - for want of better FF fix.  
-err = SelectIf("afii61352");
-if ( err > 0 )
-   Cut();
-elseif ( err == 0 )
-   Print("Could not find \"numero\" glyph");
-elseif ( err < 0 )
-   Print("An error occurred while searching for the \"numero\" glyph");
-endif
+SelectIf("trademark", "trademark", \
+         "afii61352", "afii61352", \
+         "ij", "ij", \
+         "IJ", "IJ");
+RemoveATT("Ligature", "*", "*");
 
 Generate($3 + $fontname + ".otf");
 
+# EOF
diff --git a/input/regression/accidentals-modern.ly b/input/regression/accidentals-modern.ly
new file mode 100644 (file)
index 0000000..9f749ae
--- /dev/null
@@ -0,0 +1,16 @@
+\header {
+
+  texidoc = "In 'modern accidental style, the last note should
+have an accidental sign. "
+  
+}
+\version "2.10.3"
+
+\score {
+  \new Staff {
+    \relative c' {
+      #(set-accidental-style 'modern)
+      d4 dis'4 d,2^"this should have accidental"
+    }
+  }
+}
diff --git a/input/regression/spacing-loose-grace-error.ly b/input/regression/spacing-loose-grace-error.ly
new file mode 100644 (file)
index 0000000..94a3968
--- /dev/null
@@ -0,0 +1,19 @@
+\header
+{
+  
+texidoc = "Even in case of incorrect contexts (eg. shortlived
+  contexts) that break linking of columns through spacing wishes,
+  @code{strict-note-spacing} defaults to a robust solution."
+
+}
+
+\version "2.11.2"
+
+
+%% \new Staff cause shortlived, disconnected Voice contexts
+%% breaking spacing-wishes links.
+\new Staff {
+  \override Score.SpacingSpanner #'strict-note-spacing = ##t
+  \afterGrace c'4 {c'32 c'32 }
+  c'4
+}
index 88414a86f4e4d685b417eed5476ce90b0738a5c5..865ff4fc48b15f2c99d42c1ed5ee251cdb2836e8 100644 (file)
@@ -3,7 +3,7 @@
 \header {
 
   texidoc = "System separators maybe defined as markups in the
-@code{systemSeparator} field of the bookpaper block. They are centered
+@code{systemSeparator} field of the paper block. They are centered
 between the boundary staffs of each system. "
 
 }
index 9d671c11e610a0e34420ca703689247d4ba382ef..f4c2abdde378841596059c1fc5a62bb16798fa09 100644 (file)
@@ -122,8 +122,7 @@ Accidental_engraver::update_local_key_signature ()
 
   /* Huh. Don't understand what this is good for. --hwn.  */
 
-  SCM val;
-  while (trans && trans->where_defined (ly_symbol2scm ("localKeySignature"), &val))
+  while (trans)
     {
       trans->set_property ("localKeySignature", ly_deep_copy (last_keysig_));
       trans = trans->get_parent_context ();
@@ -194,10 +193,14 @@ number_accidentals_from_sig (bool *different, SCM sig, Pitch *pitch,
       SCM entry = scm_car (s);
       if (scm_is_pair (scm_car (entry))
          && scm_cdar (entry) == scm_from_int (n))
-       from_other_octaves = scm_cdr (entry);
+       {
+         from_other_octaves = scm_cdr (entry);
+         break;
+       }
     }
 
-  if (from_same_octave != SCM_BOOL_F
+  if (!ignore_octave
+      && from_same_octave != SCM_BOOL_F
       && recent_enough (bar_number, from_same_octave, laziness))
     previous_alteration = from_same_octave;
   else if (ignore_octave
index 32dddc1d7ae36c91e3079b7c840856307c6e6b64..43974170de67bc891f073feb2b46ff7fd3e6745f 100644 (file)
@@ -46,6 +46,9 @@ Collision_engraver::acknowledge_note_column (Grob_info i)
       if (Note_column::has_rests (i.grob ()) || i.grob ()->get_parent (X_AXIS))
        return;
 
+      if (to_boolean (i.grob ()->get_property ("ignore-collision")))
+       return;
+      
       note_columns_.push_back (i.grob ());
     }
 }
index 142e7c2befa8179363c96a2ff10ea261faf655c1..59fc0bafb7868898e700a647f1413ede5d587a0c 100644 (file)
@@ -48,7 +48,7 @@ LY_DEFINE (ly_gulp_file, "ly:gulp-file",
           "The file is looked up using the search path. ")
 {
   SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string");
-  int sz = -1;
+  int sz = INT_MAX;
   if (size != SCM_UNDEFINED)
     {
       SCM_ASSERT_TYPE (scm_is_number (size), size, SCM_ARG2, __FUNCTION__, "number");
index 3dace37510894ae0154fe1c0c2b908a78f0c762f..7d46f78e1ce2b93151378fb37e4febe6f9638bfa 100644 (file)
   TODO: prune to public interface.
 */
 class Spacing_spanner
+
 {
 public:
+  static void set_distances_for_loose_col (Grob *me, Grob *c, Drul_array<Item *> next_door, Spacing_options const *);
   static void generate_pair_spacing (Grob *me,
                                     Paper_column *l, Paper_column *r,
                                     Paper_column *nextr,
index 2fa8ce48814fb6ab00249a53213a7c2bead23a55..f5c4483bbd874d2aaa85f2f09a60a3f2aa0ad954 100644 (file)
@@ -424,7 +424,6 @@ Note_collision_interface::get_clash_groups (Grob *me)
 /** This complicated routine moves note columns around horizontally to
     ensure that notes don't clash.
 
-    This should be put into Scheme.
 */
 SCM
 Note_collision_interface::automatic_shift (Grob *me,
@@ -553,6 +552,7 @@ ADD_INTERFACE (Note_collision_interface,
               "@code{force-hshift} and @code{horizontal-shift}.",
 
               /* properties */
+              "ignore-collision "
               "merge-differently-dotted "
               "merge-differently-headed "
               "positioning-done ");
index 36eac12bca69bbd2f50b87310bd9e94b5e374adf..a04d4512c0fd3f06abc26978196b4602f68f0e1e 100644 (file)
@@ -72,7 +72,9 @@ ly_scm2link_array (SCM x)
 vector<Grob*> const &
 internal_extract_grob_array (Grob const *elt, SCM symbol)
 {
-  return ly_scm2link_array (elt->internal_get_object (symbol));
+  return elt
+    ? ly_scm2link_array (elt->internal_get_object (symbol))
+    : empty_array;
 }
 
 vector<Item*>
index fe5a89c80bc3f0193a42422eb14bbec43577c352..c0eecf93280e6bf9631e3daca7112e40b24dc135 100644 (file)
@@ -37,18 +37,19 @@ is_loose_column (Grob *l, Grob *col, Grob *r, Spacing_options const *options)
   if (!to_boolean (col->get_property ("allow-loose-spacing")))
     return false;
   
+
   if ((options->float_nonmusical_columns_
        ||options->float_grace_columns_)
       && Paper_column::when_mom (col).grace_part_)
-    return true;
+    {
+      return true;
+    }
 
+  
   if (Paper_column::is_musical (col)
       || Paper_column::is_breakable (col))
     return false;
 
-  extract_grob_set (col, "right-neighbors", rns);
-  extract_grob_set (col, "left-neighbors", lns);
-
   /*
     If this column doesn't have a proper neighbor, we should really
     make it loose, but spacing it correctly is more than we can
@@ -70,9 +71,14 @@ is_loose_column (Grob *l, Grob *col, Grob *r, Spacing_options const *options)
     such a borderline case.)
 
   */
+
+  extract_grob_set (col, "right-neighbors", rns);
+  extract_grob_set (col, "left-neighbors", lns);
+
   if (lns.empty () || rns.empty ())
     return false;
 
+  
   Item *l_neighbor = dynamic_cast<Item *> (lns[0]);
   Item *r_neighbor = dynamic_cast<Item *> (rns[0]);
 
@@ -126,6 +132,68 @@ is_loose_column (Grob *l, Grob *col, Grob *r, Spacing_options const *options)
   return true;
 }
 
+void
+Spacing_spanner::set_distances_for_loose_col (Grob *me, Grob *c,
+                                             Drul_array<Item *> next_door,
+                                             Spacing_options const *options)
+{
+  Direction d = LEFT;
+  Drul_array<Real> dists (0, 0);
+
+  do
+    {
+      Item *lc = dynamic_cast<Item *> ((d == LEFT) ? next_door[LEFT] : c);
+      Item *rc = dynamic_cast<Item *> (d == LEFT ? c : next_door[RIGHT]);
+
+      extract_grob_set (lc, "spacing-wishes", wishes);
+      for (vsize k = wishes.size (); k--;)
+       {
+         Grob *sp = wishes[k];
+         if (Note_spacing::left_column (sp) != lc
+             || Note_spacing::right_column (sp) != rc)
+           continue;
+
+         if (Note_spacing::has_interface (sp))
+           {
+             /*
+               The note spacing should be taken from the musical
+               columns.
+             */
+             Real space = 0.0;
+             Real fixed = 0.0;
+             bool dummy = false;
+                 
+             Real base = note_spacing (me, lc, rc, options, &dummy);
+             Note_spacing::get_spacing (sp, rc, base, options->increment_,
+                                        &space, &fixed);
+
+             space -= options->increment_;
+
+             dists[d] = max (dists[d], space);
+           }
+         else if (Staff_spacing::has_interface (sp))
+           {
+             Real space = 0;
+             Real fixed_space = 0;
+             Staff_spacing::get_spacing_params (sp,
+                                                &space, &fixed_space);
+
+             dists[d] = max (dists[d], fixed_space);
+           }
+         else
+           programming_error ("Subversive spacing wish");
+       }
+    }
+  while (flip (&d) != LEFT);
+
+  Rod r;
+  r.distance_ = dists[LEFT] + dists[RIGHT];
+  r.item_drul_ = next_door;
+  r.add_to_cols (); 
+}
+
+
 /*
   Remove columns that are not tightly fitting from COLS. In the
   removed columns, set 'between-cols to the columns where it is in
@@ -158,71 +226,28 @@ Spacing_spanner::prune_loose_columns (Grob *me, vector<Grob*> *cols,
          */
 
          extract_grob_set (unsmob_grob (rns), "right-items", right_items);
-         c->set_object ("between-cols", scm_cons (lns,
-                                                  right_items[0]->self_scm ()));
-
-         /*
-           Set distance constraints for loose columns
-         */
-         Drul_array<Grob *> next_door (cols->at (i - 1),
-                                       cols->at (i + 1));
-         Direction d = LEFT;
-         Drul_array<Real> dists (0, 0);
-
-         do
+         if (right_items.size () == 0 || !unsmob_grob (lns))
            {
-             Item *lc = dynamic_cast<Item *> ((d == LEFT) ? next_door[LEFT] : c);
-             Item *rc = dynamic_cast<Item *> (d == LEFT ? c : next_door[RIGHT]);
-
-             extract_grob_set (lc, "spacing-wishes", wishes);
-             for (vsize k = wishes.size (); k--;)
-               {
-                 Grob *sp = wishes[k];
-                 if (Note_spacing::left_column (sp) != lc
-                     || Note_spacing::right_column (sp) != rc)
-                   continue;
-
-                 if (Note_spacing::has_interface (sp))
-                   {
-                     /*
-                       The note spacing should be taken from the musical
-                       columns.
-                     */
-                     Real space = 0.0;
-                     Real fixed = 0.0;
-                     bool dummy = false;
-                 
-                     Real base = note_spacing (me, lc, rc, options, &dummy);
-                     Note_spacing::get_spacing (sp, rc, base, options->increment_,
-                                                &space, &fixed);
-
-                     space -= options->increment_;
-
-                     dists[d] = max (dists[d], space);
-                   }
-                 else if (Staff_spacing::has_interface (sp))
-                   {
-                     Real space = 0;
-                     Real fixed_space = 0;
-                     Staff_spacing::get_spacing_params (sp,
-                                                        &space, &fixed_space);
-
-                     dists[d] = max (dists[d], fixed_space);
-                   }
-                 else
-                   programming_error ("Subversive spacing wish");
-               }
+             c->programming_error ("Can't determine neighbors for floating column. ");
+             c->set_object ("between-cols", scm_cons (cols->at (i-1)->self_scm (),
+                                                      cols->at (i+1)->self_scm ()));
            }
-         while (flip (&d) != LEFT);
+         else
+           {
+             c->set_object ("between-cols", scm_cons (lns,
+                                                      right_items[0]->self_scm ()));
 
-         Rod r;
-         r.distance_ = dists[LEFT] + dists[RIGHT];
-         r.item_drul_[LEFT] = dynamic_cast<Item *> (cols->at (i - 1));
-         r.item_drul_[RIGHT] = dynamic_cast<Item *> (cols->at (i + 1));
+             /*
+               Set distance constraints for loose columns
+             */
+             Drul_array<Item *> next_door (dynamic_cast<Item*> (cols->at (i - 1)),
+                                           dynamic_cast<Item*> (cols->at (i + 1)));
 
-         r.add_to_cols ();
+             set_distances_for_loose_col (me, c, next_door, options);
+           }
        }
-      else
+
+      if (!loose)
        newcols.push_back (c);
     }
 
index 85529ef1d559585edac3d6e7bf4e5723f18fef6b..dd54530e812edd8e5afcc581573ea0f8a393d0be 100644 (file)
 using namespace std;
 
 void
-Tie_column::add_tie (Grob *me, Grob *tie)
+Tie_column::add_tie (Grob *tc, Grob *tie)
 {
+  Spanner *me = dynamic_cast<Spanner *> (tc);
+  
   if (tie->get_parent (Y_AXIS)
       && Tie_column::has_interface (tie->get_parent (Y_AXIS)))
     return;
 
-  if (!Pointer_group_interface::count (me, ly_symbol2scm ("ties")))
+  if (!me->get_bound (LEFT)
+      || (Paper_column::get_rank (me->get_bound (LEFT)->get_column ())
+         > Paper_column::get_rank (dynamic_cast<Spanner*> (tie)->get_bound (LEFT)->get_column ())))
     {
-      dynamic_cast<Spanner *> (me)->set_bound (LEFT, Tie::head (tie, LEFT));
-      dynamic_cast<Spanner *> (me)->set_bound (RIGHT, Tie::head (tie, RIGHT));
+       me->set_bound (LEFT, Tie::head (tie, LEFT));
+       me->set_bound (RIGHT, Tie::head (tie, RIGHT));
     }
-
+      
   tie->set_parent (me, Y_AXIS);
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("ties"), tie);
 }
index 5258bcf516249978a06d25166fa46b6b50964dc4..42c04b6e57f573047f922a53a634f5b50a12ce79 100644 (file)
@@ -94,8 +94,7 @@
 
     (ly:message (_ "Converting to `~a'...") pdf-name)
     (ly:progress "\n")
-    (ly:system cmd)
-    ))
+    (ly:system cmd)))
 
 (use-modules (scm ps-to-png))
 
     ;; GS produces PNG files like BASE-page%d.png.
     ;;(ly:message (_ "Converting to `~a'...")
     ;;     (string-append (basename name ".ps") "-page1.png" )))
-  (let ((verbose (ly:get-option 'verbose))
-       (rename-page-1 #f))
-
+  (let* ((verbose (ly:get-option 'verbose))
+        (rename-page-1 #f))
     (ly:message (_ "Converting to ~a...") "PNG")
-
     (make-ps-images name
                    #:resolution resolution
-                   #:page-width  paper-width
+                   #:page-width paper-width
                    #:page-height paper-height
                    #:rename-page-1 rename-page-1
                    #:be-verbose verbose
                    #:anti-alias-factor (ly:get-option 'anti-alias-factor)
-                   #:pixmap-format (ly:get-option 'pixmap-format) 
-                   )
-    
+                   #:pixmap-format (ly:get-option 'pixmap-format))
     (ly:progress "\n")))
 
 (define-public (postprocess-output paper-book module filename formats)
-  (let*
-      ((completed (completize-formats formats))
-       (base (string-regexp-substitute "\\.[a-z]+$" "" filename))
-       (intermediate (remove
-                     (lambda (x)
-                       (member x formats)) 
-                     completed)))
-
-    (for-each
-     (lambda (f)
-       ((eval (string->symbol (format "convert-to-~a" f)) module)
-       paper-book filename))
-     completed)
-
+  (let* ((completed (completize-formats formats))
+        (base (string-regexp-substitute "\\.[a-z]+$" "" filename))
+        (intermediate (remove (lambda (x) (member x formats)) completed)))
+    (for-each (lambda (f)
+               ((eval (string->symbol (format "convert-to-~a" f))
+                      module) paper-book filename)) completed)
     (if (ly:get-option 'delete-intermediate-files)
-       (for-each
-        (lambda (f)
-          (delete-file (string-append base "." f)))
-        intermediate))
-    ))
+       (for-each (lambda (f)
+                   (delete-file (string-append base "." f))) intermediate))))
 
 (define-public (completize-formats formats)
   (define new-fmts '())
-
   (if (member "png" formats)
       (set! formats (cons "ps" formats)))
   (if (member "pdf" formats)
       (set! formats (cons "ps" formats)))
-
-  (for-each
-   (lambda (x)
-     (if (member x formats) (set! new-fmts (cons x new-fmts))))
-   '("tex" "dvi" "ps" "pdf" "png"))
-
+  (for-each (lambda (x)
+             (if (member x formats) (set! new-fmts (cons x new-fmts))))
+           '("tex" "dvi" "ps" "pdf" "png"))
   (uniq-list (reverse new-fmts)))
 
 (define (header-to-file file-name key value)
index 140cf382b7ba71a14059eee106f206dcb6c7c0fc..b46dc5aae7a55f641f85e6125c98dc98798a1b19 100644 (file)
@@ -201,6 +201,7 @@ of note-column for horizontal shifting. This is used by
      (avoid-slur ,symbol? "Method of handling slur collisions.
 Choices are @code{around}, @code{inside}, @code{outside}.  If unset, script
 and slur ignore eachother.")
+     (ignore-collision ,boolean? "If set, don't do note collision resolution on this NoteColumn.")
      (inspect-quants ,number-pair? "If debugging is set,
 set beam/slur quant to this position, and print the respective scores.")
      (inspect-index ,integer? "If debugging is set,
index 10a35dc68dd02a88c059c57a81fabd2ec7b0721d..47ef19a696235f613e50a13b3d06eb7c7dfc0dd2 100644 (file)
              (apply unpure args)
              (let ((pure (assq unpure pure-conversions-alist)))
                (if pure
-                   (apply (cdr pure) (append (list (car args) start end) (cdr args)))))))))
+                   (apply (cdr pure)
+                          (append
+                           (list (car args) start end)
+                           (cdr args)))))))))
index 2d429886f30b24ffd0b3f7bef81250e351b9b0f5..4f6d322e4825a69b55ca30a3002cc922c2028601 100644 (file)
     (read-string!/partial str port 0 max-length)
     str))
 
-(define (gulp-file nm len)
-
-  ;; string routines barf when strlen() != string-length,.
-  ;; which may happen as side effect of read-string!/partial.
-  
-                                       ;  (gulp-port (open-file nm "r") len))
-  (ly:gulp-file nm len))
-
+(define-public (gulp-file file-name . max-size)
+  (ly:gulp-file file-name (if (pair? max-size) (car max-size))))
 
 (define BOUNDING-BOX-RE
   "^%%BoundingBox: (-?[0-9]+) (-?[0-9]+) (-?[0-9]+) (-?[0-9]+)")
 
-(define (get-bbox file-name)
+(define (unused-found-broken-get-bbox file-name)
   (let* ((bbox (string-append file-name ".bbox"))
         ;; -sOutputFile does not work with bbox?
         (cmd (format #t "gs\
@@ -71,7 +65,7 @@
  -c quit 2>~S"
                      file-name bbox))
         (status (system cmd))
-        (s (gulp-file bbox 10240))
+        (s (gulp-file bbox 10240))
         (m (string-match BOUNDING_BOX_RE s)))
 
     (if m
       (begin
        (format (current-error-port) (_ "Invoking `~a'...") cmd)
        (newline (current-error-port))))
-
-  
   (set! status (system cmd))
-  
   (if (not (= status 0))
       (begin
        (format (current-error-port)
                (format #f (_ "~a exited with status: ~S") "GS" status))
-       (if exit-on-error
-           (exit 1))))
-
+       (if exit-on-error (exit 1))))
   status)
 
 (define (scale-down-image be-verbose factor file)
   (let* ((status 0)
-        (percentage (* 100 (/ 1.0 factor)))
         (old (string-append file ".old")))
 
     (rename-file file old)
-    (my-system be-verbose
-              #t
-              (format #f "convert -scale \"~a%\" -depth 8 ~a ~a" percentage old file))
-    (delete-file old)
-    ))
+    (my-system
+     be-verbose #t
+     (format #f
+            "pngtopnm ~a | pnmscale -reduce ~a 2>/dev/null | pnmtopng -compression 9 2>/dev/null > ~a"
+            old factor file))
+    (delete-file old)))
 
 (define-public (ps-page-count ps-name)
-  (let*
-      ((byte-count 10240)
-       (header (gulp-file ps-name byte-count))
-       (first-null (string-index header #\nul))
-       (match (string-match "%%Pages: ([0-9]+)"
-                           (if (number? first-null)
-                               (substring header 0 first-null)
-                               header))))
-
-    (if match
-       (string->number (match:substring match 1))
-       0)))
+  (let* ((byte-count 10240)
+        (header (gulp-file ps-name byte-count))
+        (first-null (string-index header #\nul))
+        (match (string-match "%%Pages: ([0-9]+)"
+                             (if (number? first-null)
+                                 (substring header 0 first-null)
+                                 header))))
+    (if match (string->number (match:substring match 1)) 0)))
 
 (define-public (make-ps-images ps-name . rest)
   (let-keywords*
    rest #f
-     ((resolution 90)
-      (page-width  100)
-      (page-height 100)
-      (rename-page-1 #f)
-      (be-verbose #f)
-      (pixmap-format 'png16m)
-      (anti-alias-factor 1))
-     
-   (let* (
-         (format-str (format "~a" pixmap-format))
+   ((resolution 90)
+    (page-width  100)
+    (page-height 100)
+    (rename-page-1 #f)
+    (be-verbose #f)
+    (pixmap-format 'png16m)
+    (anti-alias-factor 1))
+
+   (let* ((format-str (format "~a" pixmap-format))
          (extension (cond
                      ((string-contains format-str "png") "png")
                      ((string-contains format-str "jpg") "jpeg")
 
          (gs-variable-options
           (if multi-page?
-              (format #f "-dDEVICEWIDTHPOINTS=~,2f -dDEVICEHEIGHTPOINTS=~,2f" page-width page-height)
+              (format #f "-dDEVICEWIDTHPOINTS=~,2f -dDEVICEHEIGHTPOINTS=~,2f"
+                      page-width page-height)
               "-dEPSCrop"))
-
          (cmd (format #f "~a\
  ~a\
  ~a\
           ))
 
      (if (not (= 1 anti-alias-factor))
-        (for-each  (lambda (f) (scale-down-image be-verbose anti-alias-factor f))
-                   files))
-
+        (for-each
+         (lambda (f) (scale-down-image be-verbose anti-alias-factor f)) files))
      files)))
index 6699ba2dcb8b5a269536238c32f4331b6c5f92cb..90174efeaa3ea136433e801291c2adc05cf791dd 100644 (file)
@@ -1799,9 +1799,7 @@ def main ():
         
     if (global_options.format in (TEXINFO, LATEX)
         and global_options.create_pdf):
-        global_options.process_cmd += "--pdf  -dinclude-eps-fonts -dgs-load-fonts "
-
-        
+        global_options.process_cmd += "--pdf -dinclude-eps-fonts -dgs-load-fonts "
     
     if global_options.verbose:
         global_options.process_cmd += " --verbose "
index 08ff5ff061c3cd764ef082071b6e4e510e91b895..83c398ee9ed60f40ea6a1c84051a32131b410466 100644 (file)
@@ -340,6 +340,9 @@ def i18n (file_name, page):
     else:
         page = page + languages
 
+    if content_negotiation and language_menu:
+        os.symlink (file_name, os.path.splitext (file_name)[0] + '.en.html')
+        
     return page
 
 for f in files: