Le 16/11/2022 à 16:26, Martín Rincón Botero a écrit :
Hello, the following code produces text on both sides of the spanner that looks vertically well aligned with the upper limit of its box instead of the inferior one:

{
  f'1
  ~
  - \tweak style #'line
  - \tweak bound-details.left.stencil-align-dir-y #CENTER
  - \tweak bound-details.right.arrow ##t
  - \tweak bound-details.right.stencil-align-dir-y #CENTER
  - \tweak bound-details.left.text \markup \normal-text "ord."
  - \tweak bound-details.right.text \markup \normal-text "s.p."
  \startTextSpan
  f'1
  :32
  \stopTextSpan
}

produces

imagen.png

where the "s.p." vertically aligns well with the upper end of the "d" in "ord.". How can I achieve the opposite? Namely, that the "s.p." (or the "p") aligns with the bottom of "ord." so that it looks centered?



You need to adjust stencil-align-dir-y as needed:


\version "2.23.81"

{
  f'1
  ~
  - \tweak style #'line
  - \tweak bound-details.left.stencil-align-dir-y #-0.3
  - \tweak bound-details.right.arrow ##t
  - \tweak bound-details.right.stencil-align-dir-y #0.2
  - \tweak bound-details.left.text \markup \normal-text "ord."
  - \tweak bound-details.right.text \markup \normal-text "s.p."
  \startTextSpan
  f'1
  :32
  \stopTextSpan
}


If you want to get rid of manual tweaking, consider giving
the two texts the same vertical extents:

\version "2.23.81"

{
  f'1
  ~
  - \tweak style #'line
  - \tweak bound-details.left.stencil-align-dir-y #CENTER
  - \tweak bound-details.right.arrow ##t
  - \tweak bound-details.right.stencil-align-dir-y #CENTER
  - \tweak bound-details.left.text \markup \normal-text \with-dimension-from #Y \overlay { "ord." "s.p." } "ord."   - \tweak bound-details.right.text \markup \normal-text \with-dimension-from #Y \overlay { "ord." "s.p." } "s.p."
  \startTextSpan
  f'1
  :32
  \stopTextSpan
}


Best,
Jean

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to