2016-12-14 21:59 GMT+01:00 David Nalesnik <david.nales...@gmail.com>: > On Wed, Dec 14, 2016 at 2:57 PM, David Nalesnik > <david.nales...@gmail.com> wrote: >> Hi Simon, >> >> On Wed, Dec 14, 2016 at 2:20 PM, Simon Albrecht <simon.albre...@mail.de> >> wrote: >>> Hello everybody, >>> >>> I’d like to add a caesura sign on top of a barline by modifying the >>> barline’s stencil. Here’s my attempt: >>> >>> %%%%%%%%%%%%%%%%%% >>> \version "2.19.49" >>> >>> { >>> 1 >>> \once\override BarLine.stencil = >>> #(ly:stencil-combine-at-edge >>> ly:bar-line::print >>> 1 ; y-axis >>> 1 ; on top >>> (interpret-markup layout props (make-musicglyph-markup >>> "scripts.caesura.curved")) >>> 2) %padding >>> 1 >>> } >>> %%%%%%%%%%%%%%%%%% >>> >>> However, layout is an unbound variable here (and so is props, I assume). How >>> to do it correctly? >>> >> >> Try: >> >> { >> 1 >> \once\override Staff.BarLine.stencil = >> #(lambda (grob) >> (let ((layout (ly:grob-layout grob))) >> (ly:stencil-combine-at-edge >> (ly:bar-line::print grob) >> 1 ; y-axis >> 1 ; on top >> (interpret-markup >> layout >> (ly:grob-alist-chain grob (ly:output-def-lookup layout >> 'text-font-defaults)) >> (make-musicglyph-markup "scripts.caesura.curved")) >> 2))) %padding >> 1 >> } >> >> Best, >> David > > > For documentation, look at ly:text-interface::interpret-markup here: > http://lilypond.org/doc/v2.18/Documentation/internals/scheme-functions
You could also use 'grob-interpret-markup' from output-lib.scm. Usually I's recommend to use ly:stencil-aligned-to as well, to get a center-aligned stencil. But the font-metrics for "scripts.caesura.curved" are not symmetric. Anyway here the code using both (\box only for checking) \once\override Staff.BarLine.stencil = #(lambda (grob) (ly:stencil-combine-at-edge (ly:bar-line::print grob) 1 ; y-axis 1 ; on top (ly:stencil-aligned-to (grob-interpret-markup grob #{ \markup \box \musicglyph #"scripts.caesura.curved" #}) X CENTER) 2)) Cheers. Harm _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user