]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/output-def.cc (assign_context_def): use set_variable().
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 17 Aug 2004 22:39:34 +0000 (22:39 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 17 Aug 2004 22:39:34 +0000 (22:39 +0000)
* lily/text-item.cc (interpret_string): accept string input
encoding too.

* scm/encoding.scm (read-encoding-file): print warning when file
can't be found.

* tex/GNUmakefile ($(outdir)/latin1.enc): create latin1 from GS.

* lily/rod.cc (columnize): robustness fix. Don't crash for
nil span points. Fixes: appoggiatura-segfault.ly
(add_to_cols): extra robustness fix.

ChangeLog
lily/dynamic-engraver.cc
lily/include/output-def.hh
lily/output-def.cc
lily/rod.cc
lily/script-engraver.cc
lily/text-item.cc
scm/encoding.scm
scm/lily.scm
tex/GNUmakefile

index 385f30c319e87136f74d625015707b9581f12581..8d85fcee7acee4cd50e79930de0d2163aa235b85 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2004-08-18  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/output-def.cc (assign_context_def): use set_variable().
+
+       * lily/text-item.cc (interpret_string): accept string input
+       encoding too.
+
+       * scm/encoding.scm (read-encoding-file): print warning when file
+       can't be found.
+
+       * tex/latin1.enc: remove.
+
+       * tex/GNUmakefile ($(outdir)/latin1.enc): create latin1 from GS.
+
+       * lily/rod.cc (columnize): robustness fix. Don't crash for
+       nil span points. Fixes: appoggiatura-segfault.ly
+       (add_to_cols): extra robustness fix.
+
+2004-08-17  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/text-item.cc (interpret_string): use lookup_variable() to
+       fidn inputencoding. Now, \paper inherits inputencoding from
+       \bookpaper.
+
+       * lily/script-engraver.cc (stop_translation_timestep): remove slur
+       collision kludge.
+
+       * lily/dynamic-engraver.cc (typeset_all): remove slur collision
+       kludge.
+
 2004-08-14  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * lily/main.cc (parse_argv): Bugfix: handle 'p'.  Add warning.
index 76dc123384b75fca2f8a6a088bdb1dae986efb1d..9b0b1892ada9319c161f9bea05a816d6b281c387 100644 (file)
@@ -313,27 +313,6 @@ Dynamic_engraver::finalize ()
 void
 Dynamic_engraver::typeset_all ()
 {
-  /* Simplistic slur collision handling.  This fixes simple collisions
-     like
-     
-         a\p( b)
-
-     which are unacceptable, but it most probably breaks for more
-     interesting cases.  Maybe make a new colission engraver.  */
-  if (finished_line_spanner_
-      && slur_
-      && get_slur_dir (slur_) == get_grob_direction (finished_line_spanner_)
-      && !intersection (slur_->spanned_rank_iv (),
-                       finished_line_spanner_->spanned_rank_iv ()).is_empty ())
-    {
-      Real ss = Staff_symbol_referencer::staff_space (finished_line_spanner_);
-      Real pad = robust_scm2double (finished_line_spanner_
-                                   ->get_property ("padding"), 0);
-      /* FIXME: 1ss padding hardcoded */
-      finished_line_spanner_->set_property ("padding",
-                                           scm_make_real (pad + ss));
-    }
-
   if (finished_cresc_)
     {
       if (!finished_cresc_->get_bound (RIGHT))
index cd76d29881bd0bf6e35046c7d6c2aec95ff90c8f..4b2bf9c3e48151274f101075380c497e0cadfc9e 100644 (file)
@@ -43,9 +43,9 @@ public:
   VIRTUAL_COPY_CONSTRUCTOR (Output_def, Output_def);
   DECLARE_SMOBS (Output_def,);
 public:
+  SCM scope_;
   Output_def * parent_;
   Input input_origin_;
-  SCM scope_;
 
   Output_def (Output_def const&);
   Output_def ();
index 10dbc0f783309be2e45c7c97eb5b097f4feb81c2..1895daa6606929c70620e2ea7cc8a0864e99a391 100644 (file)
@@ -75,7 +75,7 @@ assign_context_def (Output_def * m, SCM transdef)
   if (tp)
     {
       SCM sym = tp->get_context_name ();
-      scm_module_define (m->scope_, sym, transdef);
+      m->set_variable (sym, transdef);
     }  
 }
 
index d79fd7f772e7774ab14f8653078a2b0670fdddc2..f86fc4e112bcf363035404bb0d9cb7e217d60409 100644 (file)
@@ -23,6 +23,10 @@ Rod::Rod ()
 void
 Rod::columnize ()
 {
+  if (!item_l_drul_[LEFT]
+      || !item_l_drul_[RIGHT])
+    return ;
+  
   Direction d = LEFT;
   do {
     Paper_column * pc = item_l_drul_[d]->get_column ();
@@ -36,9 +40,10 @@ void
 Rod::add_to_cols ()
 {
   columnize ();
-  if (item_l_drul_[LEFT] != item_l_drul_[RIGHT])
+  if (item_l_drul_[LEFT] != item_l_drul_[RIGHT]
+      && item_l_drul_[LEFT] && item_l_drul_[RIGHT])
     Spaceable_grob::add_rod (item_l_drul_[LEFT],
-                               item_l_drul_[RIGHT],
-                               distance_);
+                            item_l_drul_[RIGHT],
+                            distance_);
 }
 
index b8e93c6cd00aa193a509acd7264e12f9e623fa3a..20ec7faae69e97a116040cc8cc15d37245910bb8 100644 (file)
@@ -215,55 +215,6 @@ Script_engraver::stop_translation_timestep ()
                                     ::quantised_position_proc, Y_AXIS);
            sc->set_property ("staff-padding", SCM_EOL);
          }
-       
-       /* Simplistic slur collision handling.  This fixes simple collisions
-          like
-          
-          a_\upbow( b)
-          
-          but it most probably breaks for more interesting cases.
-          Maybe make a new colission engraver.
-
-          
-          Assume that a SCRIPT that should collide with SLUR does not
-          have a negative priority. */
-       SCM priority = sc->get_property ("script-priority");
-
-#if 0
-       // this segfaults...
-       int rank = Paper_column::get_rank (sc);
-#endif
-       
-       int rank = -1;
-#if 1
-       // this always yields -1
-       if (Item *i = dynamic_cast<Item*> (sc))
-         if (i->get_column ())
-           rank = i->get_column ()->rank_;
-#else
-       // this always yields -1
-       for (Grob *p = sc; p && rank < 0; p = p->get_parent (Y_AXIS))
-         {
-           if (Item *i = dynamic_cast<Item*> (p))
-             if (i->get_column ())
-               rank = i->get_column ()->rank_;
-         }
-#endif
-
-       if (robust_scm2int (priority, 0) >= 0
-           && slur_
-           && get_grob_direction (sc) == get_slur_dir (slur_)
-           && (slur_->spanned_rank_iv ().contains (rank)
-               /* I'm a bit out of ideas about and time to search for
-                  how to get our rank.  Sue me.  */
-               || rank == -1))
-         {
-           Real ss = Staff_symbol_referencer::staff_space (sc);
-           Real pad = robust_scm2double (sc->get_property ("padding"), 0);
-
-           /* FIXME: 1ss padding hardcoded */
-           sc->set_property ("padding", scm_make_real (pad + ss));
-         }
       }
   scripts_.clear ();
 }
index b88ad73280b9027fce9213031dc22b8788568e5b..1226c8e3b31de96c2a01fae87ca64a00f4b330a1 100644 (file)
@@ -35,20 +35,11 @@ Text_item::interpret_string (SCM paper_smob,
   String str = ly_scm2string (markup);
   if (!ly_c_symbol_p (input_encoding))
     {
-      /* FIXME: input_encoding is set in *book*_paper
-
-         Options include:
-        
-         1. produce a bookpaper from a paper.
-        2. add BOOKPAPER parameter to all callers, ie, all MARKUPs.  */
-      
-      programming_error ("FIXME: looking up input_encoding in paper");
-      programming_error ("as a workaround, set inputencoding in your \\paper block");
-      SCM var = ly_module_lookup (paper->scope_,
-                                 ly_symbol2scm ("inputencoding"));
-      if (var != SCM_BOOL_F) 
-       input_encoding = scm_variable_ref (var);
-      
+      SCM enc = paper->lookup_variable (ly_symbol2scm ("inputencoding"));
+      if (ly_c_string_p (enc))
+       input_encoding = scm_string_to_symbol (enc);
+      else if (ly_c_symbol_p (enc))
+       input_encoding = enc;
     }
   
   Font_metric *fm = select_encoded_font (paper, props, input_encoding);
index 9c2b9906f3840e09cd2f7cee876d404c97a25468..5d35fe5745303e2d371d8beccf288911acf6b8ae 100644 (file)
 
 (define-public (read-encoding-file filename)
   "Read .enc file, return (COMMAND-NAME . VECTOR-OF-SYMBOLS)."
-  (let* ((raw (ly:gulp-file (ly:kpathsea-expand-path filename)))
+  (let* ((path (ly:kpathsea-expand-path filename))
+        (unused (if (string? path) #t (ly:warn "can't find ~s" filename)))
+        (raw (ly:gulp-file path))
         (string (regexp-substitute/global #f "%[^\n]*" raw 'pre "" 'post))
         (command (match:substring
-               (string-match "/([^ \t\n\r]*)[ \t\n\r]+[[]" string) 1))
+                  (string-match "/([^ \t\n\r]*)[ \t\n\r]+[[]" string) 1))
         (encoding (match:substring (string-match "[[](.*)[]]" string) 1))
         (ps-lst (string-tokenize encoding))
         (lst (map (lambda (x) (string->symbol (substring x 1))) ps-lst))
@@ -101,15 +103,16 @@ vector of symbols."
 
 (define (get-coding coding-name)
   (let ((entry (assoc-get coding-name coding-alist)))
-    (if entry (cons (car entry) (force (cdr entry)))
+    (if entry
+       (cons (car entry) (force (cdr entry)))
        (if (equal? coding-name "feta-music")
            (begin
              (ly:warn "installation problem: deprecated encoding requested: ~S" coding-name)
              (exit 1))
-       (let ((fallback "latin1"))
-*        (ly:programming-error "no such encoding: ~S" coding-name)
-         (ly:programming-error "programming error: cross thumbs, using: ~S:" fallback)
-         (get-coding fallback))))))
+           (let ((fallback "latin1"))
+             (ly:programming-error "no such encoding: ~S" coding-name)
+             (ly:programming-error "programming error: cross thumbs, using: ~S:" fallback)
+             (get-coding fallback))))))
 
 (define-public (get-coding-filename coding-name)
   (car (get-coding coding-name)))
index ac1f05c374e4b9c3841afa48529d2d91fcdf1a04..426d461d4058ab342d9c6dcc2cbfe771871379da 100644 (file)
@@ -11,6 +11,8 @@
 (if (defined? 'set-debug-cell-accesses!)
     (set-debug-cell-accesses! #f))
 
+;(set-debug-cell-accesses! 5000)
+
 (use-modules (ice-9 regex)
             (ice-9 safe)
             (oop goops)
index 1c1bf5c221bf316f5adeadb02c04b4a55d10148f..706184ee68b2e4ce92897b696831fdb79504ddf7 100644 (file)
@@ -14,8 +14,9 @@ $(outdir)/music-drawing-routines.ps: $(depth)/ps/music-drawing-routines.ps
        rm -f $@
        -ln $< $@
 
-$(outdir)/latin1.enc: latin1.enc
-       rm -f $@
-       -ln $< $@
+$(outdir)/latin1.enc: GNUmakefile
+       echo '/ISOLatin1Encoding ' > $@ 
+       echo 'ISOLatin1Encoding pstack' | gs -quiet -  >> $@
+       echo ' def ' >> $@
 
 all: $(INSTALLATION_FILES)