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:andrew.bern...@gmail.com] 
Sent: Friday, 21 October 2016 11:05 AM
To: lilypond-user@gnu.org
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

 

 

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to