[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bracketized key signature: \key c \major causes a core dump
From: |
Thomas Morley |
Subject: |
Re: Bracketized key signature: \key c \major causes a core dump |
Date: |
Fri, 2 Sep 2016 15:20:52 +0200 |
2016-09-02 13:28 GMT+02:00 David Kastrup <address@hidden>:
> Thomas Morley <address@hidden> writes:
>
>> Below an in-file fix curing the symptoms.
>>
>> David, apart from fixing the internals, does it make sense to prepare
>> a patch for bracketify-stencil at the lines of:
>>
>> \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
>
> I'm not sure whether this would warrant a more detailed approach. For
> one thing, there probably should be a minimum height of the brackets so
> that they stay recognizable. For another, I would sort-of expect that
> an empty stencil is bracketed similarly to a point-stencil _except_ that
> the padding between the brackets is used only once instead of twice.
> Similarly for \hspace (use the given space plus _one_ padding).
>
> That's what feels natural and useful to me, but of course, other
> behaviors might also have a reasonable rationale.
>
> --
> David Kastrup
Not sure I agree, putting out something visible for bracketifying an
empty stencil feels strange to me. As a user I wouldn't expect it.
Otoh, there is the hspace-example...
I'm not decided yet.
Though, I did some further testing taking all procedures I could think
of wrapping something around a given stencil.
Tested them with empty stencil(s).
Below the test-code, the comments contain the (sometimes shortened)
terminal-output, if of interest.
One needs to uncomment the procedure one wants to test, couldn't think
of a better method...
\version "2.19.48"
#(define empty-stils (make-list 3 empty-stencil))
\relative c'' {
\override Staff.KeySignature.stencil = #(lambda (grob)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ok with:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
empty-stencil
;(stack-stencils Y DOWN 0 empty-stils)
;(stack-lines Y 0 0 empty-stils)
;(centered-stencil empty-stencil)
;(circle-stencil empty-stencil 0 0)
;(oval-stencil empty-stencil 0 0 0)
;(stencil-with-color empty-stencil red)
;(stencil-whiteout-outline empty-stencil 1 red 16 1)
;(stencil-whiteout-box empty-stencil)
;(stencil-whiteout empty-stencil)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; warnings/errors with
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;(stack-stencils-padding-list Y DOWN '(0 0) empty-stils)
;; programming error: Improbable offset for stencil: -inf staff space
;; Setting to zero.
;(box-stencil empty-stencil 0 0)
;; warning: Found infinity or nan in output. Substituting 0.0
;(rounded-box-stencil empty-stencil 0 0 0)
;; --> warning: Found infinity or nan in output. Substituting 0.0
;(flip-stencil X empty-stencil)
;; --> programming error: Improbable offset for stencil: -nan staff space
;(bracketify-stencil empty-stencil Y 0.1 0.2 0.1)
;; lilypond: /home/hermann/lilypond-git/lily/skyline.cc:94:
;; Building::Building(Real, Real, Real, Real):
;; Assertion `start_height == end_height' failed.
;; Aborted (core dumped)
;(parenthesize-stencil empty-stencil 1 1 1 1)
;; GNU LilyPond 2.19.48
;; Processing `atest-40.ly'
;; Parsing...
;; Interpreting music...
;; Preprocessing graphical objects...
;; programming error: Improbable offset for stencil: -nan staff space
;; Setting to zero.
;; continuing, cross fingers
;; programming error: Infinity or NaN encountered
;; continuing, cross fingers
;; atest-40.ly:254:5: programming error: Infinity or NaN encountered
;;
;; \key cis \major
;; atest-40.ly:254:5: continuing, cross fingers
;; programming error: Infinity or NaN encountered
;; continuing, cross fingers
;; programming error: Improbable offset for stencil: -nan staff space
;; Setting to zero.
;; continuing, cross fingers
;; programming error: Improbable offset for stencil: -nan staff space
;; Setting to zero.
;; continuing, cross fingers
;; programming error: Infinity or NaN encountered
;; continuing, cross fingers
;; Finding the ideal number of pages...
;; Fitting music on 1 page...
;; Drawing systems...
;; terminate called after throwing an instance of 'std::bad_alloc'
;; what(): std::bad_alloc
;; Aborted (core dumped)
;(ellipse-stencil empty-stencil 0 0 0)
;; --> warning: `(gs -q -dSAFER -dDEVICEWIDTHPOINTS=595.28
;; -dDEVICEHEIGHTPOINTS=841.89 -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH
;; -r1200 -sDEVICE=pdfwrite -sOutputFile=atest-40.pdf -c.setpdfwrite
;; -f/tmp/lilypond-9PnDdf)' failed (256)
;(box-grob-stencil (ly:grob-suicide! grob))
;; /scm/stencil.scm:617:16: In procedure ly:grob-extent in expression
;; (ly:grob-extent grob grob ...):
;; /scm/stencil.scm:617:16: Wrong type argument in position 1
;; (expecting Grob): #<unspecified>
)
\key cis \major
c''
}
Some cases are constructed, ofcourse. Not sure which ones really need fixing.
Cheers,
Harm