Le 18/05/2021 à 17:55, Lukas-Fabian Moser a écrit :
Hi Jean,
How about a separate grob with engraver? Try the attached.
This should be included in the documentation as a textbook example for
a not-quite-trivial, but reasonably straightforward example of a both
a custom engraver and a custom grob.
Well, the documentation doesn't have any material about Scheme engravers
yet. For now, I'll add it to the guide I wrote up.
Thanks very much for this!
You're welcome.
And wouldn't it be worth to add the convenience macro define-grob! to
LilyPond's stock scheme library?
In this state, it is a dirty hack that will cause problems in particular
cases (like defeating per-session semantics). I'd rather recode this
part of the internals so that grobs can be defined with a nicer
interface. For some time, I have been musing with the perspective of
grob definitions in a fashion similar to context definitions, borrowing
most of the syntax, like:
\layout {
\grob {
\NoteHead
color = "red"
}
\grob {
\name Highlight
\type Item
\interface text-interface
\interface ...
stencil = #highlight::print
Y-extent = ##f
...
}
}
I'd be happy if someone led discussions for this and implemented it in
some form; I might do it at some point, but my contributor stack already
contains quite a few projects currently.
Best,
Jean