[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bad number formatting in svg path output
From: |
Ralph Palmer |
Subject: |
Re: bad number formatting in svg path output |
Date: |
Tue, 11 Mar 2014 09:18:23 -0400 |
On Thu, Mar 6, 2014 at 1:50 PM, lpietsch <address@hidden> wrote:
> 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
Greetings, Lukas - Thanks for the email. This has been submitted as Issue
3880 : https://code.google.com/p/lilypond/issues/detail?id=3880
Ralph