lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lecker lek-ker in "old" German lyrics


From: Thomas Morley
Subject: Re: lecker lek-ker in "old" German lyrics
Date: Mon, 11 Mar 2013 02:34:23 +0100

2013/3/8 Klaus Föhl <address@hidden>:
> Hello,
>
> Some German lyrics from before the times of Neue Deutsche Rechtschreibung
> feature ck between two syllables. Without Hyphen it is "lecker", with hyphen
> it is "lek-ker". Using lec -- ker or lek -- ker ( on purpose not le -- cker)
> the hyphen may or may not appear. Is there anything beyond trial and error
> to avoid lec-ker or lekker?
>
> Some time ago there was an idea of introducing "lek == ker" for forcing
> a hyphen but otherwise no change to formatting compared to "lek -- ker".
> Has there happened anything since (I did not find anything in the 2.16 doc)?
>
> Cheers
> Klaus

Hi Klaus,

below a workaround.

It's not widely tested and I expect a weird midi, though, it's the
best I currently can think of.

\version "2.16.0"

CKHyphenation =
\override LyricHyphen #'after-line-breaking =
  #(lambda (grob)
    (let* ((stil (ly:grob-property grob 'stencil))
           (stil-length
             (if (ly:stencil? stil)
                 (interval-length (ly:stencil-extent stil X))
                 0))
           (bound-left (ly:spanner-bound grob LEFT))
           (text-left (ly:grob-property bound-left 'text))
           (last-char-text-left
             (if (string? text-left)
                 (string-take-right text-left 1)
                 ""))
           (new-left-text
             (if (string? text-left)
                 (string-append
                    (string-drop-right text-left 1)
                    "c")
                 ""))
           (bound-right (ly:spanner-bound grob RIGHT))
           (text-right (ly:grob-property bound-right 'text))
           (first-char-text-right
             (if (string? text-right)
                 (string-take text-right 1)
                 ""))
           (new-right-text
             (if (string? text-right)
                 text-right
                 ""))
           (new-text (string-append new-left-text new-right-text))
           (new-left-text-stil (grob-interpret-markup grob (markup
#:fontsize 1 new-text))))

   (if (and (string=? "k" last-char-text-left)
            (string=? "k" first-char-text-right)
            ;; not sure about the value
            (< stil-length 0.1))
            (begin
              (ly:grob-set-property! bound-left 'stencil new-left-text-stil)
              (ly:grob-set-property! bound-right 'stencil empty-stencil)))))

%%% TEST

\layout {
        \context {
                \Lyrics
                \CKHyphenation
        }
}

lyr = \lyricmode {
        lek -- ker. lek -- ker. lek -- ker. lek -- ker.
}

mus = \relative c' {
        c d c d c d c2 \break
        d1
}

staffAndLyr =
  <<
  \new Voice = "mel" \mus
  \new Lyrics \lyricsto "mel" \lyr
  >>

\score {
  \staffAndLyr
  \layout { line-width = 30 }
}

\score {
  \staffAndLyr
  \layout { line-width = 58 }
}

\score {
  \staffAndLyr
  \layout { line-width = 65 }
}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]