lilypond-user
[Top][All Lists]
Advanced

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

Multiple spaces disappear in SVG rendering


From: James Harkins
Subject: Multiple spaces disappear in SVG rendering
Date: Thu, 26 Feb 2015 13:35:15 +0800
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/24.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Interesting little discrepancy -- I just found that consecutive spaces in 
markup strings render correctly using the PDF backend, but get collapsed down 
to one space in SVG.

I'm documenting a live-coding library, mainly using Emacs org-mode + LaTeX, but 
I threw in a bit of LilyPond to make a figure showing how the text notation of 
rhythm translates into notated rhythms. Laying out the table was pretty easy. I 
didn't want to mess around with trying to find the exact page size by numbers, 
so I rendered to SVG and opened it in Inkscape (since it has an automatic "crop 
to contents" feature). Then I saw:

Source: \line { 7. \typewriter "\"--| -  |- --| -\"" }

PDF view: 7. "--| -  |- --| -"

SVG view: 7. "--| - |- --| -"

Whitespace is significant as a timing placeholder, so this was not acceptable. 
I tried non-breaking spaces; same result. Eventually I worked around it by 
inserting a zero-width space (U+200B) in between two regular spaces.

https://code.google.com/p/lilypond/issues/detail?id=1434 seems related, though 
it says it's for leading and trailing spaces. If in fact it's the same issue, 
probably the description to be updated to mention multiple consecutive spaces 
in the middle of a string.

hjh





reply via email to

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