[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: output-attributes in 2.20.0
From: |
David Kastrup |
Subject: |
Re: output-attributes in 2.20.0 |
Date: |
Sun, 02 Aug 2020 14:32:27 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Richard Shann <richard@rshann.plus.com> writes:
> I'm trying to get the annotated SVG output that enables playback with a
> scrolling LilyPond score working in 2.20.
>
> In the changes http://lilypond.org/doc/v2.20/Documentation/changes/inde
> x.html I read:
>
> "A new output-attributes grob property is now used for svg output
> instead of the id grob property. It allows multiple attributes to be
> defined as an association list. For example, #'((id . 123) (class .
> foo) (data-whatever . “bar”)) will produce the following group tag in
> an SVG file: <g id=“123” class=“foo” data-whatever=“bar”> … </g>"
>
> but I see that the convert-ly changes this:
>
> \override NoteHead.id = #note-id
>
> to this:
>
> \override Score.NoteHead.output-attributes.id = #note-id
>
> which is not an alist.
Why would output-attributes not be an alist?
> Moreover, in the code I'm using
> (http://git.savannah.gnu.org/gitweb/?p=denemo.git;a=blob;f=actions/lilypond/live-score.ily;h=5a9d22fe5efe89e9f63a087177d206eab63109f0;hb=HEAD)
>
> note-id is a procedure returning a string, which seems to be
> acceptable to the 2.18 SVG generator while the 2.20 version gives an
> error message:
>
> Unsupported SCM value for format: #<procedure note-id (grob)>
Callbacks are not supported for subproperties.
> and the output in the SVG is an empty string:
>
> <g id="">
>
> while with 2.18
>
> the output was (for example)
>
> <g id="Note-7-2">
>
> where "Note-7-2" is the return value for the particular grob - the line
> 7 column 2 location information.
>
> What's more, if I write an alist value (following the documentation
> above)
You are not following the documentation. You are presuming that the
documentation is wrong, substitute what you consider a correction, and
the result does not work.
> \override Score.NoteHead.output-attributes.id = #'((id . "foo"))
>
> I get the error:
>
> Unsupported SCM value for format: ((id . foo))
Because you set output-attributes to ((id . ((id . "foo")))) rather than
to ((id . "foo")).
> So what should output-attributes.id be set to - can it take a procedure
> as id could in 2.18?
output-attributes can take a procedure (which must return a complete
alist). id doesn't.
--
David Kastrup