[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: embedded-ps stencil confusion
From: |
Mats Bengtsson |
Subject: |
Re: embedded-ps stencil confusion |
Date: |
Sun, 05 Oct 2008 23:02:06 +0200 |
User-agent: |
Thunderbird 2.0.0.17 (X11/20080925) |
I was just about to propose the following alternative solution,
which only uses features that are actually described in the
manual (more or less well hidden, though). However, then I
noticed that it didn't give exactly the same output. First of all,
it gives squares that are centered below the stem, secondly
no ledger lines are shown. Your solution handles both these
aspects better. Can anyone explain why there's a difference?
squareNoteHeads = {
\override NoteHead #'stencil = #ly:text-interface::print
\override NoteHead #'text = \markup{ \postscript #"gsave
currentpoint translate
newpath
-0.5 -0.5 moveto
-0.5 0.5 lineto
0.5 0.5 lineto
0.5 -0.5 lineto
closepath
fill
stroke
grestore" }
}
Note that you can skip some lines in the postscript code, just
as I did above.
/Mats
Mark Polesky wrote:
Ha! I figured it out...
- Mark
---------------------------------------
\version "2.11.61-1"
squareNoteHeads = {
\override Voice.NoteHead #'stencil =
#(ly:make-stencil
(list 'embedded-ps
"gsave
currentpoint translate
BeginEPSF
%%BeginDocument:
newpath
-0.5 -0.5 moveto
-0.5 0.5 lineto
0.5 0.5 lineto
0.5 -0.5 lineto
closepath
fill
stroke
%%EndDocument
EndEPSF
grestore")
(cons -0.5 0.5)
(cons -0.5 0.5))
}
{ \squareNoteHeads c'' }
_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user
--
=============================================
Mats Bengtsson
Signal Processing
School of Electrical Engineering
Royal Institute of Technology (KTH)
SE-100 44 STOCKHOLM
Sweden
Phone: (+46) 8 790 8463
Fax: (+46) 8 790 7260
Email: address@hidden
WWW: http://www.s3.kth.se/~mabe
=============================================