Re: Create different pdf layers

2013-08-14 Thread Marek Klein
Hello,

2013/8/1 Urs Liska u...@openlilylib.org

 I have brought this up before without success. But as my interest
 reappeared I'll try it again with a slightly more specific question.


there is an existing issue based on your request:
http://code.google.com/p/lilypond/issues/detail?id=2542

Do you believe, it is a good Idea to discus your Ideas on bug-list?

Marek,
one of the very few bug squad members
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Create different pdf layers

2013-08-01 Thread Mike Solomon
On 1 août 2013, at 11:15, Urs Liska u...@openlilylib.org 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
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Create different pdf layers

2013-08-01 Thread Jan-Peter Voigt

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


Re: Create different pdf layers

2013-08-01 Thread David Kastrup
Mike Solomon m...@mikesolomon.org writes:

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

But it converts the PostScript to PDF using Ghostscript, and Ghostscript
will both read and write PDF and PostScript, so it is quite likely that
there are some instructions in Ghostscript's version of the PostScript
language that would get converted into layer instructions in PDF.  For
example, we use the pdfmark command for generating embedded links.

-- 
David Kastrup


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Create different pdf layers

2013-08-01 Thread Henning Hraban Ramm

Am 2013-08-01 um 15:25 schrieb David Kastrup d...@gnu.org:

 Mike Solomon m...@mikesolomon.org writes:
 
 As far as I know, the PS standard doesn't support any native form of
 layering, and LilyPond pre-renders to PS before PDF.
 
 But it converts the PostScript to PDF using Ghostscript, and Ghostscript
 will both read and write PDF and PostScript, so it is quite likely that
 there are some instructions in Ghostscript's version of the PostScript
 language that would get converted into layer instructions in PDF.  For
 example, we use the pdfmark command for generating embedded links.

Of course, you can get nearly every PDF feature through PS using pdfmarks.




Greetlings, Hraban
---
fiëé visuëlle
Henning Hraban Ramm
http://www.fiee.net
http://angerweit.tikon.ch/lieder/
https://www.cacert.org (I'm an assurer)





___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Create different pdf layers

2013-08-01 Thread Jan-Peter Voigt

Am 01.08.2013 11:07, schrieb Jan-Peter Voigt:
isn't the layer grob property what you want? 

no, it isn't ...
but if one comes up with the right pdfmark ps command, there has to be a 
check of this layer property to avoid inconsistent lily- and pdf-layers.

Best, Jan-Peter


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Create different pdf layers

2013-08-01 Thread Urs Liska




Jan-Peter Voigt jp.vo...@gmx.de schrieb:

Am 01.08.2013 11:07, schrieb Jan-Peter Voigt:
 isn't the layer grob property what you want? 
no, it isn't ...
but if one comes up with the right pdfmark ps command, there has to be
a 
check of this layer property to avoid inconsistent lily- and
pdf-layers.
Best, Jan-Peter

I could imagine declaring a specific lilypond layer as a pdf layer at the top 
of the file and later look for elements of this layer.
That way I would be responsible myself and by default there wouldn't be any 
matching inconcistencies.
Something like

#(set-pdf-layer annotations 57)
#(set-pdf-layer control-points 58)

Urs


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Create different pdf layers

2013-08-01 Thread Jan-Peter Voigt

Am 01.08.2013 15:01, schrieb Urs Liska:

I could imagine declaring a specific lilypond layer as a pdf layer at the top 
of the file and later look for elements of this layer.
That way I would be responsible myself and by default there wouldn't be any 
matching inconcistencies.
Something like

#(set-pdf-layer annotations 57)
#(set-pdf-layer control-points 58)

or you might have layer boundaries:
#(set-pdf-layers '(-3 0 3 7) '(cellar normal upper 
control-points annotations)

meaning that layers
= -3 - cellar
= 0 - normal
= 3 - upper
= 7 - control-points
 7 - annotations

but looking at this ... I think this not explanable ... its not a good 
idea ;)


JP


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user