lilypond-user
[Top][All Lists]
Advanced

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

Re: Postsctipt arrows


From: David Nalesnik
Subject: Re: Postsctipt arrows
Date: Fri, 13 Mar 2015 21:56:54 -0500



On Fri, Mar 13, 2015 at 9:43 PM, David Nalesnik <address@hidden> wrote:


Spoke too soon:

 \version "2.19.16"

arrowdef = "/arrowdict 14 dict def arrowdict begin
/mtrx matrix def end
/arrow
{ arrowdict begin
/headlength exch def /halfheadthickness exch 2 div def /halfthickness exch 2 div def
/tipy exch def /tipx exch def
/taily exch def /tailx exch def
/dx tipx tailx sub def
/dy tipy taily sub def
/arrowlength dx dx mul dy dy mul add
sqrt def
/angle dy dx atan def
/base arrowlength headlength sub def
/savematrix mtrx currentmatrix def
tailx taily translate angle rotate
0 halfthickness neg moveto
base halfthickness neg lineto base halfheadthickness neg lineto arrowlength 0 lineto
base halfheadthickness lineto base halfthickness lineto
0 halfthickness lineto
closepath
savematrix setmatrix end
} def" 

myarrow = #(string-append arrowdef " 0 0 20 4 0.3 1.2 1.2 arrow stroke")

{
  c-\markup { \postscript #myarrow }
}


You will probably want to use this in conjunction with \with-dimensions so the markup affects spacing.  See for example http://lsr.di.unimi.it/LSR/Snippet?id=435

--David


reply via email to

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