Skip to content

SVG Manual cropping

Klaus Blum edited this page Apr 3, 2022 · 6 revisions

SVG: Manual cropping

ANNOUNCEMENT
OOoLilyPond has moved to a new repository:
https://github.com/OOoLilyPond
All past/present/future development can be found at the new location. The page you are viewing right here contains all development up to V. 1.0.1, but it will no longer be maintained.

Standard templates in OLy make use of include "lilypond-book-preamble.ly". This will not work with the .svg backend. Therefore, for every template there is a "[SVG]" version that works without lilypond-book-preamble.

That means, however, there's no automatic cropping (removing empty whitespace around the musical snippet). Those templates use the Line Width field for "paper" width, and a "paper" height must be specified as well:

After compiling, the resulting image will have exactly the intended dimensions:

OLy02-Uncropped-Snippet-01

To get rid of the unnecessary white margins, one could adjust the width and height values by trial-and-error and recompile several times. But I think it's much easier to manually crop the image by selecting it and hitting the appropriate button (or right-clicking it and choosing the "Crop" command from the context menu):

OLy02-Cropping-01b

The green dots turn into red cropping marks that can be dragged to a new position:

OLy02-Cropping-02

When editing an existing OLy object, you won't always have to repeat the cropping procedure. In the main OLy window, you can choose to keep the object's current size and crop settings:

In the Config dialog, you can specify if you want this option to be turned on or off by default. There are independent settings for Writer and Impress/Draw.