staff lines missing when importing svg from lilypond

Bug #234562 reported by Victor
4
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Felipe "Juca" Sanches
Nominated for 0.46.x by Felipe "Juca" Sanches

Bug Description

Lilypond creates music notation and has the ability to export to svg. Some otf fonts (provided with lilypond) must be present in ~/.fonts in order for inkscape to interpret these files. All works well in versions up to 0.45 included. In 0.46, the staff lines do not show up anymore. I suppose it is not linked to lilypond, because reverting to inkscape 0.45 solves the problem. Attached is a sample file.

Tags: fonts
Revision history for this message
Victor (vic-tor) wrote :
Revision history for this message
sas (sas-sas) wrote :

I think this is bug 174720, which is fixed.

But I can't test this, because when I try to open your file in the latest development version (on Windows XP), Inkscape dies instantly (segmentation fault), with the following on stderr:

** (inkscape.exe:2940): WARNING **: <font-face>: SP_ATTR_UNITS_PER_EM: 1000.000000

** (inkscape.exe:2940): WARNING **: <font-face>: SP_ATTR_X_HEIGHT: 265.000000

** (inkscape.exe:2940): WARNING **: <font-face>: SP_ATTR_ASCENT: 800.000000

** (inkscape.exe:2940): WARNING **: <font-face>: SP_ATTR_DESCENT: -200.000000

** (inkscape.exe:2940): WARNING **: <font-face>: SP_ATTR_UNDERLINE_POSITION: -100.000000

** (inkscape.exe:2940): WARNING **: <font-face>: SP_ATTR_UNDERLINE_THICKNESS: 50.000000

But this appears to be an unrelated problem, presumably caused by the current work on adding SVG font support.

I'm assigning this to Felipe Sanches (who is doing the work on SVG fonts), so that he can hopefully fix the crash. Then we can see if the staff lines are rendering correctly.

Changed in inkscape:
assignee: nobody → felipe-sanches
Revision history for this message
Felipe "Juca" Sanches (felipe-sanches) wrote :

well... looking at the file you attached I don't see how could this be properly rendered on inkscape 0.45 since this file uses the SVGFonts feature which is not implemented yet! (this is exactly the subject of my Summer of Code project)

You can see at the defs section in the file (using a text editor or the xml editor) that there are svg:font and related tags. These aren't guaranteed to work until the end of the summer :-D ? Sorry about the crash. I am not sure exactly what is causing it, but fixing it wont give you rendering automatically, since it is not implemented yet. I have a local working copy that is a little better than the svn current trunk, but I haven't commited it yet. I sent the patch to the -devel mailing list.

Try to figure out whether lilypond has a preference setting for not using SVGFonts when exporting to SVG.

Revision history for this message
Felipe "Juca" Sanches (felipe-sanches) wrote :

Batik is an SVG viewer which has already implemented the SVGFonts feature. But even batik does not render this file.

It gives us lots of error messages such as this one:

SVG Error:
file:/home/felipe/Desktop/NiceTune.svg:
The attribute "style" represents an invalid CSS declaration ("font-family:Schoolbook;font-style:L;font-size:2.19953140378937;text-anchor:west").
Original message:
The "L" identifier is not a valid value for the "font-style" property.

Revision history for this message
Victor (vic-tor) wrote :

Here is a very basic file, with a png export from 0.45. in the other one, there are also some numbers, repeat bars, brackets, etc. I hope it will make things easyer.

Revision history for this message
Victor (vic-tor) wrote :

Sorry. Appearently, you did not receive my previous post (sent directly from my mail adress. I'm not very familiar with launchpad yet !). Here it is :

I do not know what SVGFonts are, but the file was definetly rendered properly in Inkscape up to 0.45, and it still works if I revert back to this version. The same is true of other notation files I have checked (this one is just a sample). Could it be that they use two alternative mechanisms for selecting fonts, one that is and one that will be implemented?

Note that in 0.46, the problem is with the staff lines. The fonts used for noteheads, clefs, etc. are rendered just as usual. Are the lines also rendered through fonts ? (Pardon my ignorance ! )

As far as I could check in Lilypond's manual, it offers no option for controling the way svg output is generated.

Revision history for this message
sas (sas-sas) wrote :

SVG Fonts are a way of defining fonts inside an SVG file, so that an external font isn't required.

Inkscape 0.45 doesn't understand SVG Fonts, but will use the external font Emmentaler if it's available, which is why the file renders correctly in Inkscape 0.45 (provided the font is available).

Inkscape 0.46 should do the same, but fails to show the staff lines (which don't use fonts) due to a bug in the handling of currentColor (bug 174720).

Current development versions of Inkscape crash attempting to handle the SVG font, but if that font is removed they render the remainder of the file correctly. So the bug as originally reported is fixed, and is a duplicate of bug 174720. But we should probably leave the bug report open until the crash is fixed.

Revision history for this message
Victor (vic-tor) wrote :

Thanks for the explanation ! I will just wait for 0.47 then.

Revision history for this message
sas (sas-sas) wrote :

By the way, as a work-around, you can get this LilyPond file to render in 0.46 by opening it in a text editor and changing currentColor to #000 throughout. If you have a recent version of sed installed, you can just do:

sed -i -e "s/currentColor/#000/g" NiceTune.svg

Revision history for this message
Felipe "Juca" Sanches (felipe-sanches) wrote :

As of current svn revision (18736) the code is not crashing anymore. If you compile it without SVGFonts experimental support and install the system fonts it will render the NiceTune.svg file correctly. If you compile it with SVGFonts experimental support it wont render yet (because I am still implementing it) but at least wont crash also.

Revision history for this message
Felipe "Juca" Sanches (felipe-sanches) wrote :

inkscape 0.46.1 should completely remove the draft SVGFonts code.

Revision history for this message
Victor (vic-tor) wrote :

Thanks Felipe for working on it ! And thanks sas for the "sed" temporary fix ! Blue skyes to all the inkscape team !

Changed in inkscape:
status: New → In Progress
Revision history for this message
ScislaC (scislac) wrote :

The staff lines show up fine in r22270, closing as fix released.

Changed in inkscape:
status: In Progress → Fix Released
tags: added: fonts
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.