lilypond-user
[Top][All Lists]
Advanced

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

RE: Line cap style in scheme


From: Andrew Bernard
Subject: RE: Line cap style in scheme
Date: Fri, 21 Oct 2016 11:31:22 +1100

So, in partial answer to my own question, we can achieve control over line cap style using a markup context, and the following code works fine:

 

          (if is-rest?

              empty-stencil

              (ly:stencil-add

               stil

               (grob-interpret-markup grob

                 (markup

                  #:override (cons (quote line-cap-style) (quote square))

                  (#:path

                   0.2

                   (list (list (quote moveto) start-x start-y)

                     (list (quote lineto) end-x end-y)))))))

 

However, I am still interested in the answer to my original question, if that is possible at all?

 

Andrew

 

 

 

From: Andrew Bernard [mailto:address@hidden
Sent: Friday, 21 October 2016 11:05 AM
To: address@hidden
Subject: Line cap style in scheme

 

I’m writing a function to make horizontal slashes through note stems.

 

The function make-line-stencil uses round end caps, but I prefer square or butt style. I have asked this question before on the list, but the pointers to possible answers referred to code for making markups, which is good, whereas I want to set the end cap style for a path stencil.

 

Here’s a fragment of the code in question (not meant to be a MWE, just to give the programming context):

 

          (if is-rest?

              empty-stencil

              (ly:stencil-add

               stil

               (make-path-stencil

                (list

                 'moveto start-x start-y

                 'lineto end-x end-y)

                thickness 1 1 #t)

               ))

 

Is it possible to inject calls here to set the postscript line cap style?

 

Andrew

 

 


reply via email to

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