lilypond-user
[Top][All Lists]
Advanced

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

Re: \draw-line with non-rounded cap


From: Simon Albrecht
Subject: Re: \draw-line with non-rounded cap
Date: Thu, 22 Dec 2016 18:12:43 +0100

On 22.12.2016 17:43, Kieren MacMillan wrote:
Hello all,

Is there a way to use the built-in \draw-line markup command, but with a square 
cap and not the [lovely!] rounded cap default?
Tried \override #'(line-cap-style . square), but that didn’t seem to work.

If you specifically want to use the built-in command, no, there’s no way. make-line-stencil, defined in scm/stencil.scm, doesn’t support changing line-cap-style. However, make-path-stencil and the \path markup command do, so I’d suggest creating a front-end taking the same arguments as \draw-line, with the additional line-cap-style property:

%%%%%%%%%%%
\version "2.19.53"
#(define-markup-command (path-draw-line layout props dest) (pair?)
   #:category graphic
   #:properties ((line-cap-style 'round)
                 (thickness 1))
   (interpret-markup layout props
     (markup
      #:override `(line-cap-style . ,line-cap-style)
      #:path thickness `((moveto 0 0)
                         (lineto ,(car dest) ,(cdr dest))))))

\markup { \override #'(line-cap-style . square) \path-draw-line #'(10 . -10) }
%%%%%%%%%%%%

HTH, Simon



reply via email to

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