lilypond-user
[Top][All Lists]
Advanced

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

Postsctipt arrows


From: Andrew Bernard
Subject: Postsctipt arrows
Date: Fri, 13 Mar 2015 16:04:20 +1100

Greetings list,

I want to make many different types of arrows using PostScript. The following function from the Adobe Blue Book works very nicely for what I need. It’s quite general.

The question is, how do I incorporate something of this level of complexity this into a form where it can be invoked with \postscript in a \markup block?

%!PS-Adobe-3.0
/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

An example of use in raw PostScript:

newpath
318 340 72 340 10 30 72 arrow
fill

Andrew





reply via email to

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