Re: ly:set-option png backend broken?

2023-12-12 Thread Stefano Antonelli
On Tue, 2023-12-12 at 21:48 +0100, K. Blum wrote:
> Am 10.12.2023 um 20:17 schrieb lilypond-user-requ...@gnu.org:
> >  Is there any way to produce png output without --png in the
> > command?
>  Did I get you right that you don't want to add anything to the
> command line, but you don't mind adding options to your LY files? 

Yes, exactly.

> #(ly:set-option 'tall-page-formats 'png)

This option was interesting in that it generated a one page png as a
separate output.  I don't think I need this, but it's neat.

> #(ly:set-option 'separate-page-formats 'png)

This option worked to create pngs from eps files.  From what I can tell
from my brief testing this does indeed do what I want.  Thanks very
much Klaus!



Re: ly:set-option png backend broken?

2023-12-12 Thread K. Blum

Hi Stefano,

Am 10.12.2023 um 20:17 schrieb lilypond-user-requ...@gnu.org:

Is there any way to produce png output without --png in the command?

Did I get you right that you don't want to add anything to the command
line, but you don't mind adding options to your LY files?

I'v tried this to get PNG files:

#(ly:set-option 'tall-page-formats 'png)
#(ly:set-option 'separate-page-formats 'png)
#(ly:set-option 'resolution '300)

Cheers,
Klaus


Re: ly:set-option png backend broken?

2023-12-11 Thread Jean Abou Samra
> Is there any way to produce png output without --png in the command?

No, sorry.





signature.asc
Description: This is a digitally signed message part


Re: ly:set-option png backend broken?

2023-12-10 Thread Stefano Antonelli
On Sun, 2023-12-10 at 13:13 -0600, David Wright wrote:
> On Sun 10 Dec 2023 at 17:24:46 (+), Stefano Antonelli wrote:
> > Is there any way to produce png output without --png in the
> > command?
> 
> Postprocess with:
> 
>   $ convert a.pdf a.png
>   $ gm convert a.pdf a.png
> 
> ie, convert is in imagemagick and graphicsmagick.

I wasn't looking to do this with an external tool, but I will keep it
in mind.  Thanks for the suggestion.

-Stef


Re: ly:set-option png backend broken?

2023-12-10 Thread David Wright
On Sun 10 Dec 2023 at 17:24:46 (+), Stefano Antonelli wrote:
> On Sun, 2023-12-10 at 09:30 +0100, Jean Abou Samra wrote:
> > There is simply not "png" backend. The three available backends are
> > "ps" (generates PostScript, and PDF or PNG by conversion through
> > Ghostscript), "svg" (generates SVG only), and, in more recent
> > versions, "cairo" (generates PostScript, PDF, PNG or SVG through the
> > Cairo library).
> 
> I could have sworn I read that in the documentation, but it appears
> not.  I must have made it up late one night...  Apologies for the
> noise.
> 
> > Changing the backend is independent from changing the output format
> > since there can be multiple backends to produce the same format.
> 
> Is there any way to produce png output without --png in the command?

Postprocess with:

  $ convert a.pdf a.png
  $ gm convert a.pdf a.png

ie, convert is in imagemagick and graphicsmagick.

Cheers,
David.



Re: ly:set-option png backend broken?

2023-12-10 Thread Stefano Antonelli
On Sun, 2023-12-10 at 09:30 +0100, Jean Abou Samra wrote:
> There is simply not "png" backend. The three available backends are
> "ps" (generates PostScript, and PDF or PNG by conversion through
> Ghostscript), "svg" (generates SVG only), and, in more recent
> versions, "cairo" (generates PostScript, PDF, PNG or SVG through the
> Cairo library).

I could have sworn I read that in the documentation, but it appears
not.  I must have made it up late one night...  Apologies for the
noise.

> Changing the backend is independent from changing the output format
> since there can be multiple backends to produce the same format.

Is there any way to produce png output without --png in the command?



Re: ly:set-option png backend broken?

2023-12-10 Thread Jean Abou Samra
The option is working as 
[documented](https://lilypond.org/doc/v2.25/Documentation/usage/advanced-command_002dline-options-for-lilypond.html)
 (although the failure mode could be better).

There is simply not "png" backend. The three available backends are "ps" 
(generates PostScript, and PDF or PNG by conversion through Ghostscript), "svg" 
(generates SVG only), and, in more recent versions, "cairo" (generates 
PostScript, PDF, PNG or SVG through the Cairo library).

Changing the backend is independent from changing the output format since there 
can be multiple backends to produce the same format.


signature.asc
Description: This is a digitally signed message part


ly:set-option png backend broken?

2023-12-09 Thread Stefano Antonelli
Hello list,

If I add this line to my ly file:

#(ly:set-option 'backend 'png)

on 2.20.0 (linux), I get this warning:

warning: program option -dprint-pages not supported by backend `png'

on 2.24.3 (wine and linux), same file, I get this failure:

C:/lilypond-2.24.3/share/lilypond/2.24.3/ly/init.ly:65:2: error: Guile
signaled an error for the expression beginning here
#
 (let ((book-handler (if (defined? 'default-toplevel-book-handler)
In procedure module-lookup: Unbound variable: output-stencils

The file looks like this:

theMusic = \new Staff {
c4 d e f
g4 a b c
d4 e f g
}

\score {
\unfoldRepeats { \theMusic }

\layout { }
\midi { }
}

#(ly:set-option 'backend 'png)

I was going to ask why setting the png backend this way differs from
adding --png to the command line.  I thought I'd test it in 2.24.3
first in case it was fixed.

Is there a bug in 2.24.3?  Or is there something quasi wrong with the
syntax?

In the 2.20.0 version, no png is produced.  I can make the warning go
away with:

#(ly:set-option 'print-pages #f)
#(ly:set-option 'backend 'png)

but still no png is produced.  If I take those lines out and run:

lilypond --png test.ly

then a png is produced.  It's odd behaviour.

Thanks,
Stef