From b9d041b950695f3681fabd6558e0680ecc5734a6 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 7 Jul 2002 16:23:33 +0000 Subject: [PATCH] (change-rhs-size): add support for "paper19.ly" --- ChangeLog | 2 ++ lily/spaceable-grob.cc | 19 ++++++++++++- ly/paper19.ly | 14 ++++++++++ mutopia/J.S.Bach/wtk1-fugue2.ly | 47 ++++++++++++++++++++++----------- scm/font.scm | 17 +++++++++--- 5 files changed, 79 insertions(+), 20 deletions(-) create mode 100644 ly/paper19.ly diff --git a/ChangeLog b/ChangeLog index 6210bb49ae..714be07669 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2002-07-07 Han-Wen + * scm/font.scm (change-rhs-size): add support for "paper19.ly" + * VERSION: 1.5.66 released * scm/grob-description.scm (all-grob-descriptions): add diff --git a/lily/spaceable-grob.cc b/lily/spaceable-grob.cc index 542838c7c1..4b684c6563 100644 --- a/lily/spaceable-grob.cc +++ b/lily/spaceable-grob.cc @@ -6,6 +6,8 @@ (c) 2000--2002 Han-Wen Nienhuys */ +#include +#include #include "spaceable-grob.hh" #include "grob.hh" @@ -24,6 +26,9 @@ Spaceable_grob::get_minimum_distances (Grob*me) void Spaceable_grob::add_rod (Grob *me , Grob * p, Real d) { + // printf ("rod %lf\n", d); + + SCM mins = get_minimum_distances (me); SCM newdist = gh_double2scm (d); for (SCM s = mins; gh_pair_p (s); s = ly_cdr (s)) @@ -44,13 +49,25 @@ Spaceable_grob::add_rod (Grob *me , Grob * p, Real d) void Spaceable_grob::add_spring (Grob*me, Grob * p, Real d, Real strength, bool expand_only) { - if (d < 0.0 || strength <= 0.0) + // printf ("dist %lf, str %lf\n", d, strength); + if (d <= 0.0 || strength <= 0.0) { programming_error ("Adding reverse spring! Setting to unit spring"); d = 1.0; strength = 1.0; } + if (isinf (d) || isnan(d) + || isnan (strength)) + { + /* + strength == INF is possible. It means fixed distance. + */ + programming_error ("Insane distance found."); + d = 1.0; + strength = 1.0; + } + #ifndef NDEBUG SCM mins = me->get_grob_property ("ideal-distances"); for (SCM s = mins; gh_pair_p (s); s = ly_cdr (s)) diff --git a/ly/paper19.ly b/ly/paper19.ly new file mode 100644 index 0000000000..5faac410f9 --- /dev/null +++ b/ly/paper19.ly @@ -0,0 +1,14 @@ +% paper20-init.ly + + +\version "1.5.49" + +paperNineteen = \paper { + staffheight = 19.0\pt + \stylesheet #(make-style-sheet 'paper19) + + \include "params-init.ly" +} + +\paper { \paperNineteen } + diff --git a/mutopia/J.S.Bach/wtk1-fugue2.ly b/mutopia/J.S.Bach/wtk1-fugue2.ly index 8cda734a5f..c9d437f6c2 100644 --- a/mutopia/J.S.Bach/wtk1-fugue2.ly +++ b/mutopia/J.S.Bach/wtk1-fugue2.ly @@ -20,27 +20,39 @@ ".\\\\Unrestricted modification and redistribution is permitted and encouraged---copy this music and share it.}" tagline = \mutopiapublicdomain - lastupdated = "2000/Feb/14" + lastupdated = "2002/July/7" + footer = "Mutopia-2002/07/07-6" + } -% It would be nice to squeeze this onto two pages, but I am not sure -% if it would work with US paper. +%{ + We really want this piece on 2 pages. + + tweaks: we use 19 iso. 20 pt staff space, and squeeze up the spacing a bit. + + the few forced linebreaks were an earlier attempt to get the spacing + to match up. + +%} + +\include "paper19.ly" +\version "1.5.65" + + -\version "1.3.146" - dux = \context Voice=two \notes \relative c''{ \voiceTwo \clef violin r8 c16 b c8 g as c16 b c8 d | g, c16 b c8 d f,16 g as4 g16 f | - es c' b a g f! es d c8 es' d c | + es c' b a g f! es d c8 es' d c | \break bes a bes c fis, g a fis | %%5 g4 r16 c, d es f g as8~ as16 d, es f | - g a bes8 ~ bes16 es, f g as g f es d8 c'16 b! | + g a bes8 ~ bes16 es, f g as g f es d8 c'16 b! | \break % forced accident! c4 r4 r8 f es d | r8 as g f g f16 es f8 d | @@ -63,13 +75,13 @@ dux = \context Voice=two \notes \relative c''{ d, g16 fis g8 a! c,16 d es4 d16 c | % forced accident! bes8 r8 r16 d e fis g a bes8 ~ bes16 e, f g | a bes c8 ~ c16 fis,16 g a bes8 es,!16 d es8 g, | + \break as f'16 es f8 a,8 bes g'16 f g8 b, | %%20 - c16 f \translator Staff = bass - \stemBoth \stemUp - es d c bes! as g + c16 f es d + \translator Staff = bass + c bes! as g f8 \translator Staff = treble - \stemBoth \stemDown as' g f | es d es f b, c d b | c4 r8 e8 f f16 e f8 c | @@ -89,6 +101,7 @@ dux = \context Voice=two \notes \relative c''{ comes = \context Voice=one \notes \relative c'' { \voiceOne + \property Voice.MultiMeasureRest \override #'staff-position = #6 R1 | R1 | r8 g'16 fis g8 c, es g16 fis g8 a | @@ -167,10 +180,9 @@ bassdux = \context Voice=three \notes \relative c' { f,16 g as4 g16 f es4 r8 es' | d c g' g, %%30 - \context Staff=bass < - { \voiceOne c2 ~ | c1 ~ | c1 } - \context Voice=four { \voiceTwo c,2 ~ | c1 ~ | c1 } - > + < { c2 ~ | c1 ~ | c1 } \\ + { c,2 ~ | c1 ~ | c1 } + > } \score { @@ -179,7 +191,6 @@ bassdux = \context Voice=three \notes \relative c' { \property Score.TimeSignature \override #'style = #'C \context Staff = treble < \key c \minor -% \key es \major \dux { \comes \bar "|." } \time 4/4 @@ -192,6 +203,10 @@ bassdux = \context Voice=three \notes \relative c' { \paper { linewidth = 18.0 \cm + \translator { \ScoreContext + SpacingSpanner \override #'spacing-increment = #1.0 + SpacingSpanner \override #'shortest-duration-space = #1.9 + } } \header{ opus = "BWV 847" diff --git a/scm/font.scm b/scm/font.scm index 8d9d722d54..f72a401b67 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -139,7 +139,6 @@ ((2 * * music 26) . "feta26") ((1 * * music 23) . "feta23") ((0 * * music 20) . "feta20") - ((-0.5 * * music 20) . "feta19") ((-1 * * music 16) . "feta16") ((-2 * * music 13) . "feta13") ((-3 * * music 11) . "feta11") @@ -148,7 +147,6 @@ ((2 * * ancient 26) . "parmesan26") ((1 * * ancient 23) . "parmesan23") ((0 * * ancient 20) . "parmesan20") - ((-0.5 * * ancient 20) . "parmesan19") ((-1 * * ancient 16) . "parmesan16") ((-2 * * ancient 13) . "parmesan13") ((-3 * * ancient 11) . "parmesan11") @@ -166,6 +164,13 @@ (cons (- (car font-desc) decrement) (cdr font-desc)) ) +(define (change-rhs-size font-desc from to ) + (cons (car font-desc) + (regexp-substitute/global #f from (cdr font-desc) 'pre to 'post)) + + ) + + ;; (define (map-alist-keys func list) "map a function FUNC over the keys of an alist LIST, leaving the vals. " @@ -196,13 +201,19 @@ '((paper11 . -3) (paper13 . -2) (paper16 . -1) - (paper19 . -0.5) (paper20 . 0) (paper23 . 1) (paper26 . 2) )) ) +(set! font-list-alist + (cons + (cons + 'paper19 + (map (lambda (x) (change-rhs-size x "20" "19")) + paper20-style-sheet-alist)) + font-list-alist)) (define (make-style-sheet sym) `((fonts . ,(append paper-style-sheet-alist -- 2.39.2