lilypond-user
[Top][All Lists]
Advanced

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

Re: Piping contents of SVG directly to stdout


From: Silvain Dupertuis
Subject: Re: Piping contents of SVG directly to stdout
Date: Mon, 18 Jul 2022 21:35:11 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

It'll be interesting to be able to ouput SVG directly to get snippet which can be integrated into other documents.

Actually, one can get SVG files using Inkscape : import the PDF file (using PopplerCairo orption),  edit at will, select parts, crop, etc. and save as SVG.

This is what I did for this experimental page. I used one LilyPond file, produced one PDF page output, which I edited with Inkscpae to cut it into 3 SVG files to include in my HTML page.

On the other side, you can put LilyPond code into OOoLilyPond extension for LibreOffice. It produces SVG code (and you can save the image as SVG), and these images can be used directly in the OpenDocument file to include them into some textual explanation...

I would be interested in a web extension which would interpret directly Lilypond code into SVG files, it that is possible...

Silvain


Le 18.07.22 à 20:33, David Wright a écrit :
On Mon 18 Jul 2022 at 11:28:26 (-0500), DoubleFelix wrote:

        
Felix, I’m curious what you mean by cropping the file. Sounds to me like
you are trying to just write a small snippet of music, maybe a few
measures, and not have the output flooded by whitespace all around the size
of an A4 paper? This is also similar to what I was using lilypond for and
there are ways to do this without any external apps.

Actually this is exactly what I'm trying to do. My current setup uses a
python library called svgpathtools to get the bounding box, then I do some
basic manipulation of the width, height, and viewbox parameters to trim all
of the excess whitespace out. Although I am very interested in  can
do this without any additional utilities.
I thought this ought to be very simple.

The attached are shamelessly plundered from
https://lists.gnu.org/archive/html/lilypond-user/2021-01/msg00075.html

(There will be files generated, with names not including ".cropped.",
that need to be thrown away.)

Cheers,
David.


--
Silvain Dupertuis
Route de Lausanne 335
1293 Bellevue (Switzerland)
tél. +41-(0)22-774.20.67
portable +41-(0)79-604.87.52
web: silvain-dupertuis.org

reply via email to

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