lilypond-user
[Top][All Lists]
Advanced

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

Re: Why does -dbackend=svg -dcrop remove system-system-spacing?


From: Niols
Subject: Re: Why does -dbackend=svg -dcrop remove system-system-spacing?
Date: Wed, 6 Jan 2021 22:25:06 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

Hello,

On 06/01/2021 20:29, David Wright wrote:
On Wed 06 Jan 2021 at 11:34:24 (-0500), Trevor Bača wrote:
What I want Lily to do: remove whitespace from the *edges* of an SVG.

As I said, you run LP as normal, and then trim to taste. So, taking
your example, I ran it with
$ lilypond-2.21.80-1.linux-64/bin/lilypond --svg -dno-point-and-click Bača.ly
and then edited the first line of Bača.svg, resulting in Bača-trimmed.svg.
The end of the first line is modified from
  width="210.00mm" height="297.00mm" viewBox="0 0 119.5016 169.0094">
to
  width="192.00mm" height="297.00mm" viewBox="4.5 0 109.5016 169.0094">
which I did by inspection. As you use SVG files in your workflow,
I assume you can carry this out more easily and precisely¹ with some
particular tool. (I'm PDF-centric myself.) I only considered X because
I was inspecting the file on a landscape screen (and you didn't remove
the tagline anyway).

In term of particular tool, I personnaly use Inkscape for this task. This is probably far from optimal but it works nicely. For Inkscape < 1.0, the following:

inkscape --without-gui --export-area-drawing --export-plain-svg=output.cropped.svg input.svg

For Inkscape >= 1.0, the following:

inkscape --export-area-drawing --export-plain-svg --export-filename=output.cropped.svg input.svg

or in short:

    inkscape -Dlo output.cropped.svg input.svg

I suppose there might be faster lighter tools for that and I would love to hear from them.

Best,
— Niols



reply via email to

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