From 3900b4d5fef1533c83202e11fb7b0a787c2a174e Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 02:03:52 +0000 Subject: [PATCH] lilypond-1.5.19 --- input/regression/lyric_align.ly | 73 +++++++++++++++++++++++++++++++ lily/syllable-group.cc | 11 ++++- scm/grob-description.scm | 1 + scm/grob-property-description.scm | 3 +- scm/interface-description.scm | 4 +- 5 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 input/regression/lyric_align.ly diff --git a/input/regression/lyric_align.ly b/input/regression/lyric_align.ly new file mode 100644 index 0000000000..a660e4ce7e --- /dev/null +++ b/input/regression/lyric_align.ly @@ -0,0 +1,73 @@ +\version "1.3.146" +\header{ + texidoc="Lyric alignment + + Lyric alignment is adjustable both interms of alignment between stanzas and on notehead. + + If the property alignment is not set, there is automatic determination of alignment type based on punctuation. (ee lyric-phrasing.ly) + +" +} + +%\paper { linewidth = -1. } +\score { + \addlyrics + \context Voice = "v" \notes \relative c'' { + \property Staff.automaticMelismata = ##t + \cadenzaOn + a\breve \bar "||" a1 \bar "|" a \bar "|" a \bar "||" \break a \bar "|" a \bar "|" a \bar "|" a \bar "||" \break a \bar "|" a \bar "|." + } + \context Lyrics < + \context LyricsVoice = "v-1" \lyrics { +% \property LyricsVoice . stanza = "1:" + \property Lyrics . LyricText \override #'ignore-length-mismatch = ##t + \property Lyrics . LyricText \override #'alignment = #-1 + \property Lyrics . LyricText \override #'begin-alignment = #8 + + "Particularly useful for reciting notes " + left + + \property Lyrics . LyricText \override #'alignment = #0 + + centered + + \property Lyrics . LyricText \override #'alignment = #1 + + right + + \property Lyrics . LyricText \override #'alignment = #-1 + \property Lyrics . LyricText \override #'begin-alignment = #2 + + left_half_way + + \property Lyrics . LyricText \override #'begin-alignment = #4 + + left_one_quarter + + \property Lyrics . LyricText \override #'begin-alignment = #10 + + left_one_tenth + + \property Lyrics . LyricText \override #'begin-alignment = #1 + + left_one_whole + + \property Lyrics . LyricText \override #'ignore-length-mismatch = ##f + \property Lyrics . LyricText \override #'begin-alignment = #4 + + Very_short_lyrics_remain_in_touch_with_their_note + + \property Lyrics . LyricText \override #'alignment = #1 + \property Lyrics . LyricText \override #'end-alignment = #1.1 + \property Lyrics . LyricText \override #'ignore-length-mismatch = ##t + + + Unless_ignore-length-mismatch_is_true + + } + \context LyricsVoice = "v-2" \lyrics { +% \property LyricsVoice . stanza = "2:" + " with many syllables under them." l c r l l l x x x note' true' + } + > +} diff --git a/lily/syllable-group.cc b/lily/syllable-group.cc index 1dfbad8d98..84a3f7fa48 100644 --- a/lily/syllable-group.cc +++ b/lily/syllable-group.cc @@ -104,7 +104,7 @@ Syllable_group::set_lyric_align (const char *punc, Grob *default_notehead_l) Grob * lyric; alignment_i_ = appropriate_alignment (punc); - + // If there was no notehead in the matching voice context, use the first // notehead caught from any voice context (any port in a storm). if (!notehead_l_) { @@ -153,13 +153,20 @@ Syllable_group::amount_to_translate () /** determine what alignment we want. - Rules: if first_in_phrase_b_ is set, then alignment is LEFT. + Rules: if property alignment is set it specifies the alignment + if first_in_phrase_b_ is set, then alignment is LEFT. otherwise if each syllable ends in punctuation, then alignment is RIGHT otherwise alignment is centre. */ int Syllable_group::appropriate_alignment (const char *punc) { + + SCM s=this->longest_lyric_l_->get_grob_property ("alignment"); + if (s!=SCM_EOL) { + return gh_scm2int (s); + } + if (first_in_phrase_b_) return LEFT; diff --git a/scm/grob-description.scm b/scm/grob-description.scm index d5de3abb57..c47c7c9d82 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -29,6 +29,7 @@ (direction . -1) (left-padding . 0.2) (right-padding . 0.4) + (paren-cautionaries . #t) (meta . ,(grob-description accidentals-interface font-interface side-position-interface)) )) diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index 9de5556f70..1546486b5e 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -92,7 +92,7 @@ column as start/begin point. Only columns that have grobs or act as bounds are s (grob-property-description 'break-glyph-function procedure? "function taking glyph and break-direction, returning the glyph at a line break.") (grob-property-description 'breakable boolean? "boolean indicating if this is a breakable item (clef, barline, key sig, etc.).") (grob-property-description 'c0-position integer? "integer indicating the position of central C.") - +(grob-property-description 'cautionary-size integer? "size of cautionary accidentals (relative to size of accidentals)") (grob-property-description 'center-element ly-grob? "grob which will be at the center of the group after aligning (when using Align_interface::center_on_element). .") @@ -257,6 +257,7 @@ more than this (in staffspace).") (grob-property-description 'padding number? "add this much extra space between objects that are next to each other.") (grob-property-description 'parallel-beam boolean? "internal: true if there is a beam just as wide as the bracket .") +(grob-property-description 'paren-cautionaries boolean? "Whether to add parenthesis around cautionary accidentals.") (grob-property-description 'pitches list? "list of musical-pitch.") (grob-property-description 'porrectus-width number? "width of the porrectus ligature measured in staff space.") (grob-property-description 'raise number? "height for text to be raised (a negative value lowers the text.") diff --git a/scm/interface-description.scm b/scm/interface-description.scm index e0de47c3f8..8f64d30c3a 100644 --- a/scm/interface-description.scm +++ b/scm/interface-description.scm @@ -187,7 +187,9 @@ "Accidentals" '(accidentals left-padding - right-padding + right-padding + paren-cautionaries + cautionary-size )) -- 2.39.5