From: Han-Wen Nienhuys Date: Mon, 22 Mar 2004 12:20:52 +0000 (+0000) Subject: * lily/text-item.cc (interpret_markup): idem. X-Git-Tag: release/2.1.34~21 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=bdde3680c8709b0d84e9291642ae4474a3a31668;p=lilypond.git * lily/text-item.cc (interpret_markup): idem. * scm/define-markup-commands.scm: remove split around-space hack. * lily/staff-symbol-referencer.cc (get_rounded_position): new function, fold WL's fixes into one function. --- diff --git a/ChangeLog b/ChangeLog index 21c210112f..09612884e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-03-22 Han-Wen Nienhuys + + * lily/text-item.cc (interpret_markup): idem. + + * scm/define-markup-commands.scm: remove split around-space hack. + + * lily/staff-symbol-referencer.cc (get_rounded_position): new + function, fold WL's fixes into one function. + 2004-03-22 Werner Lemberg lily/stem.cc (Stem::extremal_heads, Stem::note_head_positions), @@ -15,6 +24,8 @@ 2004-03-21 Han-Wen Nienhuys + * VERSION: 2.1.33 released. + * scripts/lilypond-book.py (do_file): reinstate --filter support. * buildscripts/mf-to-table.py (base): use %d for TfmCheckSum @@ -61,6 +72,8 @@ * lily/tie-performer.cc (acknowledge_audio_element): bugfix: use and init ties_created_ + * VERSION: release 2.1.32 + * lily/include/music-iterator.hh (IMPLEMENT_CTOR_CALLBACK): remove doc string from IMPLEMENT_CTOR_CALLBACK(). diff --git a/VERSION b/VERSION index 3c7ba8f1b3..e95b04287b 100644 --- a/VERSION +++ b/VERSION @@ -2,5 +2,5 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=1 PATCH_LEVEL=33 -MY_PATCH_LEVEL= +MY_PATCH_LEVEL=hwn1 diff --git a/lily/custos.cc b/lily/custos.cc index 64f93c2a13..83913b2cda 100644 --- a/lily/custos.cc +++ b/lily/custos.cc @@ -54,7 +54,7 @@ Custos::print (SCM smob) Direction neutral_direction = to_dir (me->get_property ("neutral-direction")); - int pos = (int)rint (Staff_symbol_referencer::get_position (me)); + int pos = (int)Staff_symbol_referencer::get_rounded_position (me); int sz = Staff_symbol_referencer::line_count (me)-1; String font_char = "custodes-" + style + "-"; @@ -88,7 +88,7 @@ Custos::print (SCM smob) else { // add ledger lines - int pos = (int)rint (Staff_symbol_referencer::get_position (me)); + int pos = Staff_symbol_referencer::get_rounded_position (me); int interspaces = Staff_symbol_referencer::line_count (me)-1; if (abs (pos) - interspaces > 1) { diff --git a/lily/dot-column.cc b/lily/dot-column.cc index 523e2955f4..2d49465eb9 100644 --- a/lily/dot-column.cc +++ b/lily/dot-column.cc @@ -272,7 +272,7 @@ Dot_column::do_shifts (Grob*me) dp.extremal_head_ = Stem::first_head (stem) == note; } - int p = (int)rint (Staff_symbol_referencer::get_position (dp.dot_)); + int p = Staff_symbol_referencer::get_rounded_position (dp.dot_); dp.pos_= p; if (dp.extremal_head_) diff --git a/lily/include/staff-symbol-referencer.hh b/lily/include/staff-symbol-referencer.hh index b944ae93f7..b93516dbe0 100644 --- a/lily/include/staff-symbol-referencer.hh +++ b/lily/include/staff-symbol-referencer.hh @@ -40,6 +40,7 @@ public: static int line_count (Grob*); static Real get_position (Grob*); static Real staff_radius (Grob*); + static int get_rounded_position (Grob*me); }; int compare_position (Grob *const&,Grob *const&); diff --git a/lily/mensural-ligature.cc b/lily/mensural-ligature.cc index f7b6927f28..cbd404b32c 100644 --- a/lily/mensural-ligature.cc +++ b/lily/mensural-ligature.cc @@ -202,7 +202,7 @@ internal_brew_primitive (Grob *me, bool ledger_take_space) out.add_stencil (join); } - int pos = (int)rint (Staff_symbol_referencer::get_position (me)); + int pos = Staff_symbol_referencer::get_rounded_position (me); add_ledger_lines (me, &out, pos, 0, ledger_take_space); if (primitive & MLP_FLEXA) { diff --git a/lily/note-column.cc b/lily/note-column.cc index 123535c75e..d9a8ce3078 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -59,7 +59,7 @@ Note_column::head_positions_interval (Grob *me) { Grob *se = unsmob_grob (ly_car (h)); - int j = (int)rint (Staff_symbol_referencer::get_position (se)); + int j = Staff_symbol_referencer::get_rounded_position (se); iv.unite (Slice (j,j)); } return iv; diff --git a/lily/note-head.cc b/lily/note-head.cc index 4b35133227..0ec06d5686 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -140,7 +140,7 @@ internal_print (Grob *me, bool with_ledgers) } int interspaces = Staff_symbol_referencer::line_count (me)-1; - int pos = (int)rint (Staff_symbol_referencer::get_position (me)); + int pos = Staff_symbol_referencer::get_rounded_position (me); if (with_ledgers && interspaces >= 0 && abs (pos) - interspaces > 1) { @@ -269,7 +269,7 @@ Note_head::brew_ez_stencil (SCM smob) Box bx (Interval (0, 1.0), Interval (-0.5, 0.5)); Stencil m (bx, at); - int pos = (int)rint (Staff_symbol_referencer::get_position (me)); + int pos = Staff_symbol_referencer::get_rounded_position (me); int interspaces = Staff_symbol_referencer::line_count (me)-1; if (abs (pos) - interspaces > 1) { diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 83fb510504..99e371a999 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -24,10 +24,10 @@ /* This is an almost empty thing. The only substantial thing this class - handles, is scaling up and down to real-world dimensions (internally + handles is scaling up and down to real-world dimensions (internally dimensions are against global staff-space.) - */ + Paper_def::Paper_def () { } diff --git a/lily/score.cc b/lily/score.cc index 5e15b722e5..c43822ac2f 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -148,8 +148,7 @@ LY_DEFINE (ly_run_translator, "ly:run-translator", return scm_gc_unprotect_object (trans->self_scm ()); } -// FIXME: silly name, score/music is rendered, not the output -- render midi? -LY_DEFINE (ly_render_output, "ly:render-output", +LY_DEFINE (ly_format_output, "ly:format-output", 2, 0, 0, (SCM context, SCM outname), "Given a Score context in its final state," "process it and return the (rendered) result.") @@ -172,7 +171,7 @@ default_rendering (SCM music, SCM outdef, SCM header, SCM outname) if (Global_context *g = dynamic_cast (unsmob_context (context))) { - SCM systems = ly_render_output (context, outname); + SCM systems = ly_format_output (context, outname); Music_output *output = g->get_output (); if (systems != SCM_UNDEFINED) { diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index ae0586e39f..0a2b4faeec 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -77,6 +77,11 @@ Staff_symbol_referencer::get_position (Grob *me) return robust_scm2double (me->get_property ("staff-position"), p); } +int +Staff_symbol_referencer::get_rounded_position (Grob*me) +{ + return int (rint (get_position (me))); +} LY_DEFINE (ly_grob_staff_position, "ly:grob-staff-position", 1, 0,0, (SCM sg), @@ -163,3 +168,4 @@ ADD_INTERFACE (Staff_symbol_referencer,"staff-symbol-referencer-interface", "in their @code{Y-offset-callbacks}. " , "staff-position"); + diff --git a/lily/stem.cc b/lily/stem.cc index 3562170668..be9c8a265b 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -194,7 +194,7 @@ Stem::extremal_heads (Grob*me) Grob * n = unsmob_grob (ly_car (s)); - int p = (int)rint (Staff_symbol_referencer::get_position (n)); + int p = Staff_symbol_referencer::get_rounded_position (n); Direction d = LEFT; do { @@ -225,7 +225,7 @@ Stem::note_head_positions (Grob *me) for (SCM s = me->get_property ("note-heads"); gh_pair_p (s); s = ly_cdr (s)) { Grob * n = unsmob_grob (ly_car (s)); - int p = (int)rint (Staff_symbol_referencer::get_position (n)); + int p = Staff_symbol_referencer::get_rounded_position (n); ps.push (p); } @@ -624,7 +624,7 @@ Stem::flag (Grob*me) --hwn. */ - int p = (int)rint (Staff_symbol_referencer::get_position (first_head (me))); + int p = Staff_symbol_referencer::get_rounded_position (me); staffline_offs = Staff_symbol_referencer::on_staffline (me, p) ? "1" : "0"; } diff --git a/lily/text-item.cc b/lily/text-item.cc index b327e78865..63ed2334fd 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -22,14 +22,7 @@ Text_item::interpret_markup (SCM paper, SCM props, SCM markup) if (gh_string_p (markup)) { String str = ly_scm2string (markup); - if (str.index_any (" \t\n\r") != -1) - { - /* Multi word string to line markup. */ - SCM proc= ly_scheme_function ("make-simple-markup"); - return interpret_markup (paper, props, scm_call_1 (proc, markup)); - } - - /* Simple word. */ + Paper_def *pap = unsmob_paper (paper); Font_metric *fm = select_font (pap, props); SCM lst = scm_list_n (ly_symbol2scm ("text"), markup, SCM_UNDEFINED); diff --git a/lily/vaticana-ligature.cc b/lily/vaticana-ligature.cc index 8d2d941b87..169be2404a 100644 --- a/lily/vaticana-ligature.cc +++ b/lily/vaticana-ligature.cc @@ -235,7 +235,7 @@ vaticana_brew_primitive (Grob *me, bool ledger_take_space) Real blotdiameter = (me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"))); - int pos = (int)rint (Staff_symbol_referencer::get_position (me)); + int pos = Staff_symbol_referencer::get_rounded_position (me); SCM delta_pitch_scm = me->get_property ("delta-pitch"); int delta_pitch; diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 39b56affab..e504cef998 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -19,8 +19,11 @@ "A simple text-string; @code{\\markup @{ foo @}} is equivalent with @code{\\markup @{ \\simple #\"foo\" @}}." (interpret-markup paper props - (make-line-markup - (map make-word-markup (string-tokenize str))))) + (make-word-markup str))) + +; todo: use font recoding. +; (make-line-markup +; (map make-word-markup (string-tokenize str))))) (define-public empty-markup (make-simple-markup ""))