]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' of git+ssh://repo.or.cz/srv/git/lilypond
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 1 Nov 2006 10:09:25 +0000 (11:09 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 1 Nov 2006 10:09:25 +0000 (11:09 +0100)
15 files changed:
.gitignore
ChangeLog
Documentation/user/GNUmakefile
buildscripts/git-update-changelog.py
input/regression/tie-semi-single.ly [new file with mode: 0644]
input/test/vertical-extent.ly
lily/include/tie-configuration.hh
lily/include/tie-formatting-problem.hh
lily/semi-tie.cc
lily/tie-configuration.cc
lily/tie-formatting-problem.cc
lily/tie.cc
mf/GNUmakefile
python/convertrules.py
scm/define-grobs.scm

index 6a3858d251ab98ebf9b47c645f5f6ce4d12f5a7f..d1885128819ca55be0044c36617463aa807c27a3 100644 (file)
@@ -15,3 +15,4 @@ tags
 .gdbinit
 ?.ly
 *.midi
+\#*
index 59af023c9338e8a94f08bea1fe662c373512eb20..d54fc65cfd7ac18ab3ab3cd0609fdf2ade82938e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 2006-10-30  Jan Nieuwenhuizen  <janneke@gnu.org>
 
-       * Hand-force git changes to commit.  Where is my changelog?
+       * python/convertrules.py (conv): Part 2 fixes vertical extent.
+
+       * input/test/vertical-extent.ly: Fix and elaborate on vertical
+       staff extent.  (Thanks Mats)
 
 2006-10-29  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
index d58ce5c1bc9e715fb97570cab34ab149f30fcd16..bab25063094579decd942e385fdadba6560cae5c 100644 (file)
@@ -195,13 +195,7 @@ $(outdir)/%.png: %.png
        convert -geometry 50x50% $< $@
 
 $(outdir)/%.png: %.eps
-       convert $< $@
-
-$(outdir)/%.eps: %.png
-       convert $< $@
-
-$(outdir)/%.eps: %.eps
-       cp $< $@
+       gs -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -q -sOutputFile=$@ -sDEVICE=png16m -dEPSCrop -dNOPAUSE -f $< -c quit
 
 $(outdir)/%.pdf: %.png
        convert $< $@
index fb6e01a5aea4ff3577a7e8ea094b66ceb3b62860..23390b1127173962a6b21641c4458668ea1fc908 100644 (file)
@@ -9,6 +9,7 @@ import optparse
 def read_pipe (x):
     print 'pipe', x
     return os.popen (x).read ()
+
 def system (x):
     print x
     return os.system (x)
@@ -45,6 +46,9 @@ class Commit:
 
         return files
 
+    def has_patch (self):
+        return self.touched_files () <> []
+    
     def apply (self, add_del_files):
         def note_add_file (x):
             add_del_files.append (('add', x.group (1)))
@@ -80,9 +84,17 @@ def parse_commit_log (log):
     c = Commit (locals ())
     return c
 
-def parse_add_changes (from_commit):
-    
-    log = read_pipe ('git log %(from_commit)s..' % locals ())
+def parse_add_changes (from_commit, max_count=0):
+    opt = ''
+    rest = '..'
+    if max_count:
+
+        # fixme.
+        assert max_count == 1
+        opt = '--max-count=%d' % max_count 
+        rest = ''
+        
+    log = read_pipe ('git log %(opt)s %(from_commit)s%(rest)s' % locals ())
 
     log = log[len ('commit '):]
     log = log.strip ()
@@ -131,14 +143,21 @@ Run this file from the CVS directory, with --git-dir
     
     log = open ('ChangeLog').read ()
 
-    if not options.start:
-        print 'Must set start committish.'  
-        sys.exit (1)
-
     if options.gitdir:
         os.environ['GIT_DIR'] = options.gitdir
-     
-    commits = parse_add_changes (options.start)
+
+
+    if not args:
+        if not options.start:
+            print 'Must set start committish.'  
+            sys.exit (1)
+
+        commits = parse_add_changes (options.start)
+    else:
+        commits = [] 
+        for a in args:
+            commits += parse_add_changes (a, max_count=1)
+
     if not commits:
         return
     
@@ -150,9 +169,18 @@ Run this file from the CVS directory, with --git-dir
         log = log[len (first):]
 
     file_adddel = []
-    final_log = ''
     
-    for c in commits:
+    collated_log = ''
+    collated_message = ''
+    
+    while commits:
+        c = commits[0]
+        commits = commits[1:]
+
+        if not c.has_patch ():
+            print 'patchless commit (merge?)'
+            continue
+        
         print 'patch ', c.committish
         try:
             c.apply (file_adddel)
@@ -168,23 +196,23 @@ Run this file from the CVS directory, with --git-dir
 
             new_log += header (last_commit)
 
-        new_log = changelog_body (c)  + new_log
+        collated_log = changelog_body (c)  + collated_log
         last_commit = c
 
-# FIXME: correct fix?
-#        final_log += self.message + '\n'
-        final_log += log
-        
+        collated_message += c.message + '\n'
         
+
+
     for (op, f) in file_adddel:
         if op == 'del':
             system ('cvs remove %(f)s' % locals ())
         if op == 'add':
             system ('cvs add %(f)s' % locals ())
 
-    new_log = header (last_commit) + new_log + '\n'
+    if last_commit: 
+        collated_log = header (last_commit) + collated_log + '\n'
 
-    log = new_log + log
+    log = collated_log + log
 
     try:
         os.unlink ('ChangeLog~')
@@ -194,8 +222,14 @@ Run this file from the CVS directory, with --git-dir
     os.rename ('ChangeLog', 'ChangeLog~')
     open ('ChangeLog', 'w').write (log)
 
-    open ('.msg','w').write (final_log)
-    print 'cvs commit -F .msg '
+    open ('.msg','w').write (collated_message)
+    print '\nCommit message\n**\n%s\n**\n' % collated_message
+    print '\nRun:\n\n\tcvs commit -F .msg\n\n'
+
+
+    if commits:
+        print 'Commits left to do:'
+        print ' '.join ([c.committish for c in commits])
     
 main ()
     
diff --git a/input/regression/tie-semi-single.ly b/input/regression/tie-semi-single.ly
new file mode 100644 (file)
index 0000000..ccd1c4a
--- /dev/null
@@ -0,0 +1,30 @@
+
+\header {
+
+
+  texidoc = "Like normal ties, single semities (LaissezVibrerTie or
+RepeatTie) get their direction from the stem direction, and may be
+tweaked with @code{#'direction}."
+
+
+}
+\version "2.9.27"
+\layout{ragged-right=##t}
+
+{
+  r4
+  c'\laissezVibrer\repeatTie
+  \stemUp
+  b'\laissezVibrer\repeatTie
+  r
+  
+  \stemDown
+  b'\laissezVibrer\repeatTie
+  r
+  c''\laissezVibrer\repeatTie
+  r
+  
+  \override LaissezVibrerTie #'direction = #DOWN
+  \override RepeatTie #'direction = #DOWN
+  c''\laissezVibrer_"override"\repeatTie
+} 
index 1d8aa9d366a5d6bfc0de93f586ef3db987da6f92..16d8850ced22409cceba2aa31a9b577a3e2eb20f 100644 (file)
@@ -5,8 +5,8 @@
 
 \header { texidoc = "
 Vertical extents may increased by setting @code{\override VerticalAxisGroup #'minimum-Y-extent}, 
-@code{extraVerticalExtent}, and @code{verticalExtent}. In this example,
-@code{verticalExtent} is increased.
+@code{extra-Y-extent}, and @code{Y-extent}. In this example,
+@code{Y-extent} is increased.
 " }
 
 \score {
index 0594de6eaf8eb4d9bc27573f9a80ad7c2b7c4b6e..cd3bfe399882c875400d70fb9a7f2758f132af9d 100644 (file)
@@ -44,6 +44,7 @@ public:
   Bezier get_transformed_bezier (Tie_details const &) const;
   Bezier get_untransformed_bezier (Tie_details const &) const;
   Real height (Tie_details const&) const;
+  int column_span_length () const;
   
   static int compare (Tie_configuration const &a,
                      Tie_configuration const &b);
index 08b823fc83783a9c0a498a25a61882da74c9b020..5d46129fe592778753e15cd497a3179a5e73e19f 100644 (file)
@@ -37,6 +37,7 @@ struct Tie_specification
   
   Tie_specification ();
   int column_span () const;
+  void get_tie_manual_settings (Grob *);
 };
 
 struct Tie_configuration_variation
index 854dd0302e2843ecbc5570b3bb3531f427b64d44..c5a514b53559662c532a5dae6cdf6d684e0d894e 100644 (file)
@@ -34,6 +34,8 @@ SCM
 Semi_tie::calc_control_points (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
+  (void) me->get_property ("direction");
+  
   if (Semi_tie_column::has_interface (me->get_parent (Y_AXIS)))
     {
       me->get_parent (Y_AXIS)->get_property ("positioning-done");
@@ -47,24 +49,6 @@ Semi_tie::calc_control_points (SCM smob)
   return SCM_UNSPECIFIED;
 }
 
-MAKE_SCHEME_CALLBACK(Semi_tie, calc_direction, 1)
-SCM
-Semi_tie::calc_direction (SCM smob)
-{
-  Grob *me = unsmob_grob (smob);
-  if (Semi_tie_column::has_interface (me->get_parent (Y_AXIS)))
-    {
-      me->get_parent (Y_AXIS)->get_property("positioning-done");
-    }
-  else
-    {
-      programming_error ("lv tie without Semi_tie_column"); 
-      set_grob_direction (me, UP);
-    }
-
-  return SCM_UNSPECIFIED;
-}
-
 int
 Semi_tie::get_position (Grob *me)
 {
index 438d22e2c7e59933a187f390ecbd1eebb66ef4de..2e15eb72ebe6d21fbfa9fd3459c5cb7a53f02ee9 100644 (file)
@@ -74,6 +74,12 @@ Tie_configuration::get_untransformed_bezier (Tie_details const &details) const
                     details.ratio_);
 }
 
+int
+Tie_configuration::column_span_length () const
+{
+  return column_ranks_[RIGHT] - column_ranks_[LEFT];
+}
+
 Real
 Tie_configuration::distance (Tie_configuration const &a,
                             Tie_configuration const &b)
index 8adc406227c629f572e7549855d3a36e750f197b..d22d54bb6a28d43719a13ca5cc1b5111d6af6e88 100644 (file)
@@ -288,20 +288,10 @@ Tie_formatting_problem::from_ties (vector<Grob*> const &ties)
   for (vsize i = 0; i < ties.size (); i++)
     {
       Tie_specification spec;
+
+      spec.get_tie_manual_settings (ties[i]);
       
-      if (scm_is_number (ties[i]->get_property_data ("direction")))
-       {
-         spec.manual_dir_ = to_dir (ties[i]->get_property ("direction"));
-         spec.has_manual_dir_ = true;
-       }
-         
-      spec.position_ = Tie::get_position (ties[i]);
-      if (scm_is_number (ties[i]->get_property ("staff-position")))
-       {
-         spec.manual_position_ = scm_to_double (ties[i]->get_property ("staff-position"));
-         spec.has_manual_position_ = true;
-         spec.position_ = int (my_round (spec.manual_position_));
-       }
+
       
       do
        {
@@ -315,19 +305,19 @@ Tie_formatting_problem::from_ties (vector<Grob*> const &ties)
 }
 
 void
-Tie_formatting_problem::from_semi_ties (vector<Grob*> const &lv_ties, Direction head_dir)
+Tie_formatting_problem::from_semi_ties (vector<Grob*> const &semi_ties, Direction head_dir)
 {
-  if (lv_ties.empty ())
+  if (semi_ties.empty ())
     return;
   
-  details_.from_grob (lv_ties[0]);
+  details_.from_grob (semi_ties[0]);
   vector<Item*> heads;
 
   int column_rank = -1;
-  for (vsize i = 0; i < lv_ties.size (); i++)
+  for (vsize i = 0; i < semi_ties.size (); i++)
     {
       Tie_specification spec;
-      Item *head = unsmob_item (lv_ties[i]->get_object ("note-head"));
+      Item *head = unsmob_item (semi_ties[i]->get_object ("note-head"));
        
       if (!head)
        programming_error ("LV tie without head?!");
@@ -336,8 +326,9 @@ Tie_formatting_problem::from_semi_ties (vector<Grob*> const &lv_ties, Direction
        {
          spec.position_ = int (Staff_symbol_referencer::get_position (head));
        }
-      
 
+      spec.get_tie_manual_settings (semi_ties[i]);
+      
       spec.note_head_drul_[head_dir] = head;
       column_rank = dynamic_cast<Item*> (head)->get_column ()->get_rank ();
       spec.column_ranks_ = Drul_array<int> (column_rank, column_rank);
@@ -345,9 +336,9 @@ Tie_formatting_problem::from_semi_ties (vector<Grob*> const &lv_ties, Direction
       specifications_.push_back (spec);
     }
 
-  x_refpoint_ = lv_ties [0];
-  for (vsize i = 0; i < lv_ties.size (); i++)
-    x_refpoint_ = lv_ties[i]->common_refpoint (x_refpoint_, X_AXIS); 
+  x_refpoint_ = semi_ties [0];
+  for (vsize i = 0; i < semi_ties.size (); i++)
+    x_refpoint_ = semi_ties[i]->common_refpoint (x_refpoint_, X_AXIS); 
   for (vsize i = 0; i < heads.size (); i++)
     x_refpoint_ = heads[i]->common_refpoint (x_refpoint_, X_AXIS); 
 
@@ -494,20 +485,29 @@ Tie_formatting_problem::generate_configuration (int pos, Direction dir,
 
   conf->attachment_x_.widen ( - details_.x_gap_);
 
-  Direction d = LEFT;
-  do
+  if (conf->column_span_length ())
     {
-      Real y = conf->position_ * details_.staff_space_ * 0.5 + conf->delta_y_;
-      if (get_stem_extent (conf->column_ranks_[d], d, X_AXIS).is_empty ()
-         || !get_stem_extent (conf->column_ranks_[d], d, Y_AXIS).contains (y))
-       continue;
+      /*
+       avoid the stems that we attach to as well. We don't do this
+       for semities (span length = 0)
 
-      conf->attachment_x_[d] =
-       d * min (d * conf->attachment_x_[d],
-                d * (get_stem_extent (conf->column_ranks_[d], d, X_AXIS)[-d] - d * details_.stem_gap_));
-    }
-  while (flip (&d) != LEFT);
-  
+       It would be better to check D against HEAD-DIRECTION if
+       applicable.
+      */
+      Direction d = LEFT;
+      do
+       {
+         Real y = conf->position_ * details_.staff_space_ * 0.5 + conf->delta_y_;
+         if (get_stem_extent (conf->column_ranks_[d], d, X_AXIS).is_empty ()
+             || !get_stem_extent (conf->column_ranks_[d], d, Y_AXIS).contains (y))
+           continue;
+
+         conf->attachment_x_[d] =
+           d * min (d * conf->attachment_x_[d],
+                    d * (get_stem_extent (conf->column_ranks_[d], d, X_AXIS)[-d] - d * details_.stem_gap_));
+       }
+      while (flip (&d) != LEFT);
+    }  
   return conf;
 }
 
@@ -709,6 +709,25 @@ Tie_specification::Tie_specification ()
     column_ranks_[LEFT] = 0;
 }
 
+
+void
+Tie_specification::get_tie_manual_settings (Grob *tie)
+{
+  if (scm_is_number (tie->get_property_data ("direction")))
+    {
+      manual_dir_ = to_dir (tie->get_property ("direction"));
+      has_manual_dir_ = true;
+    }
+  
+  position_ = Tie::get_position (tie);
+  if (scm_is_number (tie->get_property ("staff-position")))
+    {
+      manual_position_ = scm_to_double (tie->get_property ("staff-position"));
+      has_manual_position_ = true;
+      position_ = int (my_round (manual_position_));
+    }
+}
+
 int
 Tie_specification::column_span () const
 {
@@ -901,9 +920,16 @@ Tie_formatting_problem::set_ties_config_standard_directions (Ties_configuration
 {
   if (tie_configs->empty ())
     return ;
-  
+
   if (!tie_configs->at (0).dir_)
-    tie_configs->at (0).dir_ = DOWN;
+    {
+      if (tie_configs->size () == 1)
+       tie_configs->at (0).dir_ = Direction (sign (tie_configs->at (0).position_));
+
+      if (!tie_configs->at (0).dir_)
+       tie_configs->at (0).dir_ = DOWN;
+    }
+  
   if (!tie_configs->back ().dir_)
     tie_configs->back ().dir_ = UP;
 
index 2cad6b302f5d5393ea7995ca7e89ba85f9b4d8be..264bc9172a2b6f60d018c92863195787520e4581 100644 (file)
@@ -26,6 +26,7 @@
 #include "tie-configuration.hh"
 #include "tie-formatting-problem.hh"
 #include "warn.hh"
+#include "semi-tie-column.hh"
 
 
 bool
@@ -44,6 +45,15 @@ Tie::set_head (Grob *me, Direction d, Grob *h)
 Grob *
 Tie::head (Grob *me, Direction d)
 {
+  if (is_direction (me->get_property ("head-direction")))
+     {
+       Direction hd = to_dir (me->get_property ("head-direction"));
+       return (hd == d)
+        ? unsmob_grob (me->get_object ("note-head"))
+        : 0;
+     }
+  
   Item *it = dynamic_cast<Spanner*> (me)->get_bound (d);
   if (Note_head::has_interface (it))
     return it;
@@ -135,7 +145,8 @@ Tie::calc_direction (SCM smob)
 {
   Grob *me = unsmob_grob (smob);
   Grob *yparent = me->get_parent (Y_AXIS);
-  if (Tie_column::has_interface (yparent)
+  if ((Tie_column::has_interface (yparent)
+       || Semi_tie_column::has_interface (yparent)) 
       && unsmob_grob_array (yparent->get_object ("ties"))
       && unsmob_grob_array (yparent->get_object ("ties"))->size () > 1)
     {
index 8a60b496309e04e845f1d0d9a6e7a4ebe38302e9..0956ee36ef0f9ed4a8c1883b102d76df6de96772 100644 (file)
@@ -60,10 +60,10 @@ $(outdir)/aybabtu.otf-gtable: $(BRACES:%=$(outdir)/feta-braces-%.otf-gtable)
 #
 
 
-$(outdir)/emmentaler-%.otf $(outdir)/emmentaler-%.svg: $(outdir)/emmentaler-%.pe $(outdir)/feta%.pfa  $(outdir)/feta-alphabet%.pfa  $(outdir)/parmesan%.pfa
+$(outdir)/emmentaler-%.otf $(outdir)/emmentaler-%.svg: $(outdir)/emmentaler-%.pe $(outdir)/feta%.pfa  $(outdir)/feta-alphabet%.pfa  $(outdir)/parmesan%.pfa $(outdir)/feta%.otf-table $(outdir)/feta%.otf-gtable
        cd $(outdir) && $(FONTFORGE) -script $(notdir $(basename ,$@).pe)
 
-$(outdir)/aybabtu.otf $(outdir)/aybabtu.svg: $(outdir)/aybabtu.pe $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).pfa)
+$(outdir)/aybabtu.otf $(outdir)/aybabtu.svg: $(outdir)/aybabtu.pe $(foreach s,$(BRACES),$(outdir)/feta-braces-$(s).pfa) $(outdir)/aybabtu.otf-table $(outdir)/aybabtu.otf-gtable
        cd $(outdir) && $(FONTFORGE) -script aybabtu.pe
        -rm -f $(outdir)/*.scale.{pfa,afm}
 
@@ -140,23 +140,11 @@ default: $(ALL_GEN_FILES) $(outdir)/emmentaler-20.otf tree-regen
 tree-regen:
        ${MAKE} -C $(top-build-dir) link-mf-tree
 
-debian-mirror=http://ftp.us.debian.org
-debian-package =lilypond_$(TOPLEVEL_VERSION)-1_i386.deb
-$(outdir)/$(debian-package):
-       wget --passive-ftp -P $(outdir) $(debian-mirror)/debian/pool/main/l/lilypond/$(debian-package)
-
-redhat-package=lilypond-$(TOPLEVEL_VERSION)-1.i386.rpm
-$(outdir)/$(redhat-package):
-       wget  --passive-ftp -P $(outdir) http://lilypond.org/download/binaries/Fedora-4/$(redhat-package)
-
 ##
 ## todo: this also depends on .tfm, FIXME.
 $(outdir)/%.lisp $(outdir)/%.otf-gtable $(outdir)/%.enc  $(outdir)/%.tex $(outdir)/%.dep: $(outdir)/%.log $(outdir)/%.tfm
        $(PYTHON) $(buildscript-dir)/mf-to-table.py --global-lisp=$(outdir)/$(<F:.log=.otf-gtable) --lisp=$(outdir)/$(<F:.log=.lisp) --outdir=$(outdir) --dep $(outdir)/$(<F:.log=.dep) --enc $(outdir)/$(<F:.log=.enc) --tex $(outdir)/$(<F:.log=.tex) $<
 
-fontdir: $(addprefix $(outdir)/, lilypond.map lilypond.sfd private-fonts fonts.scale fonts.dir Fontmap.lily)
-
-
 local-clean:
        rm -f mfplain.mem mfplain.log
        rm -f *.tfm *.log
index 995b2ea3b0c260cd58bbd4b199388a6ca335432a..c992476dc1bfb4d9a7daa4068b220037d19b2712 100644 (file)
@@ -2632,8 +2632,10 @@ def conv (str):
     str = re.sub (r"minimumVerticalExtent",
                  r"\\override VerticalAxisGroup #'minimum-Y-extent",
                  str)
+    str = re.sub (r"\\set ([a-zA-Z]*\.?)extraVerticalExtent",
+                 r"\\override \1VerticalAxisGroup #'extra-Y-extent")
     str = re.sub (r"\\set ([a-zA-Z]*\.?)verticalExtent",
-                 r"\\override \1VerticalAxisGroup")
+                 r"\\override \1VerticalAxisGroup #'Y-extent")
     return str
 
 conversions.append (((2, 7, 14), conv,
index 37277a762ac70a8fec386f0144aaa2f5d5cd4692..3ad6b22bff125b113e77982f4eac300a2ae2340d 100644 (file)
      . (
        (stencil  . ,ly:tie::print)
        (control-points . ,ly:semi-tie::calc-control-points)
-       (direction . ,ly:semi-tie::calc-direction)
+       (direction . ,ly:tie::calc-direction)
        (details . ((ratio . 0.333)
                    (height-limit . 1.0)))
+       (head-direction . ,LEFT)
        (thickness . 1.0)
        (meta . ((class . Item)
                 (interfaces . (semi-tie-interface))
      . (
        (stencil  . ,ly:tie::print)
        (control-points . ,ly:semi-tie::calc-control-points)
-       (direction . ,ly:semi-tie::calc-direction)
+       (direction . ,ly:tie::calc-direction)
        (details . ((ratio . 0.333)
                    (height-limit . 1.0)))
        (thickness . 1.0)
+       (head-direction . ,RIGHT)
        (meta . ((class . Item)
                 (interfaces . (semi-tie-interface))
                 ))
      . (
        (X-extent . #f)
        (Y-extent . #f)
+       (direction . ,ly:tie::calc-direction)
        (head-direction . ,RIGHT)
+       
        (positioning-done . ,ly:semi-tie-column::calc-positioning-done)
        (meta . ((class . Item)
                 (interfaces . (semi-tie-column-interface))