lilypond-user
[Top][All Lists]
Advanced

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

Re: lyric tie font size


From: Michael Lauer
Subject: Re: lyric tie font size
Date: Thu, 16 Jul 2009 09:37:36 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Kieren MacMillan <kieren_macmillan <at> sympatico.ca> writes:

> 
> Hello all,
> 
> Is the fontsize of the lyric tie glyph user-settable?
> [v2.13, if it matters...]
> 
> Thanks,
> Kieren.
> 

I don't see any simple way, but you can copy the default (mostly in 
define-markup-commands.scm), tweak it to suit, and override the 
LyricText stencil. 

The important bit here is the definition of tie-markup. As an example
I used "tiny," but you could do whatever you want.


\version "2.12.0"
\include "english.ly"

#(define-markup-command (my-tied-lyric layout props str)
  (string?)
  "Like the builtin tied-lyric, with a smaller tie"
  (if (string-contains str "~")
      (let*
          ((parts (string-split str #\~))
           (tie-str (ly:wide-char->utf-8 #x203f))
           (tie-markup (markup #:tiny tie-str))
           (joined  (list-join parts tie-markup))
           (join-stencil (interpret-markup layout props tie-markup))
           )

        (interpret-markup layout 
                          (prepend-alist-chain
                           'word-space
                           (/ (interval-length (ly:stencil-extent join-stencil 
X)) -3.5)
                           props)
                          (make-line-markup joined)))
      (interpret-markup layout props str)))

      
#(define (my-lyric-print grob)
  "Like the usual lyric print function, except with a smaller tie symbol"
  (let*
      ((text (ly:grob-property grob 'text))
       (layout (ly:grob-layout grob))
       (defs (ly:output-def-lookup layout 'text-font-defaults))
       (props (ly:grob-alist-chain grob defs)))

    (interpret-markup layout
                                         props
                                         (if (string? text)
                                             (markup #:my-tied-lyric text)
                                             text))))
                                            
                                             
\score
{
    \new Voice
    {
        c'1 c'1
    }
    \addlyrics
    {
        A~tie
        \override LyricText #'stencil = #my-lyric-print
        A~tie
    }
}



Hope this helps,
Michael





reply via email to

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