[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    Re: Text spanner with middle text
From:       James Worlton <jworlton () gmail ! com>
Date:       2020-05-31 22:15:42
Message-ID: 29B32D82-5601-482C-A240-6F5342BD0E6B () gmail ! com
[Download RAW message or body]

Thanks Valentin! I think this will be able to do what I need.

James

> On May 30, 2020, at 23:23, Valentin Villenave <valentin@villenave.net> wrote:
> 
> On 5/31/20, James Worlton <jworlton@gmail.com> wrote:
>> Is there a way to do this using a single text spanner? I could probably
>> fake it with 2 spanners, but would rather not if I didn't have to, since
>> the positioning of the middle text would be trial and error.
> 
> Indeed.  But I think that if you're looking for something simple, that
> remains the easiest way by far:
> 
> %%%%
> 
> \version "2.20.0"
> 
> insertTextSpan =
> #(define-music-function (txt) (markup?)
>   (make-music 'CrescendoEvent
>               ; 'tweaks (list (cons 'font-shape 'upright))
>               'span-direction START
>               'span-type 'text
>               'span-text txt))
> 
> {
>  b1\insertTextSpan "poco"
>  b
>  b\insertTextSpan "a"
>  b
>  b\insertTextSpan \markup \bold "poco"
>  b
>  b\!
> }
> 
> %%%%
> 
> Cheers,
> -- V.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic