Urs,

On Mon, Dec 5, 2016 at 7:54 AM, Mike Solomon [via Lilypond] <
ml-node+s1069038n197630...@n5.nabble.com> wrote:

> Hey!
>
> Total hack, but if you check out scm/stencil.scm, you’ll see how
> parentheses are made…
>
> (define-public (parenthesize-stencil
>                 stencil half-thickness width angularity padding)
>   "Add parentheses around @var{stencil}, returning a new stencil."
>   (let* ((y-extent (ly:stencil-extent stencil Y))
>          (lp (make-parenthesis-stencil
>               y-extent half-thickness (- width) angularity))
>          (rp (make-parenthesis-stencil
>               y-extent half-thickness width angularity)))
>     (set! stencil (ly:stencil-combine-at-edge stencil X LEFT lp padding))
>     (set! stencil (ly:stencil-combine-at-edge stencil X RIGHT rp padding))
>     stencil))
>
> So it looks like you can substitute in make-connected-path-stencil for
> make-parenthesis-stencil, using sensible parameters for the connected path
> based on the y extent and the width.
>

Here's another option for you that I created recently that creates brackets
roughly the same size as the real parentheses glyphs, so I think it (the
second one I describe in that message) tends to look a little better than
relying on the stencil of the accidental because, for example, you'll get
very different results for a flat glyph vs. a natural glyph (as will Mike's
code):
http://lists.gnu.org/archive/html/lilypond-user/2016-11/msg00928.html

Best,
Abraham




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Accidental-in-brackets-tp197629p197639.html
Sent from the User mailing list archive at Nabble.com.
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to