lilypond-user
[Top][All Lists]
Advanced

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

Re: Trying to use ly:grob-set-property!


From: Aaron Hill
Subject: Re: Trying to use ly:grob-set-property!
Date: Wed, 08 Apr 2020 13:51:34 -0700
User-agent: Roundcube Webmail/1.4.2

On 2020-04-08 1:26 pm, Kevin Barry wrote:
Hi Lilypond users,

I am trying to get something to work by setting the X-offset of a grob
using ly:grob-set-property but I must be doing something wrong,
because it seems to have no effect. Can anyone explain what I'm doing
wrong? Below is a minimal example showing what I mean.

%%%
\version "2.19.84"
{
  \override TextScript.X-offset = 10
  c' ^"this is offset"
}
{
  \override TextScript.after-line-breaking =
  #(lambda (grob)
     (ly:grob-set-property! grob 'X-offset 10))
  c' ^"this isn't offset"
}
%%%

If you use before-line-breaking, the change in position applies. For after-line-breaking, I believe you need to use ly:grob-translate-axis!, which would have the same effect as using extra-offset. But note that the staff lines do not extend all the way to the right because they are calculated with the untranslated extents. Also see below an example of \offset for reference:

%%%%
\version "2.20.0"
{
  c' \offset X-offset 10 ^"this is offset"
}
{
  \override TextScript.before-line-breaking =
  #(lambda (grob)
     (ly:grob-set-property! grob 'X-offset 10))
  c' ^"this is offset"
}
{
  \override TextScript.after-line-breaking =
  #(lambda (grob)
     (ly:grob-translate-axis! grob 10 X))
  c' ^"this is offset"
}
%%%%


-- Aaron Hill

Attachment: xoffset.cropped.png
Description: PNG image


reply via email to

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