lilypond-devel
[Top][All Lists]
Advanced

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

Overriding a pure print callback


From: Nicolas Sceaux
Subject: Overriding a pure print callback
Date: Mon, 26 Dec 2011 00:08:26 +0100

Hi,

I have in my tool box some overriden stencil functions, in particular
for bar lines (to define custom baroque repeat bars).

Now, some things seem to have changed since 2.15.20, with respect to
pure things, which show strange behavior when overriding the BarLine
stencil callback, with a function doing just the same thing:

\version "2.15.24"

#(define-public (bar-line::custom-print grob)
   (ly:bar-line::print grob))

\layout {
  \context {
    \Staff
    \override BarLine #'stencil = #bar-line::custom-print
  }
}

{ \key d \minor
  \time 3/4
  \set Score.skipBars = ##t
  R2.*8 \bar ":|" R2.*16 \bar "|." }

PNG image


It seems that we now have to somehow register custom callbacks as being
something special, e.g. by patching scm/define-grobs to export symbol
`pure-print-callbacks' and doing:

#(set! pure-print-callbacks (cons bar-line::custom-print pure-print-callbacks))

Then, the above example works as expected:

PNG image



My questions is, what is the proper way to define a custom callback for
e.g. the BarLine stencil property?

Nicolas


reply via email to

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