bug-lilypond
[Top][All Lists]
Advanced

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

Re: Bracketized key signature: \key c \major causes a core dump


From: Rutger Hofman
Subject: Re: Bracketized key signature: \key c \major causes a core dump
Date: Fri, 2 Sep 2016 11:44:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

I guess I have been too zealous in minimizing my example that still produces a core dump. My original example is to have a bracketed keysig and later a bracketed key change to c \major (i.e. key cancellation), like so:

{
\override Staff.KeySignature.stencil = #(lambda (grob) (bracketify-stencil (ly:key-signature-interface::print grob) Y 0.1 0.2 0.1))
  \key ges \major
  ces4
  \key c \major
  c
}

In Harm's fix, there is no bracket around the \key c \major.

Rutger

On 09/02/2016 10:59 AM, Thomas Morley wrote:
\version "2.19.47"

%% not public, c/p from lily-library.scm
#(define (other-axis a)
  (remainder (+ a 1) 2))

%% doesn't makes sense to bracketify an empty stencil, hence we just return it.
#(define-public (bracketify-stencil stil axis thick protrusion padding)
  "Add brackets around @var{stil}, producing a new stencil."
  (if (ly:stencil-empty? stil)
      stil
      (let* ((ext (ly:stencil-extent stil axis))
             (lb (ly:bracket axis ext thick protrusion))
             (rb (ly:bracket axis ext thick (- protrusion))))
        (set! stil
              (ly:stencil-combine-at-edge stil (other-axis axis) 1 rb padding))
        (set! stil
              (ly:stencil-combine-at-edge stil (other-axis axis) -1 lb padding))
        stil)))

%%%%%%%%%%%%
%% Example
%%%%%%%%%%%%

\relative c'' {
  \override Staff.KeySignature.stencil = #(lambda (grob)
    (bracketify-stencil (ly:key-signature-interface::print grob) Y 0.1 0.2 0.1))

    \key c \major
    c''
}




reply via email to

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