]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.5.19
authorfred <fred>
Wed, 27 Mar 2002 02:03:52 +0000 (02:03 +0000)
committerfred <fred>
Wed, 27 Mar 2002 02:03:52 +0000 (02:03 +0000)
input/regression/lyric_align.ly [new file with mode: 0644]
lily/syllable-group.cc
scm/grob-description.scm
scm/grob-property-description.scm
scm/interface-description.scm

diff --git a/input/regression/lyric_align.ly b/input/regression/lyric_align.ly
new file mode 100644 (file)
index 0000000..a660e4c
--- /dev/null
@@ -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'
+      }
+   >
+}
index 1dfbad8d9850e4e12849893cb6d67e555be386ea..84a3f7fa485785e51d4f6325aa184d15e3dd1982 100644 (file)
@@ -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;
 
index d5de3abb57a5e3af6e351345f0bea24439c1a20f..c47c7c9d82eb114120c3b2816a1518a898b01f01 100644 (file)
@@ -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))
        ))
 
index 9de5556f708765744d30acd3c7c6452cebaa4df8..1546486b5e75a1a251d05c4beff4f09dc09051cb 100644 (file)
@@ -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.")
index e0de47c3f899f73e1ac62e7a602aa5d9d6ae84f1..8f64d30c3a6fc8a336bf4be6bc78988c6d38142c 100644 (file)
  "Accidentals"
  '(accidentals
    left-padding 
-   right-padding 
+   right-padding
+   paren-cautionaries
+   cautionary-size
    ))