[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Barre grob - appearance
From: |
Jean Abou Samra |
Subject: |
Re: Barre grob - appearance |
Date: |
Mon, 29 Aug 2022 23:24:17 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 |
Le 27/08/2022 à 13:55, Thomas Morley a écrit :
I foresee some hard to solve problems, though. I'm currently not sure
about the success.
IUUC, you have a problem to draw the grob with both a vertical and a
horizontal
line, because the usual way to make the vertical line place itself
against the
notes with some padding would be Y-offset =
side-position-interface::y-aligned-side,
but this requires the Y-extent + vertical-skylines, and those depend on
the full
stencil, and the vertical part of the line depends on the Y-offset, so
you have
a cyclic dependency.
Tricky, yes. OTOH, would it work to have two separate grobs, one for the
horizontal
line and one for the vertical one? Say,
BarreVerticalLine
- an Item
- has 'horizontal-line pointer to a BarreHorizontalLine
- stencil = a function that takes the coordinate of the
'horizontal-line, and draws a vertical line up to that
height
- X-extent = a function that essentially does
(symmetric-interval thickness)
(it can't be computed from the stencil, since as BarreVerticalLine
is an Item its X-extent will be asked for before line breaking)
- Y-extent = an unpure-pure container (ask me for details if
needed)
BarreHorizontalLine
- a Spanner
- has horizontal-line-spanner-interface, uses it for bound-details.
Uses ly:line-spanner::print for stencil. This is all quite similar
to TextSpanner.
Just in case that helps.
Jean