bug-lilypond
[Top][All Lists]
Advanced

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

Re: Create different pdf layers


From: Mike Solomon
Subject: Re: Create different pdf layers
Date: Thu, 1 Aug 2013 11:58:36 +0300

On 1 août 2013, at 11:15, Urs Liska <address@hidden> 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

Hey Urs,

Great idea - this would be useful.

As far as I know, the PS standard doesn't support any native form of layering, 
and LilyPond pre-renders to PS before PDF.

I think your best bet would be to give objects ids in SVG (i.e. \override 
NoteHead.id = #"foo") and then write an XML parser to combine variously id'd 
objects into SVG groups.  Python's xml.dom.minidom library is great for this.  
I'm not sure how this information would translate into PDF layers (nor am I 
sure if all PDF readers support layers), but it'd certainly allow you to have a 
layered approach in something like Inkscape.

Cheers,
MS


reply via email to

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