lilypond-devel
[Top][All Lists]
Advanced

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

Re: Cropped SVG Output


From: David Sankel
Subject: Re: Cropped SVG Output
Date: Wed, 28 Oct 2015 14:14:36 -0600

On Sun, Oct 18, 2015 at 2:30 AM, Federico Bruni <address@hidden> wrote:

> Il giorno sab 17 ott 2015 alle 20:05, David Sankel <address@hidden> ha
> scritto:
>
>>
>>>> The problem I'm running into is that the SVG output option produces a
>>>> SVG
>>>> file with a length and width of the entire page that I'm trying to
>>>> render.
>>>> The PNG output, on the other hand, crops the score to the area with
>>>> visible
>>>> elements on it. Of course, when embedding, I'm looking for a visible
>>>> area
>>>> crop. Does anyone know if a cropped SVG output is possible?
>>>>
>>>
>>> yes, try:
>>>
>>> lilypond -dpreview -dbackend=svg test.ly
>>>
>>
>> Thanks. That looked promising but it unfortunately that didn't change the
>> output at all.
>>
>
> you must check the .preview.svg file
> the problem is that you get only the first system, as Urs already pointed
> out
>


Thanks for clearing that up. I'm happy to work on a patch that dumps a
"preview" of all systems, but I'm a bit stuck as to how. I'm looking at
'framework-svg.scm' here:

(define (output-preview-framework basename book scopes fields)
  (let* ((paper (ly:paper-book-paper book))
         (systems (relevant-book-systems book))
         (to-dump-systems (relevant-dump-systems systems)))
    (dump-preview paper
                  (stack-stencils Y DOWN 0.0
                                  (map paper-system-stencil
                                       (reverse to-dump-systems)))
                  (format #f "~a.preview.svg" basename))))


Is the first system being selected by the 'relevant-dump-systems' call?
That seems to filter through all systems looking for one with an "is-title"
property. What is the "is-title" property and when would a system have it?

As an aside, I'm finding it difficult to penetrate this code base. Any
suggestions on how to get started?

-- David Sankel


reply via email to

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