lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Create different pdf layers


From: Jan-Peter Voigt
Subject: Re: Create different pdf layers
Date: Thu, 01 Aug 2013 11:07:51 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130623 Thunderbird/17.0.7

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
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user

Attachment: layers.ly
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]