Re: Behaviour of TextSpanner dashes
Urs Liska openlilylib.org> writes: > [That's something I often struggle with: I think the function or > parameter definition that is generated from the sources is often quite > sparse] > You are changing behavior rather deep in the details. You can search for stencil-offset in the setup files to see an example of its use. In define-grobs it is used for a dyanmics spanner. It is a pair of numbers, probably X and Y: \relative c'{ \override TextSpanner.bound-details.left.stencil-offset = #'(0 . -0.5) \override TextSpanner.bound-details.right.stencil-offset = #'(0 . -0.5) \override TextSpanner.bound-details.left.text = #"ggg" \override TextSpanner.bound-details.right.text = #"hhh" c4^\startTextSpan c c c \stopTextSpan } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
Am 06.02.2014 04:49, schrieb Keith OHara: At 15:24 on 05 Feb 2014, Urs Liska wrote: - the vertical position of the dashes (i.e. raise it a little bit relatively to the text) TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER unfortunately doesn't help. I'd need something like raise the dashes by 0.2 ... Kieren MacMillan sympatico.ca> writes: Surprisingly it looks different with different texts. Another side-effect of the [irritating] fact that Lilypond doesn’t use the text baseline as the reference point!?!? Lilypond does use the text baseline as reference point for text. It seems that override of stencil-align-dir-y = #CENTER makes LilyPond *replace* the usual reference point with the vertical center of the text, including descenders if there are any. Other values in place of CENTER move the reference to different fractions of the vertical extent. Looking at the code, leaving stencil-align-dir-y unset leaves the reference point at the baseline. This seems like a plausible explanation of the behaviour. The documentation talks next about stencil-offset Try that. Hm, I finde stencil-offset in the properties of DynamicSpanner, but not TextSpanner. Overriding stencil-offset or left.stencil-offset doesn't seem to have any effect. IR of TextSpanner states left.attach-dir which sounds good, but overriding doesn't seem to change anything. Then there is left.Y - which makes the dashed line diagonal. What I find interesting too is left-bound-info (list): ly:line-spanner::calc-left-bound-info An alist of properties for determining attachments of spanners to edges. But unfortunately I don't find any concrete information about this "alist of properties". [That's something I often struggle with: I think the function or parameter definition that is generated from the sources is often quite sparse] Any further information or ideas? TIA Urs ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
On Wed, 05 Feb 2014 20:05:28 -0800, Kieren MacMillan wrote: Lilypond does use the text baseline as reference point for text. Really? Then why do these texts not align along their baselines: The default settings have the same minimum gap between staff and text, including descenders, as the minimum space from staff to the baselines. So the padding against collisions is all we see. We can change the settings, increasing the space to the baseline: http://lilypond.org/doc/v2.18/Documentation/learning/fixing-overlapping-notation#the-staff_002dpadding-property {\textLengthOn \override TextScript #'staff-padding = #1 c''^\markup { NO DESCENDERS!! } c''^\markup { jjjyyyjjjggg } } (There are some other things -- tempo marks, I think -- where the code makes so many adjustments to placement that I could not figure out how to uncover the simple behavior of spacing to the baseline.) I think it would be better to move the reference line to half the x-height of the font above the baseline (as it is now for the p, f, etc., letters in dynamics) for any text near music. Then the same distance from staff to reference line would make sense for items both above and below the staff, and it would be simpler to center lyrics between staves (no longer needing to adjust distances by that half an x-height). ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
Hi Keith, > Lilypond does use the text baseline as reference point for text. Really? Then why do these texts not align along their baselines: \version "2.19" music = { \textLengthOn c''^\markup { NO DESCENDERS!! } c''^\markup { jjjyyyjjjggg } } \score { \music } Thanks, Kieren. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
At 15:24 on 05 Feb 2014, Urs Liska wrote: >>>- the vertical position of the dashes (i.e. raise >>> it a little bit relatively to the text) >> >> TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER > >unfortunately doesn't help. I'd need something like raise the dashes >by 0.2 ... Kieren MacMillan sympatico.ca> writes: > > Surprisingly it looks different with different texts. > > Another side-effect of the [irritating] fact that Lilypond doesn’t > use the text baseline as the reference point!?!? Lilypond does use the text baseline as reference point for text. It seems that override of stencil-align-dir-y = #CENTER makes LilyPond *replace* the usual reference point with the vertical center of the text, including descenders if there are any. Other values in place of CENTER move the reference to different fractions of the vertical extent. Looking at the code, leaving stencil-align-dir-y unset leaves the reference point at the baseline. The documentation talks next about stencil-offset Try that. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
Hi Urs, > Surprisingly it looks different with different texts. Another side-effect of the [irritating] fact that Lilypond doesn’t use the text baseline as the reference point!?!? =\ Cheers (?), Kieren. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
Am 05.02.2014 16:11, schrieb Urs Liska: Am 05.02.2014 16:05, schrieb Mark Knoop: Try a number like #-0.5 instead of #CENTER Thanks! Using -0.75 gave me what I want. Well, not really. Surprisingly it looks different with different texts. If I don't override stencil-align-dir-y both dashes have the same position. ? > Urs > <><>___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
Am 05.02.2014 16:05, schrieb Mark Knoop: Try a number like #-0.5 instead of #CENTER Thanks! Using -0.75 gave me what I want. Urs ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
At 15:24 on 05 Feb 2014, Urs Liska wrote: >>>- the vertical position of the dashes (i.e. raise >>> it a little bit relatively to the text) >> >> TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER > >unfortunately doesn't help. I'd need something like raise the dashes >by 0.2 ... Try a number like #-0.5 instead of #CENTER -- Mark Knoop ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
Am 05.02.2014 15:52, schrieb Phil Burfitt: - Original Message - From: "Urs Liska" To: "lilypond-user" Sent: Wednesday, February 05, 2014 1:59 PM Subject: Behaviour of TextSpanner dashes Hi, in the attached image you see a TextSpanner, and I'm having some issues with it: - why is the first dash longer than the other(s), is this a design decision (if yes, why)? can it be modified? - is it possible to make a TextSpanner always to align to the right edge of the score (i.e. the barline) and let the dash structure adapt to that? (I see the 'right-bound-info' property but didn't find any helpful information on that alist) - is it possible to tweak - the attachment of the first dash to the text and - the vertical position of the dashes (i.e. raise it a little bit relatively to the text) ? Thanks for any explanation or ideas Urs Hi Urs, You can change the look of the dashes (add your own numbers) ... \override TextSpanner.dash-period = #0.8 \override TextSpanner.dash-fraction = #0.2 Yes, I know (I think that was already visible in the attached image ;-) ) and you could add a space after "rit.". ie. "rit. ". or maybe... \override TextSpanner.bound-details.left.text = \markup { "rit." \hspace #0.5 } OK, this works (even as \markup { \concat { $text \hspace #0.5 } } inside a function. Although I find it a bit hacky ... You could also superscript a space after "rit." which would raise the dashed line, or maybe use \vspace or \raise. Hm, neither \super, \vspace nor \raise seems to have any effect on the dashes. Don't know if that helps? As said, partially. Thanks Urs Phil. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
- Original Message - From: "Urs Liska" To: "lilypond-user" Sent: Wednesday, February 05, 2014 1:59 PM Subject: Behaviour of TextSpanner dashes Hi, in the attached image you see a TextSpanner, and I'm having some issues with it: - why is the first dash longer than the other(s), is this a design decision (if yes, why)? can it be modified? - is it possible to make a TextSpanner always to align to the right edge of the score (i.e. the barline) and let the dash structure adapt to that? (I see the 'right-bound-info' property but didn't find any helpful information on that alist) - is it possible to tweak - the attachment of the first dash to the text and - the vertical position of the dashes (i.e. raise it a little bit relatively to the text) ? Thanks for any explanation or ideas Urs Hi Urs, You can change the look of the dashes (add your own numbers) ... \override TextSpanner.dash-period = #0.8 \override TextSpanner.dash-fraction = #0.2 and you could add a space after "rit.". ie. "rit. ". or maybe... \override TextSpanner.bound-details.left.text = \markup { "rit." \hspace #0.5 } You could also superscript a space after "rit." which would raise the dashed line, or maybe use \vspace or \raise. Don't know if that helps? Phil. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
Hi Urs, On Wed, Feb 5, 2014 at 8:26 AM, Urs Liska wrote: > Am 05.02.2014 15:20, schrieb David Nalesnik: > >> >> > >> In fact, there's a markup command \draw-dashed-line which guards against >> these clipped edges. >> >> > You mean I should replace the TextSpanner by a custom \markup command? > > Oh, sorry. I was just rambling. I'm thinking that the logic of that command might be extended to an actual enhancement of LilyPond to make such things automatic, but I don't have a good answer to how to achieve what you want with LilyPond as it is. I imagine you could create a markup command, but a better option may be a custom stencil function for TextSpanner which could deal with broken spanners. -David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
Am 05.02.2014 15:20, schrieb David Nalesnik: Hi Urs, >- is it possible to make a TextSpanner always to align > to the right edge of the score (i.e. the barline) > and let the dash structure adapt to that? > (I see the 'right-bound-info' property but didn't >find any helpful information on that alist) This was one of my pet peeves with Finale--having to endlessly adjust dashed lines so they weren't ended by a dot (usually discovered on the printout...) I can't see any reason why LilyPond couldn't be enhanced to ensure that this doesn't happen. Yes, I think that the overall extent of the spanner should (optionally) be favored against the literal dash structure. Actually LilyPond wouldn't (AFAICS) end the spanner with a dot, but rather with a gap (which isn't nice either). In fact, there's a markup command \draw-dashed-line which guards against these clipped edges. You mean I should replace the TextSpanner by a custom \markup command? Urs ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
Hi Mark, thanks for the ideas, but ... Am 05.02.2014 15:09, schrieb Mark Knoop: ... Not sure about those above, but: - is it possible to tweak - the attachment of the first dash to the text and TextSpanner.bound-details.left.padding = #-0.5 This shifts the whole "left" part slightly to the left, i.e. the TextSpanner starts earlier. What I need is to put a slight gap between the "rit." and the first dash. - the vertical position of the dashes (i.e. raise it a little bit relatively to the text) TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER unfortunately doesn't help. I'd need something like raise the dashes by 0.2 ... Best Urs ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
Hi Urs, On Wed, Feb 5, 2014 at 8:09 AM, Mark Knoop wrote: > At 14:59 on 05 Feb 2014, Urs Liska wrote: > >in the attached image you see a TextSpanner, and I'm having some > >issues with it: > > > >- why is the first dash longer than the other(s), > > is this a design decision (if yes, why)? > > can it be modified? > >- is it possible to make a TextSpanner always to align > > to the right edge of the score (i.e. the barline) > > and let the dash structure adapt to that? > > (I see the 'right-bound-info' property but didn't > >find any helpful information on that alist) > This was one of my pet peeves with Finale--having to endlessly adjust dashed lines so they weren't ended by a dot (usually discovered on the printout...) I can't see any reason why LilyPond couldn't be enhanced to ensure that this doesn't happen. In fact, there's a markup command \draw-dashed-line which guards against these clipped edges. --David ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Behaviour of TextSpanner dashes
At 14:59 on 05 Feb 2014, Urs Liska wrote: >in the attached image you see a TextSpanner, and I'm having some >issues with it: > >- why is the first dash longer than the other(s), > is this a design decision (if yes, why)? > can it be modified? >- is it possible to make a TextSpanner always to align > to the right edge of the score (i.e. the barline) > and let the dash structure adapt to that? > (I see the 'right-bound-info' property but didn't >find any helpful information on that alist) Not sure about those above, but: >- is it possible to tweak > - the attachment of the first dash to the text and TextSpanner.bound-details.left.padding = #-0.5 > - the vertical position of the dashes (i.e. raise > it a little bit relatively to the text) TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER -- Mark Knoop ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Behaviour of TextSpanner dashes
Hi, in the attached image you see a TextSpanner, and I'm having some issues with it: - why is the first dash longer than the other(s), is this a design decision (if yes, why)? can it be modified? - is it possible to make a TextSpanner always to align to the right edge of the score (i.e. the barline) and let the dash structure adapt to that? (I see the 'right-bound-info' property but didn't find any helpful information on that alist) - is it possible to tweak - the attachment of the first dash to the text and - the vertical position of the dashes (i.e. raise it a little bit relatively to the text) ? Thanks for any explanation or ideas Urs <>___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user