lilypond-user
[Top][All Lists]
Advanced

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

Re: Thickness of tick style barlines


From: Thomas Morley
Subject: Re: Thickness of tick style barlines
Date: Fri, 3 Jun 2016 23:18:41 +0200

2016-06-03 15:40 GMT+02:00 Andrew Bernard <address@hidden>:
> When using tick barlines:
>
>       \set Timing.defaultBarType = "'"
>
> how does one adjust the thickness, and the length?
>
> Andrew


You can't. Thickness and length are taken from
ly:staff-symbol-line-thickness and ly:staff-symbol-staff-space.

You could redefine it ofcourse:

\version "2.19.36"

#(define (calc-blot thickness extent grob)
  "Calculate the blot diameter by taking @code{'rounded}
and the dimensions of the extent into account."
  (let* ((rounded (ly:grob-property grob 'rounded #f))
         (blot (if rounded
                   (let ((blot-diameter (layout-blot-diameter grob))
                         (height (interval-length extent)))

                     (cond ((< thickness blot-diameter) thickness)
                           ((< height blot-diameter) height)
                           (else blot-diameter)))
                   0)))

    blot))

#(define ((make-tick-bar-line x y) grob extent)
  "Draw a tick bar line."
  (let* ((half-staff (* 1/2 (ly:staff-symbol-staff-space grob)))
         (staff-line-thickness (ly:staff-symbol-line-thickness grob))
         (height (interval-end extent))
         (blot (calc-blot staff-line-thickness extent grob)))

    (ly:round-filled-box (cons 0 (+ x staff-line-thickness))
                         (cons (- height (+ y half-staff)) (+ height y
half-staff))
                         blot)))

#(add-bar-glyph-print-procedure "'" (make-tick-bar-line 0.2 1))
#(define-bar-line "'" "'" #f #f)

{
    r1
    \bar "'"
    r1
}

HTH,
  Harm



reply via email to

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