lilypond-user
[Top][All Lists]
Advanced

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

Re: Lyric word engraver bug


From: Simon Albrecht
Subject: Re: Lyric word engraver bug
Date: Sun, 07 Sep 2014 12:28:35 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.1.0

And thanks also for these coding suggestions, they’re very good and I’ve incorporated them.

Am 07.09.2014 um 00:37 schrieb David Nalesnik:



On Sat, Sep 6, 2014 at 5:20 PM, David Nalesnik <address@hidden> wrote:

Here's an unrelated suggestion.

When you use \wordcompress with a value which triggers the warning, the music function doesn't return music, so you end up with a fatal error (rather defeating the gentle purpose of a simple warning!)

Why not something like:

wordcompress =
#(define-music-function (parser location num) (number?)
   (cond
    ((> num 0.5)
     (and (ly:warning "Attention: 0.4 is a rather large value for \\wordcompress already!")
          (make-music 'Music)))
    ((< num 0)
     (ly:error "\\wordcompress should get a non-negative value."))
    (else #{ 
      \override LyricWord.after-line-breaking = #(lyric-word-compressor num)
      \override LyricHyphen.minimum-distance = #0
      \override LyricSpace.minimum-distance = #1
      #})))

Or perhaps issue a warning and let the override proceed with the odd value?

wordcompress =
#(define-music-function (parser location num) (number?)
   (cond
    ((< num 0)
     (ly:error "\\wordcompress should get a non-negative value."))
    (else 
     (begin
      (if (> num 0.5)
          (ly:warning "Attention: 0.4 is a rather large value for \\wordcompress already!"))
      #{
        \override LyricWord.after-line-breaking = #(lyric-word-compressor num)
        \override LyricHyphen.minimum-distance = #0
        \override LyricSpace.minimum-distance = #1
      #}))))


reply via email to

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