home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fonts 1
/
freshfonts1.bin
/
bbs
/
programs
/
amiga
/
metafont.lha
/
MF
/
INPUTS
/
MISC
/
feynmf.mf
< prev
next >
Wrap
Text File
|
1994-06-09
|
25KB
|
760 lines
%%
%% This is file `feynmf.mf', generated
%% on <1994/6/9> with the docstrip utility (2.2h).
%%
%% The original source files were:
%%
%% feynmf.dtx (with options: `base')
%%
%% Copyright (C) 1989, 1990, 1992-1994 by Thorsten.Ohl@Physik.TH-Darmstadt.de
%%
%% This file is NOT the source for feynmf, because almost all comments
%% have been stripped from it. It is NOT the preferred form of feynmf
%% for making modifications to it.
%%
%% Therefore you can NOT redistribute and/or modify THIS file. You can
%% however redistribute the complete source (feynmf.dtx and feynmf.ins)
%% and/or modify it under the terms of the GNU General Public License as
%% published by the Free Software Foundation; either version 2, or (at
%% your option) any later version.
%%
%% Feynmf is distributed in the hope that it will be useful, but
%% WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%% GNU General Public License for more details.
%%
%% You should have received a copy of the GNU General Public License
%% along with this program; if not, write to the Free Software
%% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% \CheckSum{425}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
vardef parse_RCS (suffix RCS) (expr s) =
save n, c;
numeric n, RCS[];
string c;
RCS[0] := 0;
for n = 1 upto length (s):
c := substring (n-1,n) of s;
exitif ((RCS[0] > 0) and (c = " "));
if ((c = "0") or (c = "1") or (c = "2")
or (c = "3") or (c = "4") or (c = "5")
or (c = "6") or (c = "7") or (c = "8")
or (c = "9")):
if RCS[0] = 0:
RCS[0] := 1;
RCS[RCS[0]] := 0;
fi
RCS[RCS[0]] := 10 * RCS[RCS[0]] + scantokens (c);
elseif c = ".":
RCS[0] := RCS[0] + 1;
RCS[RCS[0]] := 0;
else:
fi
endfor
enddef;
vardef require_RCS_revision expr s =
numeric n;
save TeX_rev, mf_rev;
parse_RCS (TeX_rev, s);
parse_RCS (mf_rev, "1.5");
for n = 1 upto min (2, TeX_rev[0], mf_rev[0]):
if TeX_rev[n] > mf_rev[n]:
errhelp
"Your version of `feynmf.sty' is higher that of your `feynmf.mf'.";
errmessage "feynmf: Metafont macros out of date";
elseif TeX_rev[n] < mf_rev[n]:
errhelp
"Your version of `feynmf.mf' is higher that of your `feynmf.sty'.";
errmessage "feynmf: LaTeX style out of date";
fi
exitif (TeX_rev[n] <> mf_rev[n]);
endfor
enddef;
mode_setup;
thin#:=1pt#; % dimension of the lines
thick#:=2thin#;
arrow_width#:=3thick#; % arrows
arrow_height#:=2arrow_width#;
curly_len#:=3mm#;
dash_len#:=3mm#; % 'photon' lines
dot_len#:=2mm#; % 'photon' lines
wiggly_len#:=4mm#; % 'photon' lines
wiggly_slope:=60;
shade_black#:=1pt#; % shading
shade_white#:=2shade_black#;
shade_angle:=60;
define_blacker_pixels (thick, thin, shade_black, shade_white,
dash_len, dot_len, wiggly_len, curly_len,
arrow_height, arrow_width);
LaTeX_unitlength := mm;
vardef count (text list) =
forsuffixes $ = list: + 1 endfor
enddef;
vardef getopt (suffix opt) (expr s) =
numeric opt.first, opt.last, n;
string opt[], opt[]arg, c;
boolean argp, escape;
opt.first := 0;
opt.last := 0;
opt[opt.last] := "";
argp := false;
escape := false;
for n = 1 upto length (s):
c := substring (n-1,n) of s;
if not escape and (c = ","):
if substring (n,n+1) of s = ",":
escape := true;
else:
opt.last := opt.last + 1;
opt[opt.last] := "";
argp := false;
fi
elseif not argp and (c = "="):
opt[opt.last]arg := "";
argp := true;
elseif argp or (c <> " "):
if argp:
opt[opt.last]arg := opt[opt.last]arg & c;
else:
opt[opt.last] := opt[opt.last] & c;
fi
escape := false;
fi
endfor
enddef;
def save_picture text t =
save t; picture t; forsuffixes p=t: p:=nullpicture; endfor
enddef;
def begin_sketch =
begingroup save_picture currentpicture;
sketchlevel := sketchlevel+1;
enddef;
def end_sketch =
sketchlevel := sketchlevel-1;
sketchpad[sketchlevel] := currentpicture;
endgroup
enddef;
picture sketchpad[];
sketchlevel := 1;
vardef use_sketch text t =
addto currentpicture also (sketchpad[sketchlevel] t)
enddef;
vardef shade expr p_arg =
save x,y,d,p,currentpen; path p; pen currentpen; % push pen!
pickup pencircle scaled shade_black;
p = p_arg rotated - shade_angle; % calculate enclosing rectangle
x2' = x3' = xpart directionpoint up of p; % (rotated by |shade_angle|).
x1' = x4' = xpart directionpoint down of p;
y1' = y2' = ypart directionpoint right of p;
y3' = y4' = ypart directionpoint left of p;
forsuffixes $=1,2,3,4: z$ = z$' rotated shade_angle; endfor
d = abs(z1-z4); % height.
begin_sketch % fill rectangle with lines.
for k=shade_white/d step (shade_white+shade_black)/d
until 1 - shade_white/d:
cutdraw k[z1,z4] -- k[z2,z3];
endfor
cullit;
fill p_arg;
unfill z1--z2--z3--z4--cycle;
cullit;
end_sketch;
use_sketch;
enddef;
vardef arrow =
clearxy; % push 'em!
x1 - x2 = arrow_height; y2 - y3 = arrow_width;
x1 = -3x2; x2 = x3; y1 = y2 + y3 = 0; % center it!
z1--z2--z3--cycle
enddef;
vardef cut_circles (expr diam_a, p_arg, diam_b) =
subpath (xpart(p_arg intersectiontimes fullcircle scaled diam_a
shifted point 0 of p_arg),
xpart(p_arg intersectiontimes fullcircle scaled diam_b
shifted point infinity of p_arg))
of p_arg
enddef;
vardef make_blob (expr z_arg, diameter) =
save p,currentpen; path p; pen currentpen;
pickup pencircle scaled thick;
p = fullcircle scaled diameter shifted z_arg;
draw p; shade p;
enddef;
vardef draw_blob (expr z_arg, diameter) =
if sketched_blob_diameter <> diameter: % drawn lately?
begin_sketch make_blob (origin, diameter); end_sketch; % redo hard work!
sketched_blob_diameter:= diameter; % record it
fi
use_sketch shifted z_arg; % the easy way ...
enddef;
def force_new_blob = sketched_blob_diameter := -1; enddef;
force_new_blob; % initialize it.
vardef put_on_path (expr o_arg, p_arg) =
fill o_arg rotated angle direction length(p_arg)/2 of p_arg
shifted point length(p_arg)/2 of p_arg;
p_arg
enddef;
vardef pixlen (expr p, n) =
for k=1 upto length(p): + segment_pixlen (subpath (k-1,k) of p, n) endfor
enddef;
vardef segment_pixlen (expr p, n) =
for k=1 upto n: + a