lilypond-user
[Top][All Lists]
Advanced

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

Re: text spanning


From: Hugh Myers
Subject: Re: text spanning
Date: Fri, 27 Nov 2009 12:24:46 -0700

Lovely! Much thanks Nick--- also nice to have code to examine prior to
the point I need to roll my own :)

--hsm

On Fri, Nov 27, 2009 at 12:20 PM, Nick Payne
<address@hidden> wrote:
> Hugh Myers wrote:
>>
>> Perhaps I misunderstand your reply, but bar 14(where the problem is)
>> has nothing to do with a rest. The text starts where (as you say) I
>> wanted it to. That is not the problem. What is the problem is the
>> continuation of the spanning text at bar 14--- here it starts outside
>> in the margin instead of being aligned beneath a note. Is this
>> behavior controllable?
>
> See music function below that I wrote for creating text spanners with
> arbitrary text. It allows you to specify as parameters:
>
> The starting text
> The outside staff priority
> Whether the spanner is above or below the stave
> The amount by which you want to adjust the left and right ends of the
> spanner
> The amount by which you want to adjust the left and right point at which the
> spanner breaks when it crosses a line break
>
> % usage e.g.:
> %   \tspan "sul ponticello" #0 #DOWN #'(0 . -0.5) #5 #1
> %   g\startTextSpan c bes' ees, aes c, g c bes' ees, aes c,\stopTextSpan
> tspan = #(define-music-function (parser location text osp dirn shorten
> adjBreak adjEnd) (string? number? number? pair? number? number?) #{
>   % set osp to 999 if spanner is colliding with another element
>   % this will position the spanner outside all other elements
>   % can be normally be set to zero
>   \once \override TextSpanner #'outside-staff-priority = #$osp
>   \once \override TextSpanner #'bound-details #'left #'text =
> \markup\italic\small\bold { \concat { { $text } " " } }
>   \once \override TextSpanner #'font-shape = #'upright
>   % direction (either #UP or #DOWN)
>   \once \override TextSpanner #'direction = #$dirn
>   % setup dashed line and draw a bracket edge on RHS
>   \once \override TextSpanner #'dash-period = #1.5
>   \once \override TextSpanner #'dash-fraction = #0.3
>   \once \override TextSpanner #'thickness = #0.8
>   \once \override TextSpanner #'bound-details #'right #'text = \markup {
> \draw-line #(cons 0 (/ $dirn -1)) }
>   % set alignment of line with reference to left text
>   \once \override TextSpanner #'bound-details #'left #'stencil-align-dir-y =
> #CENTER
>   \once \override TextSpanner #'bound-details #'left #'padding = #(car
> $shorten)
>   \once \override TextSpanner #'bound-details #'right #'padding = #(cdr
> $shorten)
>   % allow adjustment of line end when it wraps to following stave
>   \once \override TextSpanner #'bound-details #'right-broken #'padding =
> #$adjEnd
>   % adjust LH end of line when it wraps to following stave so that it
> doesn't
>   % extend to the left of the notes on the stave
>   \once \override TextSpanner #'bound-details #'left-broken #'X = #$adjBreak
>   % optional override to remove text and bracket edge at line breaks
>   \once \override TextSpanner #'bound-details #'left-broken #'text = ##f
>   \once \override TextSpanner #'bound-details #'right-broken #'text = ##f
> #})
>
>
>




reply via email to

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