lilypond-user
[Top][All Lists]
Advanced

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

embedded-ps stencil confusion


From: Mark Polesky
Subject: embedded-ps stencil confusion
Date: Fri, 3 Oct 2008 20:06:01 -0700 (PDT)

Hi.

I'd like to make my own stencils using PostScript
commands, but the documentation on this topic isn't
quite there yet, I guess. I don't understand how
the "string" passed to 'embedded-ps is supposed to
be formatted. 

I'm using the ps backend, and the relevant lines in
/scm/output-ps.scm (lines 129-130) are pretty sparse:

(define (embedded-ps string)
  string)

Here's my naive attempt, which is clearly wrong. No
error messages are generated, but no stencil appears. 
My example here would be a square note-head, but it's 
just an example. That is to say, I don't need work-
arounds or clever square note-head solutions; I just 
want to understand how to make embedded-ps stencils.

Thanks!
Mark



---------------------------------------

\version "2.11.61-1"

squareNoteHeads = {
  \override Voice.NoteHead #'stencil =
  #(ly:make-stencil
  (list 'embedded-ps "newpath
                      -0.5 -0.5 moveto
                      -0.5  0.5 lineto
                       0.5  0.5 lineto
                       0.5  0   lineto
                      closepath
                      fill
                      stroke")
  (cons (- 1) 1)
  (cons (- 1) 1))
}

{ \squareNoteHeads c'' }


      




reply via email to

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