sphinx-notes / lilypond

Sphinx extension for embedding LilyPond scores
https://sphinx.silverrainz.me/lilypond/
BSD 3-Clause "New" or "Revised" License
11 stars 1 forks source link

SVGs cropping right and bottom #15

Closed kjcole closed 2 years ago

kjcole commented 2 years ago

Since large PNGs were giving me trouble, I decided to switch the configuration to SVGs.

However, this crops the right and bottom of the score, eliminating too much.

The result can be seen by looking at any of the 47 scores (so far) at:

https://ubuntourist.codeberg.page/Celtic_Song_Book/

Running

$ lilypond -o song_of_the_heather -dbackend=svg song_of_the_heather.ly

produces the correct uncropped output.

(I notice that running lilypond from the command line produces a true SVG, whereas the extension does a base-64 encoding of a PNG, and wraps SVG code around it.)

kjcole commented 2 years ago

Any progress?

SilverRainZ commented 2 years ago

Sorry, not yet, I will take a look this week.

kjcole commented 2 years ago

No rush. Just checking back.

SilverRainZ commented 2 years ago

Cropping an SVG in my environment does not eliminate too much, but also weird:

火狐截图_2022-07-13T15-03-55 682Z

kjcole commented 2 years ago

Weird. Yes. Thanks for taking a look. I had hoped that SVG with it's scaling ability would ultimately be a better choice, but the strangeness may force me back to the PNG -- which as previously reported, has its own challenges / bugs...

SilverRainZ commented 2 years ago

(I notice that running lilypond from the command line produces a true SVG, whereas the extension does a base-64 encoding of a PNG, and wraps SVG code around it.)

Yes, this is the key. The output of ImageMagick is not real SVG, but a wrapped PNG and its default resolution is only 72.