lilypond-devel
[Top][All Lists]
Advanced

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

Alternative for parentheses-item::calc-parenthesis-stencils


From: Thomas Morley
Subject: Alternative for parentheses-item::calc-parenthesis-stencils
Date: Sat, 3 Feb 2018 13:23:42 +0100

Hi all,

currently ParenthesesItem.stencils is set to
parentheses-item::calc-parenthesis-stencils, which basically returns
font-glyphs. The only method to customize those glyphs is to apply
different font-size.
As far as I know we don't have an alternative for
parentheses-item::calc-parenthesis-stencils.
On -user I proposed `parentheses-item::bracket-stencils'
http://lists.gnu.org/archive/html/lilypond-user/2018-02/msg00065.html

#(define parentheses-item::bracket-stencils
  (lambda (grob)
    (let* ((details (ly:grob-property grob 'details))
           (protrusion (assoc-get 'protrusion details 0.2))
           (thick (ly:grob-property grob 'thickness 0.1))
           (shorten-pair (ly:grob-property grob 'shorten-pair '(0 . 0)))
           (half-y (magstep (ly:grob-property grob 'font-size)))
           (bracket-y-ext
             (cons
               (- (- half-y (car shorten-pair)))
               (- half-y (cdr shorten-pair)))))
      (list
        (ly:bracket Y bracket-y-ext thick protrusion)
        (ly:bracket Y bracket-y-ext thick (- protrusion))))))


It uses ly:bracket and may be customized by overrides for 'font-size,
'thickness and 'shorten-pair for fine-tuning.
Additionally I added the possibility to tweak the bracket-angels-width
by 'details.protrusion.

I'd like to put up a patch containing the above, in order to offer the
user a bracket-style ParenthesesItem.
Not sure about 'details.protrusion, though. One could go for 'width
instead or introduce 'bracket-width or the like.

How are thoughts about implementing it?

Cheers,
  Harm



reply via email to

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