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 <https://math.silvain-dupertuis.org/musique/Test-audition-fr%C3%A9quences.html>. 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 <https://perso.silvain-dupertuis.org>

Reply via email to