+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.
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))
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 ();
if (tp)
{
SCM sym = tp->get_context_name ();
- scm_module_define (m->scope_, sym, transdef);
+ m->set_variable (sym, transdef);
}
}
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 ();
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_);
}
::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 ();
}
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);
(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))
(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)))
(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)
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)