]> git.donarmstrong.com Git - lilypond.git/commitdiff
* ly/gregorian-init.ly: Rewrote \versus and \responsum in order to
authorJürgen Reuter <j@web.de>
Tue, 6 Jun 2006 10:11:52 +0000 (10:11 +0000)
committerJürgen Reuter <j@web.de>
Tue, 6 Jun 2006 10:11:52 +0000 (10:11 +0000)
fix lyrics alignment problems.  They are implemented now as scheme
functions that add the appropriate unicode char to the first lyric
event rather than adding a separate lyric event.

ChangeLog
ly/gregorian-init.ly

index dd6cef86ebed64487d4fdd11ed8f781f0cbcffff..b972812037010aba1a8326a6087d27d4cb4107b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-06-06  Jürgen Reuter  <reuter@ipd.uka.de>
+
+       * ly/gregorian-init.ly: Rewrote \versus and \responsum in order to
+       fix lyrics alignment problems.  They are implemented now as scheme
+       functions that add the appropriate unicode char to the first lyric
+       event rather than adding a separate lyric event.
+
 2006-06-06  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
        * buildscripts/output-distance.py
index 6f3f06e16e6071e220878216488a6829bf517959..008cb6e1182e2a1bf1740ac4ed3229e04ee604f9 100644 (file)
@@ -17,11 +17,36 @@ IIJ = \lyricmode { IIJ }
 ij = \lyricmode { ij }
 iij = \lyricmode { iij }
 
-% unicode 2123 (versicle)
-versus = \lyricmode { ℣ }
-
-% unicode 211F (response)
-responsum = \lyricmode { ℟ }
+% Given some music that represents lyrics, add a prefix to the first
+% lyric event.
+#(define (add-prefix-to-lyrics prefix music)
+   (make-music
+    'SequentialMusic
+    'elements (append
+              (cons
+               (let* ((elems (car (ly:music-property music 'elements)))
+                      (props (ly:music-mutable-properties elems))
+                      (events (filter (lambda (x)
+                                        (equal? (car x) 'elements))
+                                      props))
+                      (first-evt (cadar events))
+                      (first-syllable (ly:prob-property first-evt 'text))
+                      (first-duration (ly:prob-property first-evt 'duration)))
+                 (make-music
+                  'LyricEvent
+                  'duration first-duration
+                  'text (string-append prefix first-syllable)))
+               (cdr (ly:music-property music 'elements))))))
+
+% Add unicode 2123 (versicle) as prefix to lyrics.
+versus =
+#(define-music-function (parser location music) (ly:music?)
+   (add-prefix-to-lyrics "℣" music))
+
+% Add unicode 211F (response) as prefix to lyrics.
+responsum =
+#(define-music-function (parser location music) (ly:music?)
+   (add-prefix-to-lyrics "℟" music))
 
 %
 % Declare head prefix shortcuts.