lilypond-user
[Top][All Lists]
Advanced

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

Re: Lilypond SVG output


From: Graham Percival
Subject: Re: Lilypond SVG output
Date: Wed, 05 Sep 2007 02:58:03 -0700
User-agent: Icedove 1.5.0.12 (X11/20070607)

If you haven't added this to LSR already, could you do so? You can add the script (and usage instructions) as a comment to the snippet.

Cheers,
- Graham


Benjamin Esham wrote:
[cc'ing to the list]

Vivian Barty-Taylor wrote:

Dear Benjamin and Nick,

This was just to let you know that I've got fixing the Lilypond SVG output down to three "replace" operations in EMacs.

Editing the SVG file you replace:

1: all occurrences of "feta-alphabet20" with "Emmentaler"
2: all occurrences of "font-family:Century" with "font-family:Century Schoolbook L 3: all occurrences of "font-family:L" with "font-family:Century Schoolbook L"

The only output which remains incorrect is italic font type, which I haven't found any way of fixing - the SVG file seems to be correct, the font file is there, as far as I can see, but it always shows as Roman.

It would be perfectly feasible (I suppose) just to make a parser which was triggered by the writing of the SVG file by Lilypond which corrected these mistakes.

I'm not fluent enough in any language to write this, but maybe one of you is?

Hi Vivian,

Thanks for the info! I wrote the following file to be used with the sed tool:

s/feta-alphabet[0-9]+/Emmentaler/g
s/font-family:Century/font-family:Century Schoolbook L/g
s/font-family:L/font-family:Century Schoolbook L/g

Call this with "sed -Ef lilyfix.sed lilyfile.svg > lilyfile_fixed.svg".

I did have to make one change, which was to generalize the expression for feta-alphabet to work with other sizes. This sed script has to be run manually from the command line after each time you call lilypond; I found that to be a pain, so I wrote a shell script called lilysvg, which looks mostly like this (full paths are omitted for brevity):

#!/bin/sh
.../lilypond -bsvg -o /tmp/lilysvg $1.ly && sed -Ef .../fix.sed /tmp/lilysvg.svg > $1.svg

Call it with "lilysvg lilyfile", being sure to leave off the ".ly" of the filename.

Thanks again for the information on this! I've now used LilyPond to create SVG files of some music snippets for Wikipedia—you can see a small gallery at <http://commons.wikimedia.org/wiki/User:Bdesham/Images#Musical_images>.

HTH,
--Benjamin D. Esham
E-mail/Jabber: address@hidden | AIM bdesham128 | PGP D676BB9A
Esperanto, the international language  ☆  http://www.lernu.net
------------------------------------------------------------------------

_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user





reply via email to

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