From 4ddff81cfd41557e5d0936326a7311f180125226 Mon Sep 17 00:00:00 2001 From: hanwen Date: Mon, 10 Oct 2005 10:40:59 +0000 Subject: [PATCH] * scm/lily.scm (define-scheme-options): add paper-size option. * ly/declarations-init.ly (laissezVibrer): get paper size from -dpaper-size * scm/translation-functions.scm: use \fontsize for changing the fontsize. * scm/define-grobs.scm (all-grob-descriptions): set between-length-limit to 1.0 * lily/tie-helper.cc: add between_length_limit_ detail property. --- ChangeLog | 15 +++++++++++++++ Documentation/topdocs/NEWS.tely | 4 ++++ lily/include/tie.hh | 4 +++- lily/tie-helper.cc | 18 ++++++++++++------ lily/tie.cc | 17 ++++++++++------- ly/declarations-init.ly | 3 +-- ly/paper-defaults.ly | 4 ---- scm/define-grobs.scm | 11 ++++++----- scm/lily.scm | 1 + scm/translation-functions.scm | 4 ++-- 10 files changed, 54 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index ec83f6b953..bddcc87f9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,20 @@ 2005-10-10 Han-Wen Nienhuys + * scm/lily.scm (define-scheme-options): add paper-size option. + + * ly/declarations-init.ly (laissezVibrer): get paper size from + -dpaper-size + + * scm/translation-functions.scm: use \fontsize for changing the + fontsize. + + * scm/define-grobs.scm (all-grob-descriptions): set + between-length-limit to 1.0 + + * lily/tie-helper.cc: add between_length_limit_ detail property. + + * mf/feta-bolletjes.mf: typos. + * lily/note-head.cc (internal_print): don't shadow idx parameter. This fixes wrong attachment for do shape heads. diff --git a/Documentation/topdocs/NEWS.tely b/Documentation/topdocs/NEWS.tely index 7a3492b583..ab905d0179 100644 --- a/Documentation/topdocs/NEWS.tely +++ b/Documentation/topdocs/NEWS.tely @@ -45,6 +45,10 @@ This document is also available in @uref{NEWS.pdf,PDF}. @itemize @bullet +@item +The default paper size may now be set from the command line using +@code{-dpaper-size}. + @item Beamlets may stick out of the side of beams. diff --git a/lily/include/tie.hh b/lily/include/tie.hh index 80501acf30..6ea8f653b2 100644 --- a/lily/include/tie.hh +++ b/lily/include/tie.hh @@ -25,6 +25,7 @@ struct Tie_details Real ratio_; Real staff_space_; Real x_gap_; + Real between_length_limit_; Tie_details (); void init (Grob *); @@ -76,7 +77,8 @@ public: Grob *const &s2); static Interval get_default_attachments (Spanner *me, Grob *common, Real gap, - int *staff_position, bool *in_between); + int *staff_position, bool *in_between, + Tie_details const &); }; diff --git a/lily/tie-helper.cc b/lily/tie-helper.cc index eba02de16c..58dbac8ac2 100644 --- a/lily/tie-helper.cc +++ b/lily/tie-helper.cc @@ -85,19 +85,25 @@ Tie_configuration::height (Tie_details const &details) const } + void Tie_details::init (Grob *me) { staff_space_ = Staff_symbol_referencer::staff_space (me); SCM details = me->get_property ("details"); - SCM limit - = scm_assq (ly_symbol2scm ("height-limit"), details); - height_limit_ = robust_scm2double (scm_cdr (limit), 0.75) * staff_space_; - ratio_ = robust_scm2double (scm_cdr (scm_assq (ly_symbol2scm ("ratio"), details)), - .333); - x_gap_ = robust_scm2double (me->get_property ("x-gap"), 0.2); + height_limit_ = robust_scm2double (ly_assoc_get (ly_symbol2scm ("height-limit"), details, SCM_EOL), + 0.75) * staff_space_; + + ratio_ = robust_scm2double (ly_assoc_get (ly_symbol2scm ("ratio"), details, SCM_EOL), + .333); + + x_gap_ = robust_scm2double (me->get_property ("x-gap"), 0.2); + between_length_limit_ + = robust_scm2double (ly_assoc_get (ly_symbol2scm ("between-length-limit"), details, SCM_EOL), + 1.0); + } Tie_details::Tie_details () diff --git a/lily/tie.cc b/lily/tie.cc index ee2af5fb0b..78501ef7f7 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -111,7 +111,8 @@ Tie::set_direction (Grob *me) Interval Tie::get_default_attachments (Spanner *me, Grob *common, Real gap, int *staff_position, - bool *in_between + bool *in_between, + Tie_details const &details ) { Real staff_space = Staff_symbol_referencer::staff_space (me); @@ -128,7 +129,7 @@ Tie::get_default_attachments (Spanner *me, Grob *common, Real gap, } while (flip (&d) != LEFT); - if (attachments.length () < 0.6 * staff_space) + if (attachments.length () < details.between_length_limit_ * staff_space) { /* Let short ties start over note heads, instead of between. @@ -206,7 +207,6 @@ Tie::get_configuration (Grob *me_grob, Grob *common, conf->dir_ = get_grob_direction (me); if (!conf->dir_) conf->dir_ = get_default_dir (me); - Real staff_space = details.staff_space_; bool in_between = true; @@ -216,8 +216,8 @@ Tie::get_configuration (Grob *me_grob, Grob *common, { if (!skylines) conf->attachment_x_ = get_default_attachments (me, common, gap, - &conf->position_, - &in_between); + &conf->position_, + &in_between, details); else { Real y = staff_space * 0.5 * conf->position_; @@ -326,7 +326,8 @@ Tie::get_configuration (Grob *me_grob, Grob *common, if (conf->position_ == conf->head_position_ && in_space && Staff_symbol_referencer::staff_radius (me) > abs (conf->position_) / 2 - && dy > 0.3 * staff_space) + && dy > 0.3 * staff_space + ) { conf->position_ += 2 * conf->dir_; } @@ -500,7 +501,9 @@ Tie::print (SCM smob) ADD_INTERFACE (Tie, "tie-interface", - "A tie connecting two noteheads.\n", + "A tie connecting two noteheads. \n\n" + , + /* properties */ "control-points " diff --git a/ly/declarations-init.ly b/ly/declarations-init.ly index 60e8fbabe0..a8580c98a4 100644 --- a/ly/declarations-init.ly +++ b/ly/declarations-init.ly @@ -85,8 +85,7 @@ laissezVibrer = #(make-music 'LaissezVibrerEvent) } - -#(set-default-paper-size "a4") +#(set-default-paper-size (ly:get-option 'paper-size)) partCombineListener = \layout { diff --git a/ly/paper-defaults.ly b/ly/paper-defaults.ly index 11ded37f58..adc879efca 100644 --- a/ly/paper-defaults.ly +++ b/ly/paper-defaults.ly @@ -66,10 +66,6 @@ %% raggedlastbottom= ##t - %% ugh. Should use /etc/papersize and set explicitly for - %% documentation. - papersizename = "a4" - #(define font-defaults '((font-encoding . fetaMusic))) diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 40ab72ddfa..96de6cb512 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -208,7 +208,6 @@ (NewBassFigure . ( (print-function . ,Text_interface::print) - (font-size . -2) (meta . ((class . Item) (interfaces . (text-interface rhythmic-grob-interface @@ -1498,12 +1497,14 @@ font-interface)))))) (Tie - . ( - (print-function . ,Tie::print) - (details . ((ratio . 0.333) (height-limit . 1.0))) + . ((print-function . ,Tie::print) + (details . ((ratio . 0.333) + (height-limit . 1.0) + (between-length-limit . 1.0))) (thickness . 1.0) (meta . ((class . Spanner) - (interfaces . (tie-interface)))))) + (interfaces . (tie-interface)))) + )) (TieColumn . ( diff --git a/scm/lily.scm b/scm/lily.scm index 593daa2cac..cf1e1082cf 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -11,6 +11,7 @@ (ly:add-option (car x) (cadr x) (caddr x))) '((point-and-click #t "use point & click") + (paper-size "a4" "the default paper size") (midi-debug #f "generate human readable MIDI") (internal-type-checking #f "check every property assignment for types") (parse-protect #t "continue when finding errors in inline diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm index 5c8fe4bf0b..aa536c2e5c 100644 --- a/scm/translation-functions.scm +++ b/scm/translation-functions.scm @@ -99,7 +99,7 @@ #:pad-x 0.2 alt-markup ))) - (if (markup? fig-markup) - fig-markup + (if (markup? fig-markup) + (markup #:fontsize -2 fig-markup) empty-markup))) -- 2.39.5