Hi Urs,
isn't the layer grob property what you want?
This is what I use to interrupt ties (or slurs) if they collide with a
time signature:
% to have the time sig behind the staff symbol
\override Staff.TimeSignature #'layer = #-5
% whiteout anything behind the time sig
\override Staff.TimeSignature #'whiteout = ##t
% ties are behind the time sig
\override Tie #'layer = #-10
Now you can listen for the grob-interface and look, if its set to a
specific number and then do anything whith the grob (color it or set the
stencil to #f)
The layer may be a procedure, so it may be set conditionally by some
other method.
Best, Jan-Peter
On 01.08.2013 10:15, Urs Liska wrote:
I have brought this up before without success. But as my interest
reappeared I'll try it again with a slightly more specific question.
When LilyPond finally renders its objects 'on paper' how complicated
would it be to allow it to print on layers that show up as separate
layers in the final pdf?
I would consider this a very useful enhancement.
As a first step this could and should be done without any layout
considerations, i.e. without changing anything in the layout engine.
Simply put grobs on the default or a dedicated layer with a syntax
something like
\new Layer = "Annotations"
\change Layer = "Annotations"
\change Layer = "Default"
Instead of the \new Layer command I also could imagine defining layers
in the \paper block
There is much more potential in this, but just to show what I mean
(with a known construct):
If I could print the result of annotate-spacing on a different layer I
could simply switch that layer on and off in a pdf viewer.
Or if I have layout-indifferent additions like the control-points
visualization in
http://lilypondblog.org/wp-content/uploads/2013/07/chopin-beams-5.preview.png
it would be nice to be able to switch them on and off without having
to recompile the file.
Any ideas?
Urs
PS: As a first step it already would be nice to know
- where (in the code) LilyPond actually 'prints' its objects (and
where to)
- where I can find concise and understandable information about how
PDF layers are created
(in the sense of creating them when writing a file, not how to
create them in Acrobat or the like)
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
\version "2.16.1"
gac = #(make-engraver
(acknowledgers
((grob-interface engraver grob source-engraver)
(let ((layer (ly:grob-property grob 'layer)))
(ly:message "~A layer ~A" grob layer)
(if (eq? 1 layer) (ly:grob-set-property! grob 'color red))
))
))
\layout {
\context {
\Score
\consists #gac
\override NoteHead #'layer = #(lambda (grob) 1)
}
}
\relative c'' { c4 }
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user