From b60c79d8b8e10cab3837be98c9770a42cfbeb335 Mon Sep 17 00:00:00 2001 From: hanwen Date: Fri, 29 Mar 2002 01:07:09 +0000 Subject: [PATCH] '' --- ChangeLog | 18 ++++++++++++ Documentation/regression-test.tely | 4 +++ input/mozart-hrn-3.ly | 1 + input/mozart-hrn3-allegro.ly | 9 +++--- input/mozart-hrn3-rondo.ly | 10 +++---- input/regression/spacing-note-flags.ly | 17 ++++++++++++ input/regression/spacing-rest.ly | 15 ++++++++++ lily/multi-measure-rest.cc | 3 +- lily/note-spacing.cc | 38 +++++++++++++++++++++----- lily/spacing-spanner.cc | 9 ++++-- lily/stem.cc | 9 ------ mf/feta-banier.mf | 20 ++++++++------ mf/feta-eindelijk.mf | 30 ++++++++++---------- mf/feta-generic.mf | 4 +-- mf/feta-schrift.mf | 18 +++++++----- mf/feta-toevallig.mf | 2 +- scm/grob-description.scm | 4 --- 17 files changed, 144 insertions(+), 67 deletions(-) create mode 100644 input/regression/spacing-note-flags.ly create mode 100644 input/regression/spacing-rest.ly diff --git a/ChangeLog b/ChangeLog index f08663ac0d..c8d2c85064 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2002-03-29 Han-Wen + + * input/regression/spacing-note-flags.ly: new file + + * input/regression/spacing-rest.ly: new file + + * mf/feta-eindelijk.mf: make bbox of quarter rest tighter. + + * lily/spacing-spanner.cc (note_spacing): make note spacing after + all grace notes tight (not only the column directly following a + grace note). + + * scm/grob-description.scm (all-grob-descriptions): don't make + mm-rests larger than normal. + + * mf/feta-banier.mf: make upflag narrower. Make end of flag more + curved. Remove white space at the right of flags. + 2002-03-28 Jan Nieuwenhuizen * ports/ports.make: Bugfix: ignore CVS directories. diff --git a/Documentation/regression-test.tely b/Documentation/regression-test.tely index 4b1531f563..141cbd18b5 100644 --- a/Documentation/regression-test.tely +++ b/Documentation/regression-test.tely @@ -255,6 +255,10 @@ Grace note do weird things with timing. Fragile. @lilypondfile[printfilename]{spacing-individual-tuning.ly} +@lilypondfile[printfilename]{spacing-note-flags.ly} + +@lilypondfile[printfilename]{spacing-rest.ly} + @lilypondfile[printfilename]{lyrics-bar.ly} @lilypondfile[printfilename]{spacing-knee.ly} diff --git a/input/mozart-hrn-3.ly b/input/mozart-hrn-3.ly index 9c2fc28ff6..6543c0813d 100644 --- a/input/mozart-hrn-3.ly +++ b/input/mozart-hrn-3.ly @@ -43,6 +43,7 @@ ritenuto = \textscript #'(italic "rit.") skipBars = ##t midiInstrument = #"french horn" RehearsalMark \override #'font-series = #'bold + Stem \override #'thickness = #1.3 } \translator { \StaffContext MinimumVerticalExtent = #'(-4.5 . 4.5) diff --git a/input/mozart-hrn3-allegro.ly b/input/mozart-hrn3-allegro.ly index 7c4de9cc58..fcead2faa7 100644 --- a/input/mozart-hrn3-allegro.ly +++ b/input/mozart-hrn3-allegro.ly @@ -55,7 +55,8 @@ allegro = d4. [e16 fis] [g () fis e d] [c() b a g] \endcresc < a1(-\trill - { s2. \grace{ [g16 a] } } > +1 { s2 \grace{ [g16 a] } } > + \mark "C" )g4 r r2 R1*15 \mark "D" @@ -125,7 +126,7 @@ allegro = [c (e] )g2 \grace { \longgrace f16( \endlonggrace } [)e8( d16 )c] < d1-\trill ( - { s2. \grace { [c16 d] } } > + { s2 \grace { [c16 d] } } > ) c4 r r2 R1 | @@ -137,11 +138,11 @@ allegro = g4 r8 g'\f [a b c d]| < d1(-\trill - { s2. \grace { [c16 d] } } > + { s2 \grace { [c16 d] } } > )c4 r r2 R1*3 - c4._"Cadenza ad lib." () d8 d4.-\trill ( [c16 )d] + c4.^\fermata_"Cadenza ad lib." () d8 d4.-\trill^\fermata ( [c16 )d] c4 r r2 R1*8 r4 [c8.^"tutti"-\f c16] c4 c diff --git a/input/mozart-hrn3-rondo.ly b/input/mozart-hrn3-rondo.ly index 8f2c175473..5aee2407f1 100644 --- a/input/mozart-hrn3-rondo.ly +++ b/input/mozart-hrn3-rondo.ly @@ -76,7 +76,7 @@ rondo = \notes \relative c' [b () e d] [c b a] \mark "C" g4 r8 r4 r8 - r2. | + R2. | % r8 [g g] [g( )b b] [b()d d-.] [d()g g-.] @@ -102,7 +102,7 @@ rondo = \notes \relative c' r4 r8 r4 c'8 b4()c8 b4()c8 bes4. ~ bes4 g8 - a4 c8 [f () d b] + a4 c8 [f () d b!] d4. () c8 r r \mark "E" R2.*9 | @@ -110,11 +110,11 @@ rondo = \notes \relative c' [c8 c' c] c4.~ [c8 c d] [e e fis] g4 r8 r4 r8 - r2. + R2. r8 [g, g] [g g g] | es'4. ~ [es8 d c] b4 r8 r4 r8 - r2. | + R2. | r8 [g g] [g g g] es'4. ~ [es8 d c] \cresc b4. c4. d4. e4. @@ -155,7 +155,7 @@ rondo = \notes \relative c' )c4 r8 r4 r8 R2.*5 - r8 r8-\fermata d8\p [d e f] + r8 r8^\fermata d8\p [d e f] [g ()e c] [d()e d] \cresc [c c c] [d e f] [g()e c] [d()e d] diff --git a/input/regression/spacing-note-flags.ly b/input/regression/spacing-note-flags.ly new file mode 100644 index 0000000000..a558cd4554 --- /dev/null +++ b/input/regression/spacing-note-flags.ly @@ -0,0 +1,17 @@ +\header { + +texidoc = "The flags of 8th notes take some space, but not + too much: the space following a flag is less than the space + following a beamed 8th head" + +} + +\score { \notes \relative c'' \context Staff { + \property Voice.noAutoBeaming = ##t + [a8 a8 a8 a8] a8 a8 a8 a8 +} +\paper { +%stafflinethickness = 0.0 +linewidth = -1 + } + } diff --git a/input/regression/spacing-rest.ly b/input/regression/spacing-rest.ly new file mode 100644 index 0000000000..a5aee6cbee --- /dev/null +++ b/input/regression/spacing-rest.ly @@ -0,0 +1,15 @@ +\header { + texidoc = "Rests get a little less space, since they are narrower. +However, the feta quarter rest is relatively wide, causing this effect to be +very small. +" + } +\score { \notes \relative c'' \context Staff { + \time 12/4 + r4 c4 c4 c4 r4 r4 c4 +} +\paper { +%stafflinethickness = 0.0 +linewidth = -1 + } + } diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index d3f9e81221..1549cf727c 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -327,7 +327,6 @@ ADD_INTERFACE (Multi_measure_rest,"multi-measure-rest-interface", "A rest that spans a whole number of measures. For typesetting the numbers, fields from font-interface may be used. -padding is the space between number and rest. Measured in staffspace. ", - "thickness measure-count expand-limit padding"); + "thickness measure-count expand-limit"); diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc index cd05e16f5b..9126fc728a 100644 --- a/lily/note-spacing.cc +++ b/lily/note-spacing.cc @@ -34,17 +34,19 @@ Note_spacing::get_spacing (Grob *me, Item* right_col, Direction d = LEFT; Direction col_dir = right_col->break_status_dir (); Drul_array extents; + + Interval left_head_wid; do { for (SCM s = props[d]; gh_pair_p (s); s = gh_cdr (s)) { Item * it= dynamic_cast (unsmob_grob (gh_car(s))); - + if (d == RIGHT && it->break_status_dir () != col_dir) { it = it -> find_prebroken_piece (col_dir); - } + } /* some kind of mismatch, eg. a note column, that is behind a linebreak. @@ -52,7 +54,8 @@ Note_spacing::get_spacing (Grob *me, Item* right_col, if (!it) continue; - if (d == RIGHT && right_col != it->column_l ()) + Item *it_col = it->column_l (); + if (d == RIGHT && right_col != it_col) continue; if (Separation_item::has_interface (it)) @@ -60,8 +63,19 @@ Note_spacing::get_spacing (Grob *me, Item* right_col, extents[d].unite (Separation_item::my_width (it)); continue; } + + if (d == LEFT) + { + SCM r = it->get_grob_property ("rest"); + Grob * g = unsmob_grob (r); + if (!g) + g = Note_column::first_head (it); + + if (g) + left_head_wid = g->extent(it_col, X_AXIS); + } - extents[d].unite (it->extent (it->column_l (), X_AXIS)); + extents[d].unite (it->extent (it_col, X_AXIS)); if (d == RIGHT) { Grob * accs = Note_column::accidentals (it); @@ -69,7 +83,7 @@ Note_spacing::get_spacing (Grob *me, Item* right_col, accs = Note_column::accidentals (it->get_parent (X_AXIS)); if (accs) - extents[d].unite (accs->extent (it->column_l (), X_AXIS)); + extents[d].unite (accs->extent (it_col, X_AXIS)); } } @@ -78,8 +92,18 @@ Note_spacing::get_spacing (Grob *me, Item* right_col, } while (flip (&d) != LEFT); - *fixed = (extents[LEFT][RIGHT] >? increment); - *space = (base_space - increment) + *fixed ; + + /* + We look at the width of the note head, since smaller heads get less space + eg. a quarter rest gets almost 0.5 ss less horizontal space than a note. + + What is sticking out of the note head (eg. a flag), doesn't get + the full amount of space. + */ + *fixed = left_head_wid.empty_b () ? increment : left_head_wid[RIGHT]; + *space = (base_space - increment) + *fixed + + (extents[LEFT][RIGHT] - left_head_wid[RIGHT])/ 2; + ; if (*space - *fixed < 2 * ((- extents[RIGHT][LEFT]) >? 0)) { diff --git a/lily/spacing-spanner.cc b/lily/spacing-spanner.cc index 674681f44f..fd9585f135 100644 --- a/lily/spacing-spanner.cc +++ b/lily/spacing-spanner.cc @@ -700,11 +700,14 @@ Spacing_spanner::note_spacing (Grob*me, Grob *lc, Grob *rc, programming_error ("can't find a ruling note at " + Paper_column::when_mom (lc).str ()); shortest_playing_len = 1; } - - Moment delta_t = Paper_column::when_mom (rc) - Paper_column::when_mom (lc); + + Moment lwhen = Paper_column::when_mom (lc); + Moment rwhen = Paper_column::when_mom (rc); + + Moment delta_t = rwhen - lwhen; Real dist = 0.0; - if (delta_t.main_part_) + if (delta_t.main_part_ && !lwhen.grace_part_) { dist = get_duration_space (me, shortest_playing_len, shortest.main_part_, expand_only); dist *= (double) (delta_t.main_part_ / shortest_playing_len.main_part_); diff --git a/lily/stem.cc b/lily/stem.cc index 91fe78c888..79823a1092 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -229,15 +229,6 @@ Stem::add_head (Grob*me, Grob *n) { Pointer_group_interface::add_grob (me, ly_symbol2scm ("heads"), n); } - else - { - /* - Apparently, this is never used. - */ -#if 0 - me->set_grob_property ("rest", n->self_scm ()); -#endif - } } bool diff --git a/mf/feta-banier.mf b/mf/feta-banier.mf index 93ab0682f1..d15a6b7cf0 100644 --- a/mf/feta-banier.mf +++ b/mf/feta-banier.mf @@ -5,13 +5,14 @@ fet_begingroup("flags") save outer_path; path outer_path; + % Flags pointing down overlap with the notehead (in x-direction), so % the down-flag can be bigger -upflag_width# = .750 black_notehead_width# + stemthickness#/2; +upflag_width# = .650 black_notehead_width# + stemthickness#/2; downflag_width# = .833 black_notehead_width# + stemthickness#/2; -right_upflag_space# = .2 upflag_width#; -right_downflag_space# = .2 downflag_width#; +right_upflag_space# = .0 upflag_width#; +right_downflag_space# = .0 downflag_width#; % % Flags pointing down cannot overlap with the notehead in y-direction, @@ -25,7 +26,7 @@ right_downflag_space# = .2 downflag_width#; save hip_thickness, foot_thickness; hip_thickness# = 1.3 stemthickness#; -foot_thickness# = hip_thickness#; +foot_thickness# = 1.0 hip_thickness#; % % Inspired by Adobe Sonata and [Wanske] @@ -35,22 +36,23 @@ foot_thickness# = hip_thickness#; def draw_flag(expr center, flare, dims, hip_depth, foot_wid, hip_thickness, foot_thickness)= clearxy; - + save c ; + c = 0.7; penpos1(flare, 90); penpos2(whatever, 0); x2r - x2l = hip_thickness; - penpos3(foot_thickness, 0) ; + penpos3(foot_thickness, 0.0) ; z1r = center; z2r = center + (xpart dims, -ypart(dims) * hip_depth); z3r = center + (xpart(dims) * foot_wid, -ypart dims); - outer_path := z3r{curl 0} .. z2r{up} .. {up}z1r; + outer_path := z3r{curl c} .. z2r{up} .. {up}z1r; penlabels(1, 2, 3); fill z1l{curl 0} ..tension 1.1 .. z2l{down} .. - {curl 0} simple_serif(z3l, z3r, 80) & + {curl c} simple_serif(z3l, z3r, 80) & outer_path & z1r -- cycle; enddef; @@ -107,7 +109,7 @@ fet_beginchar("8th Flag (up)", "u3", "eighthflag") foot_depth# = 3 staff_space#; set_char_box(stemthickness# /2, hip_width# - + stemthickness#/2 + right_upflag_space#, + + stemthickness#/2 + right_upflag_space#, foot_depth# + foot_thickness#/2, stemthickness#/2) define_pixels(flare, hip_width, hip_thickness, diff --git a/mf/feta-eindelijk.mf b/mf/feta-eindelijk.mf index 2a3bb4fa77..e2709e6d38 100644 --- a/mf/feta-eindelijk.mf +++ b/mf/feta-eindelijk.mf @@ -38,6 +38,10 @@ ball_crook_balldiam =flare; save block_rest_y, block_rest_x; +save breve_rest_y, breve_rest_x; + +breve_rest_y# = staff_space#; +breve_rest_x# = 3/5 staff_space#; block_rest_y# = 5/8 staff_space#; block_rest_x# = 3/2 staff_space#; @@ -88,21 +92,18 @@ fet_beginchar("half rest (outside staff)", "1o", "outsidehalfrest"); fet_endchar; -save breve_rest_y, breve_rest_x; - -breve_rest_y# = staff_space#; -breve_rest_x# = 3/5 staff_space#; define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_beam_height); -fet_beginchar("breve rest", "-1", "breverest"); - set_char_box(0, breve_rest_x#, 0, breve_rest_y#); - draw_block ((0,0), (breve_rest_x, breve_rest_y)); -fet_endchar; fet_beginchar("longa rest", "-2", "longarest"); set_char_box(0, breve_rest_x#, breve_rest_y#, breve_rest_y#); - draw_block ((0,-breve_rest_y), (breve_rest_x, breve_rest_y)); + draw_block ((0,-floor (breve_rest_y)), (breve_rest_x, floor (breve_rest_y))); +fet_endchar; + +fet_beginchar("breve rest", "-1", "breverest"); + set_char_box(0, breve_rest_x#, 0, breve_rest_y#); + draw_block ((0,0), (breve_rest_x, floor (breve_rest_y))); fet_endchar; tracingvariables := 1; @@ -114,9 +115,10 @@ fet_beginchar("Quarter rest","2","quartrest"); yshift# = -1.25 staff_space#; height# = 2.8125 staff_space#; define_pixels (yshift, height); - + save xcenter; + xcenter = -0.1 staff_space; - set_char_box(0, 27/25staff_space#, + set_char_box(0, 0.95 staff_space#, -yshift#, yshift# + height#); @@ -141,15 +143,15 @@ fet_beginchar("Quarter rest","2","quartrest"); z13=z2r+1/2rthin*ne+1/2rthin*nw; y1r = h; - x1l=1/3staff_space; + x1l=xcenter + 1/3staff_space; z2r=z1+staff_space*se; z3=1/2[z2,z4]; - x4=3/8staff_space; + x4= xcenter + 3/8staff_space; y4= 0; z5=z4l+1.3staff_space*se; x6l=x4l; y6l=y4r; - x7=2/5staff_space; + x7= xcenter + 2/5staff_space; y7= -d; fill z1l{se}..{se}z10..z3l..z11{se}..{se}z5l..z5r{nw}..{nw}z12..z3r..z13{nw}..{nw}z1r.. cycle; diff --git a/mf/feta-generic.mf b/mf/feta-generic.mf index b00d089e27..a670f71942 100644 --- a/mf/feta-generic.mf +++ b/mf/feta-generic.mf @@ -39,8 +39,8 @@ if test = 0: input feta-solfa; else: -% input feta-bolletjes; -% input feta-banier; + input feta-bolletjes; + input feta-banier; % input feta-eindelijk; % input feta-klef; % input feta-toevallig; diff --git a/mf/feta-schrift.mf b/mf/feta-schrift.mf index 98ade6dbf9..1d6c1e6851 100644 --- a/mf/feta-schrift.mf +++ b/mf/feta-schrift.mf @@ -166,7 +166,7 @@ fet_endchar; fet_beginchar("portato/single tenuto", "tenuto", "tenuto") save thick; - thick# = 1.4 stafflinethickness#; + thick# = 1.6 stafflinethickness#; define_whole_pixels(thick); set_char_box(.6 staff_space#, .6 staff_space#, thick#/2,thick#/2); @@ -452,16 +452,20 @@ fet_beginchar("Trill (`tr')","trill","trill") currenttransform := currenttransform slanted slant shifted (- staff_space, 0) ; y1 = ascender; - x1l = 0; - x1r = t_fatness; + + % try to position in such a way that the center is the visual + % center + + x1l = 0.2 staff_space; + x1r - x1l = t_fatness; penpos1(start_nib_wid, start_nib_angle); z2 = (x1, 7/18 ex); penpos2(start_nib_wid, start_nib_angle); - z3l = (0.5 t_width, - t_overshoot); + z3l = (x2l + 0.5 t_width, - t_overshoot); - z4l = (t_width, 0.23 ex); + z4l = (x2l + t_width, 0.23 ex); penpos4(whatever, 200); x4l - x4r = hair_thick; @@ -473,7 +477,7 @@ fet_beginchar("Trill (`tr')","trill","trill") save t_p, krul_p; path t_p, krul_p, r_p; - z5 = (t_fatness/2, 2/3 ex); + z5 = (x2l + t_fatness/2, 2/3 ex); % penpos5(hair_thick, ); t_p := z1r{dir (angle(z1l-z1r) + 30)} .. z1l{-dir (angle(z1r-z1l) - 45)} @@ -491,7 +495,7 @@ fet_beginchar("Trill (`tr')","trill","trill") pickup pencircle scaled hair_thick; - lft x6 = - uitschieter; + lft x6 = x2l - uitschieter; y6 = y5 ; % - 1/20 ex; z7 = z5 + whatever*dir krul_ang; diff --git a/mf/feta-toevallig.mf b/mf/feta-toevallig.mf index cd57e956fe..4d6dd61996 100644 --- a/mf/feta-toevallig.mf +++ b/mf/feta-toevallig.mf @@ -96,7 +96,7 @@ fet_beginchar("Sharp" , "1", "sharp"); % fet_beginchar( "Natural", "0", "natural") - save height; + save height, xcenter; save interbeam, interstem, beamheight, beamwidth, stemwidth; save top_stem_thick; diff --git a/scm/grob-description.scm b/scm/grob-description.scm index 72438a926d..6425e2e749 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -246,7 +246,6 @@ (molecule-callback . ,Text_item::brew_molecule) (X-offset-callbacks . (,Side_position_interface::aligned_on_self)) (self-alignment-X . 0) - (no-spacing-rods . #t) (script-priority . 100) (font-series . bold) @@ -433,11 +432,8 @@ (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) (staff-position . 0) (expand-limit . 10) - (width . 5.5) (thickness . 6.6) - (padding . 1.5) ; staffspace (font-family . number) - (font-relative-size . 1) (meta . ((interfaces . (multi-measure-rest-interface rest-interface font-interface staff-symbol-referencer-interface)))) )) -- 2.39.5