bug-lilypond
[Top][All Lists]
Advanced

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

bad number formatting in svg path output


From: lpietsch
Subject: bad number formatting in svg path output
Date: Thu, 6 Mar 2014 10:50:37 -0800 (PST)

There may be a bug in scm/output-svg.scm, in the function that processes
stencil expressions created with "(ly:create-stencil '(path ...))". If a
coordinate in the path expression happens to be the result of a Scheme
computation that is a fractional rational number, it will be written into
the SVG output literally as a Scheme fraction (e.g. "3/2"). SVG does not
understand this format.

Test snippet:

\once \override NoteHead.stencil = 
   #(ly:make-stencil `(path 0.2
            '(moveto 0 0
              rlineto 0 ,(/ 3 2))
            'round 'round #f)
         '(-0.1 . 0.1)'(0 . 1.5))
c4

This stencil will not display in SVG output, though it does display fine in
PS and PDF. 

A possible fix may be to change line 86 of /scm/output-svg.scm to force
output as a decimal number. Change from:

        (cons (format #f "~S ~S" (car lst) (- (cadr lst)))

to:

        (cons (ly:format "~4f ~4f" (car lst) (- (cadr lst)))

Lukas





--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/bad-number-formatting-in-svg-path-output-tp160185.html
Sent from the Bugs mailing list archive at Nabble.com.



reply via email to

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