[Top][All Lists]

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

Re: Fonts in SVG output

From: Erik Sandberg
Subject: Re: Fonts in SVG output
Date: Sat, 11 Aug 2007 19:53:38 +0200
User-agent: KMail/1.9.6

On Sunday 08 July 2007, Benjamin Esham wrote:
> Benjamin Esham wrote:
> > I'm having some issues with Lilypond 2.10.x's SVG export.
> I seem to have fixed most (all?) of my font problems.  I now have another
> problem, however.
> In order to submit one of LilyPond's SVGs to e.g. the Wikimedia Commons, it
> is necessary to convert all of its text into paths; that way, users need
> not have LilyPond's fonts in order to view the image correctly.  Before
> converting text into paths in Inkscape, you must make sure that none of the
> text is contained within a group.  Therefore, I started to process my file
> by selecting everything and issuing an Ungroup command.
> When I did so, the staff lines disappeared!  Apparently every object in the
> file is in a one-element group.  For some reason, ungrouping the staff
> lines made them disappear—they were still present, just not visible.  I
> think there may be an Inkscape bug at play here too, since "Select All"
> couldn't find the lines, but on the LilyPond end... how can I get Lily to
> create a sane, usable SVG file?
> Any help is greatly appreciated here.

There's another approach to the SVG output problem: You can take PDF or EPS 
output from lilypond, and try to turn it into SVG files. The postscript 
backend of lilypond is obviously more mature, and there exist converters from 
pdf/ps to svg. Free converters are a bit shaky, but for some lily versions I 
managed to convert .ly files into valid SVG via a chain of converters.

Usually, you need to first expand fonts to curves using some ps2ps-like 
script, and then use pstoedit to convert to something that can be converted 
to svg. Unfortunately, most conversion tools are rather immature, so you will 
need some experimenting to make it work. IIRC, I managed to generate valid 
svg with this method for my master's thesis, using a lilypond version around 
2.6. I don't remember the exact combination of commands that worked though.

(I have vague memories that it may be good to start with pdf output and 
convert it back to eps)

Here's a script that works for some subsets of ps (not lily's though), you can 
look at it for ideas:

If you manage to find a fairly reliable path to convert the output of a recent 
lily version into wikipedia-usable SVGs, I'd be happy to know.


reply via email to

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