lilypond-user
[Top][All Lists]
Advanced

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

Re: Postsctipt arrows


From: Andrew Bernard
Subject: Re: Postsctipt arrows
Date: Sat, 14 Mar 2015 12:31:00 +1100

Why do I get the feeling nobody is going to answer this? In all seriousness, I don’t know enough about lilypond to know if this is even possible or not, which is a dark state of ignorance. If the Scheme gods could let me know if I am barking up an entirely impossible tree, that may save me from wandering in the wilderness. The archives seem very silent on this topic.

Thanks!

Since I discovered lilypond postscript units are staff-spaces and not points, and that the postscript coordinate origin is at the reference point of the ground in question, a better example of showing an arrow is:

0 0 20 4 0.3 1.2 1.2 arrow

So, in short, I need to understand if it is possible to pass parameters (seven in this case) to a postscript procedure in the context of a markup _expression_.


Andrew



On 13 March 2015 at 16:04:30, Andrew Bernard (address@hidden) wrote:

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]