[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: vertical half-brackets,Re: vertical half-brackets
From: |
Werner LEMBERG |
Subject: |
Re: vertical half-brackets,Re: vertical half-brackets |
Date: |
Mon, 20 Jun 2022 05:07:51 +0000 (UTC) |
> how about something simple but functional like this:
>
> chbracket =
> #(define-music-function (offset height width) (number? number? number?)
> (let* ((x0 -0.7)
> (x1 (+ x0 width))
> (y0 offset)
> (y1 (+ y0 height)))
> #{
> \tweak outside-staff-priority ##f
> -\markup {
> \with-dimensions-from \null
> \path #0.14
> #`((moveto ,x0 ,y1) (lineto ,x0 ,y0) (lineto ,x1 ,y0))
> }
> #}))
>
> { c'\chbracket #-1.4 #4 #1.2 c'\chbracket #1 #-2.5 #1.2 }
Nice, thanks! I've eventually used the following code, which is quite
similar to your suggestion, and which could be certainly improved and
streamlined :-)
```
#(define-markup-command (halfBracket layout props height)
(number?)
(interpret-markup layout props
(markup #:line (#:with-dimensions (cons 0 0) (cons 0 0)
(#:path 0.2
(list (list 'moveto -1 0)
(list 'lineto -1 -1)
(list 'lineto -1 (* height -1))
(list 'lineto -0.5 (* height -1))))))))
{ \clef bass d1^\markup \halfBracket #3 }
```
Werner