]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.5.8
authorfred <fred>
Wed, 27 Mar 2002 01:21:03 +0000 (01:21 +0000)
committerfred <fred>
Wed, 27 Mar 2002 01:21:03 +0000 (01:21 +0000)
buildscripts/lys-to-tely.py
lily/all-font-metrics.cc
lily/global-translator.cc
lily/include/kpath.hh
lily/kpath.cc
lily/new-spacing-spanner.cc
ps/music-drawing-routines.ps
scm/grob-description.scm
tex/lily-ps-defs.tex

index eac92934e8fb8eccadad1d52b5f600df188c880b..22343a77a7f3a413d652f91c774ac0fb48640694 100644 (file)
@@ -65,7 +65,7 @@ if files:
                if string.find (n, '+') >= 0:
                        s = "@lilypondfile{%s}" % n
                else:
-                       s = "@lilypondfile[printfilename]{%s}" % n
+                       s = "@lilypondfile[printfilename,verbatim]{%s}" % n
                return s
 
        s = s + string.join (map (lambda x: name2line (x), files), "\n")
@@ -76,4 +76,8 @@ if files:
        h.write (s)
        h.close ()
        sys.stderr.write ('\n')
-       
+else:
+       # not Unix philosophy, but hey, at least we notice when
+       # we don't distribute any .ly files.
+       sys.stderr.write ("No files specified. Doing nothing")
+
index 61a66c33bcb78407ca4673cb9b95699b7c3e48ed..b198384426c8a4388b7409a6e4e0da8c7b6fc79f 100644 (file)
@@ -52,8 +52,8 @@ All_font_metrics::find_afm (String name)
 
       if (path.empty_b ())
        {
-         char  * p = ly_find_afm (name.ch_C ());
-         if (p)
+         String p = ly_find_afm (name.ch_C ());
+         if (p.length_i ())
            path = p;
        }
 
index 4e4208bd8282ab00b31d6e982ff3cbd83375e136..d66b6f05e9b439fbe67bca93d2a060b3e111ffa0 100644 (file)
@@ -98,7 +98,7 @@ Global_translator::run_iterator_on_me (Music_iterator * iter)
 
       w = sneaky_insert_extra_moment (w);
 
-      //      cout << "Proccing " << w << endl;
+      cout << "Proccing " << w << endl;
 
       
       if (first)
index accc1f610a3f444c6aae8d1f878e1fa40cac42f2..02528c3e25ad085204523c4b4ec11ff04513c5e5 100644 (file)
@@ -12,7 +12,7 @@ source file of the GNU LilyPond music typesetter
 
 
 
-char * ly_find_afm (char const * name);
+String ly_find_afm (char const * name);
 String ly_find_tfm (char const * name);
 void ly_init_kpath (char *av0);
 
index 0e39e0c1ff8c60227c9c22cb9cb55db8f711a808..62e0186c0596f68cf2129c6d4be00596f20049fe 100644 (file)
@@ -26,15 +26,27 @@ extern "C" {
 #include "main.hh"
 #include "kpath.hh"
 #include "lily-version.hh"
+#include "warn.hh"
 
-
-char *
+String
 ly_find_afm (char const * name)
 {
 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
-  return kpse_find_file (name, kpse_afm_format, true);
+  char * name_ptr =  kpse_find_file (name, kpse_afm_format, true);
+
+  if(!name_ptr)
+    {
+  /*
+    don't mutter about afms, since we try to find them first, and lots of
+    TFMs don't have AFMs. 
+   */
+      //      warning (_f("kpathsea couldn't find AFM file `%s'", name));
+    }
+  else
+    return name_ptr;
+  
 #endif
-  return 0;
+  return "";
 }
 
 String
@@ -46,7 +58,14 @@ ly_find_tfm (char const * name)
     return p;
   
 #if (KPATHSEA && HAVE_KPSE_FIND_FILE)
-  return kpse_find_file (name, kpse_tfm_format, true);
+  char * name_ptr =  kpse_find_file (name, kpse_tfm_format, true);
+  if(!name_ptr)
+    {
+      warning (_f("Kpathsea couldn't find TFM file `%s'", name));
+    }
+  else
+    return name_ptr;
+  
 #endif
   return "";
 }
index 4ed9c7afde66510381b40af35b75844290ea9d59..760651efeec8a29367f88fd25e08c016947cc29e 100644 (file)
@@ -41,14 +41,13 @@ New_spacing_spanner::set_interface (Grob*me)
 void
 New_spacing_spanner::do_measure (Grob*me, Link_array<Grob> *cols) 
 {
-  Moment shortest;
-  Moment mean_shortest;
+  Moment shortest_in_measure;
 
   /*
     space as if this duration  is present. 
    */
   Moment base_shortest_duration = *unsmob_moment (me->get_grob_property ("maximum-duration-for-spacing"));
-  shortest.set_infinite (1);
+  shortest_in_measure.set_infinite (1);
 
   for (int i = cols->size(); i--;)
     {
@@ -71,12 +70,7 @@ New_spacing_spanner::do_measure (Grob*me, Link_array<Grob> *cols)
          
          SCM  st = cols->elem (i)->get_grob_property ("shortest-starter-duration");
          Moment this_shortest = *unsmob_moment (st);
-         shortest = shortest <? this_shortest;
-         if (!mean_shortest.main_part_.infty_b ())
-           {
-             n++;
-             mean_shortest += this_shortest;
-           }
+         shortest_in_measure = shortest_in_measure <? this_shortest;
        }
     }
   
@@ -111,29 +105,62 @@ cout << "params for cols " << Paper_column::rank_i (l) << " " << Paper_column::r
          continue ; 
        }
       
-      Real note_space = note_spacing (me,lc, rc, shortest <? base_shortest_duration);
+      Real note_space = note_spacing (me,lc, rc, shortest_in_measure <? base_shortest_duration);
       Real hinterfleisch = note_space;
       Real headwid = gh_scm2double (me->get_grob_property ("arithmetic-multiplier"));
+
+      SCM seq  = lc->get_grob_property ("spacing-sequence");
+
+      Moment dt = Paper_column::when_mom (r) - Paper_column::when_mom (l);
       
-      for (SCM s = lc->get_grob_property ("spacing-sequence"); gh_pair_p (s); s = gh_cdr (s))
+      /*
+       hinterfleisch = hind-meat = amount of space following a note.
+
+       
+       We adjust the space following a note only if the next note
+       happens after the current note (this is set in the grob
+       property SPACING-SEQUENCE.  */
+
+      Real stretch_distance = note_space;
+      if (shortest_in_measure <= dt)
        {
-         Grob *lm = unsmob_grob (gh_caar (s));
-         Grob *rm = unsmob_grob (gh_cdar (s));
+         /*
+           currently SPACING-SEQUENCE is set in
+           Separating_group_spanner::find_musical_sequences (), which
+           works neatly for one-voice-per staff, however,
 
-         // TODO; configgable.
-         hinterfleisch += -headwid + Separation_item::my_width (lm)[RIGHT] -
-           0.5 * Separation_item::my_width (rm)[LEFT];
+           it can't find out the actual duration of the notes on a
+           staff, so when putting tuplets and normal patterns it gets
+           confused, (ie. believes that < { c8 c8 } { d8 d8 d8 }*2/3
+           > contains 1/12 notes. ).
 
+           here we kludge, by checking if the distance we're spacing
+           for is less than the shortest note.
+
+           TODO:
+
+           Move SPACING-SEQUENCE detection into a voice
+           level-engraver --or-- make sure that every column has
+           access to the note head.
 
-         /*
-           UGH: KLUDGE!
          */
-         
-         //      if (delta_t > Moment (Rational (1,32)))
-         hinterfleisch += stem_dir_correction (me, l, r);
-       }
+         for (SCM s = seq; gh_pair_p (s); s = gh_cdr (s))
+           {
+             Grob *lm = unsmob_grob (gh_caar (s));
+             Grob *rm = unsmob_grob (gh_cdar (s));
+
+             // TODO; configgable.
+             hinterfleisch += -headwid + Separation_item::my_width (lm)[RIGHT] -
+               0.5 * Separation_item::my_width (rm)[LEFT];
 
-      Real stretch_distance = note_space - headwid;
+
+             hinterfleisch += stem_dir_correction (me, l, r);
+           }
+
+         // ? why.
+         if (gh_pair_p (seq))
+           stretch_distance -= headwid;
+       }      
       Spring s;
       s.distance_f_ = hinterfleisch;
       s.strength_f_ = 1 / stretch_distance;
@@ -311,7 +338,7 @@ New_spacing_spanner::stretch_to_regularity (Grob *me,
  */
 Real
 New_spacing_spanner::default_bar_spacing (Grob*me, Grob *lc, Grob *rc,
-                                     Moment shortest) 
+                                         Moment shortest) 
 {
   Real symbol_distance = lc->extent (lc,X_AXIS)[RIGHT] ;
   Real durational_distance = 0;
@@ -358,7 +385,7 @@ New_spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc,
   Moment shortest_playing_len = 0;
   SCM s = lc->get_grob_property ("shortest-playing-duration");
 
-  //  SCM s = lc->get_grob_property ("mean-playing-duration");  
+
   if (unsmob_moment (s))
     shortest_playing_len = *unsmob_moment (s);
   
index d2f3bac4c62e2c56ff48f2e25e440278d262fe03..a4c83114657fef3a603c0d53be2981c1b0a50466 100644 (file)
@@ -4,6 +4,10 @@
 
 /blot-diameter { lilypondpaperblotdiameter } bind def
 
+% fucking redhat xdvi patch.
+/skeel { scale } bind def
+
+
 /set_tex_dimen {
        cvr def     
 } bind def
@@ -13,6 +17,7 @@
        1 copy mul exch 1 copy mul add sqrt 
 } bind def 
 
+/skeel { scale } bind def
 % FIXME.  translate to middle of box.
 % Nice rectangle with rounded corners
 /draw_box % breapth width depth height
index c24f36972381fc566585ecc88ab09e6d33b21165..dc0fbd7a07376d092adad860f9620478da6a05d0 100644 (file)
                 ))
              
        (SpacingSpanner . (
-               (spacing-procedure . ,Spacing_spanner::set_springs)
+               (spacing-procedure . ,New_spacing_spanner::set_springs)
                (stem-spacing-correction . 0.5)
                (grace-space-factor . 0.8)
 
index ab5ad6b4345fa92dd222b8859a09e66a07f77345..79cb916235c0ae6c814b9b32207f7649e19f7886 100644 (file)
@@ -16,8 +16,9 @@
         \def\embeddedps##1{%
                 \special{ps\string: @beginspecial @setspecial
                         \lilypondpaperoutputscale\lilySpace 
-                        \lilypondpaperoutputscale\lilySpace scale 
-                        ##1 @endspecial}%
+                        \lilypondpaperoutputscale\lilySpace
+                        % FUCKING REDHAT XDVI -- ARG!
+                        skeel ##1 @endspecial}%
         }
 }
 \def\PSsetTeXdimen#1{\expandafter\special{! /#1 (\csname #1\endcsname) set_tex_dimen}}