From 9a3f383f778c0423da192cf267d326c9c459feb9 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 21 Apr 2005 15:59:44 +0000 Subject: [PATCH] * input/regression/grid-lines.ly (skips): refine example. * scm/define-context-properties.scm (all-user-translation-properties): doc autoBeamCheck * input/regression/grid-lines.ly (Module): new file. * lily/grid-line-interface.cc (Module): new file. --- ChangeLog | 5 +++++ Documentation/topdocs/NEWS.tely | 3 +++ input/regression/grid-lines.ly | 29 ++++++++++++++++++++++++----- lily/grid-line-interface.cc | 20 ++++++++++++++++++++ scm/define-context-properties.scm | 8 +++++--- scm/define-grobs.scm | 3 +-- scm/define-markup-commands.scm | 2 ++ 7 files changed, 60 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index b2cee1c5b8..82043c7421 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2005-04-21 Han-Wen Nienhuys + * input/regression/grid-lines.ly (skips): refine example. + + * scm/define-context-properties.scm + (all-user-translation-properties): doc autoBeamCheck + * input/regression/grid-lines.ly (Module): new file. * lily/grid-point-engraver.cc (Module): new file diff --git a/Documentation/topdocs/NEWS.tely b/Documentation/topdocs/NEWS.tely index ba7b855b6e..a100911c75 100644 --- a/Documentation/topdocs/NEWS.tely +++ b/Documentation/topdocs/NEWS.tely @@ -33,6 +33,9 @@ See user manual, \NAME\ @itemize @bullet +@item +Grid lines + @item Lines, such as glissandi or Text-spanner lines, can have arrows at the end, e.g. diff --git a/input/regression/grid-lines.ly b/input/regression/grid-lines.ly index 05279d4b55..e6b5a1dc4a 100644 --- a/input/regression/grid-lines.ly +++ b/input/regression/grid-lines.ly @@ -48,6 +48,9 @@ skips = } } +\layout { + raggedright = ##t +} \new Score \with { \consists "Grid_line_span_engraver" @@ -55,14 +58,30 @@ skips = \override TimeSignature #'transparent = ##t \override NoteColumn #'X-offset-callbacks = #(list (lambda (x a) -0.5)) - \override NoteColumn #'Y-offset-callbacks = #(list (lambda (x a) 0.25)) + \override NoteHead #'Y-offset-callbacks = #(list (lambda (x a) 0.75)) } \new StaffGroup << - \new Staff { - \repeat unfold 12 { c''8 } + \new RhythmicStaff \with + { + \override NoteHead #'no-ledgers = ##t + } + { + \stemUp + c4. c8 c8 c c4 c8 c8.[ c16 c8] + } + \new RhythmicStaff + { + \override NoteHead #'transparent = ##t + \override NoteHead #'no-ledgers = ##t + \override Stem #'transparent = ##t + \override Beam #'transparent = ##t + << \skips + + % force regular spacing by introducing notes. + \repeat unfold 12 c8 + >> } - \new RhythmicStaff \skips - \new RhythmicStaff \skips + >> diff --git a/lily/grid-line-interface.cc b/lily/grid-line-interface.cc index 47d8b58587..c721190e0e 100644 --- a/lily/grid-line-interface.cc +++ b/lily/grid-line-interface.cc @@ -51,6 +51,21 @@ Grid_line_interface::print (SCM smobbed_me) return st.smobbed_copy (); } +MAKE_SCHEME_CALLBACK (Grid_line_interface, width_callback, 2); +SCM +Grid_line_interface::width_callback (SCM element_smob, SCM scm_axis) +{ + Grob *me = unsmob_grob (element_smob); + (void) scm_axis; + assert (scm_to_int (scm_axis) == X_AXIS); + + Real staffline = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness")); + Real thick = robust_scm2double (me->get_property ("thickness"), 1.0) + * staffline; + + return ly_interval2scm (Interval (0, thick)); +} + void Grid_line_interface::add_grid_point (Grob *me, Grob *b) { @@ -62,3 +77,8 @@ ADD_INTERFACE (Grid_line_interface, "grid-line-interface", "A line that spanned between grid-points. ", "elements thickness"); + +ADD_INTERFACE (Grid_point_interface, "grid-point-interface", + "A spanning point for grid lines. ", + ""); + diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index 497d0d6e9f..c6ad8a828e 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -72,6 +72,8 @@ immediately, and if @var{laziness} is @code{#t} then the accidental lasts forever. @end table ") + (autoBeamCheck ,procedure? "Routine taking two arguments, +start/stop (-1 or 1) and shortest note in the beam.") (autoBeaming ,boolean? "If set to true then beams are generated automatically.") @@ -86,7 +88,7 @@ printed automatically; they must be explicitly created with are still counted. Bar generation will resume according to that count if this property is unset. ") - + (barAlways ,boolean? "If set to true a bar line is drawn after each note.") @@ -210,6 +212,8 @@ fingered.") (forceClef ,boolean? "Show clef symbol, even if it has not changed. Only active for the first clef after the property is set, not for the full staff.") + (gridInterval ,ly:moment? + "Interval for which to generate @ref{GridPoint}s") (harmonicAccidentals ,boolean? "If set, harmonic notes in chords get accidentals.") @@ -453,8 +457,6 @@ top of those automatically detected. ") (graceSettings ,list? "Overrides for grace notes. This property should be manipulated through the @code{add-grace-property} function.") - (gridInterval ,ly:moment? - "Interval for which to generate @ref{GridPoint}s") (currentCommandColumn ,ly:grob? "Grob that is X-parent to all current breakable (clef, key signature, etc.) items.") (currentMusicalColumn ,ly:grob? "Grob that is X-parent to all diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index d00feae8cd..2df163e93f 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -507,12 +507,11 @@ (GridLine . ( (print-function . ,Grid_line_interface::print) - (X-extent . (0 . 0)) + (X-extent-callback . ,Grid_line_interface::width_callback) (layer . 0) (meta . ((interfaces . (grid-line-interface))) ))) - (Hairpin . ( (print-function . ,Hairpin::print) diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 561514f1f3..09364bcc74 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -304,6 +304,8 @@ This will enlarge the B and the C by two steps. (prepend-alist-chain 'font-size mag props) arg)) + +;; FIXME -> should convert to font-size. (def-markup-command (magnify layout props sz arg) (number? markup?) "Set the font magnification for the its argument. In the following example, the middle A will be 10% larger: -- 2.39.2