Am Mi., 13. März 2024 um 23:56 Uhr schrieb Dan Eble <nine.fierce.ball...@gmail.com>: > > On 2024-03-13 17:35, Thomas Morley wrote: > > > currently I'm attempting to improve dashed/dotted bar lines wrt to > > changed staff-space and span bars. > > We use both definitions for BarLine _and_ SpanBar, but then SpanBar is > > frequently a little off. > > It would be nice to have a possibility to detect whether a definition > > is used for span bars. > > What specifically do you want to know? Do you expect to code something like > > if the grob is a BarLine: > adjust ... by ... > if the grob is a Divisio: > adjust ... by ... > if the grob is a SpanBar: > adjust ... by ... > > If so, it seems that you could add a grob property for that adjustment > and get it from the grob. > > > #(define (make-test-bar-line grob extent) > > (let ((grob::make-span-bar? #f)) > > Another possibility is for the grob's print procedure to pass more > information down to this function. That might be more appropriate if > the information you require is not associated with the grob only, but is > derived from a number of sources, like the surrounding staves, and would > be useful for many different glyph print procedures. Of course, > ly:bar-line::print would provide values appropriate for bar lines and > ly:span-bar::print would provide values appropriate for span bars. > > These are the opinions off the top of my head and I reserve the right to > change them. > -- > Dan > Hi Dan,
I don't understand what you propose. To give a different example, let's look at make-dotted-bar-line (afaik it's your code). There you have a `making-span-bar?'-condition, obviously you want a span bar a little different than bar line. Though, I noticed a few things: a) If I implement (pretty-print grob) there, I always get BarLine, never something else, regardless where I place that. b) Dotted span bars are not optimal. Compile my example from my initilal post to get an example. c) the condition itself may fail, see /input/regression/non-centered-bar-lines.ly for an example, or try to set bar-extent to an interval not crossing zero. Because of b) I tried to patch make-dotted-bar-line, alas I found no condition to apply the patched functionality to span bars only. Thus I ask if there is such a condition at all. Or how it could be coded. Alternatively, I could code a special `make-dotted-span-bar'-procedure and define the dotted bar line as (define-bar-line ";" #t #f ";-span") or the like... Thanks, Harm