Debian Codegraph @

texmf-dist/fonts/source/public/musixtex-fonts/xslgen.mf

raw
1 %
2 % This file is part of MusiXTeX
3 %
4 % MusiXTeX is free software; you can redistribute it and/or modify
5 % it under the terms of the GNU General Public License as published by
6 % the Free Software Foundation; either version 2, or (at your option)
7 % any later version.
8 %
9 % MusiXTeX is distributed in the hope that it will be useful,
10 % but WITHOUT ANY WARRANTY; without even the implied warranty of
11 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 % GNU General Public License for more details.
13 %
14 % You should have received a copy of the GNU General Public License
15 % along with MusiXTeX; see the file COPYING. If not, write to
16 % the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 % Boston, MA 02111-1307, USA.
18 %
19 % WpH May, 19, 1997 modified to be dashed.
20 %
21
22 min_bow:= internote;
23 max_bow:=3internote;
24 slope:=17.5/100;
25 gap:=thick; %Wph length of space between dashes.
26 dash:=1.6thick; %Wph Length of each rising or falling dash.
27 pointendl:=dash; %WpH length of first and last dash.
28 centerdashl:=-dash; %WpH length of center dash.
29 if unknown makedotted: makedotted:=0; fi % WpH
30 path outerpath, innerpath; %Wph declaration of path variables.
31
32 code=-1;
33
34 for iht=1 upto 8:
35 for iwd=0 upto 15:
36 beginchar(incr code, 0, 0, 0);
37 mw#:=(minwidth+iwd*delwidth)*pt#;
38 define_pixels(mw);
39 x1 = y1= 0; x3= mw; y3= 2y2'= iht*internote; x2'= .5x3;
40 mheight:=y3;
41 z2-z2'= whatever*dir(angle(z3-z1)+90);
42 my_bow:=min(max_bow, slope*mw);
43 my_bow:=max(my_bow, min_bow);
44 z1'=(z1-(0,my_bow)) rotated angle(z3-z1);
45 (z1'-z2)=whatever*(z1-z2');
46 penpos1(.15thick,(angle(z3-z1)+90));
47 penpos2(thick,(angle(z3-z1)+90));
48 penpos3(.15thick,(angle(z3-z1)+90));
49 penstroke (flex(z1e,z2e,z3e));
50 %{{{
51 currentpen:= pencircle;
52 draw (flex(z1,z2,z3));% draw z1--z3; draw z2'--z2--z1'--z1;
53 %}}}
54 %
55 % WpH start of added block to make gaps.
56 if makedotted<>1:
57 % variable makedotted has not been given a value.
58 % Dotted lines will not be made.
59 else:
60 cullit;
61 outerpath:= flex(z1r,z2r,z3r);
62 innerpath:= flex(z1l,z2l,z3l);
63 cl:=abs(z2-z1); %apporximate curve length/2
64 tcount:=(cl-pointendl-0.5centerdashl)/(gap+dash); % number of gaps on rise or fall.
65 tcount:=floor(tcount + .5); %round to nearest int number
66 tinc:=((cl-pointendl-.5centerdashl)/tcount);
67 pickup pencircle scaled gap;
68 for k=0 upto tcount-1:
69 tt:=((pointendl + .5gap) + k*tinc)/(cl);
70 undraw (point tt of outerpath)..(point tt of innerpath);
71 undraw (point (2-tt) of outerpath)..(point (2-tt) of innerpath);
72 %
73 % I expected the undraw statements to be the following. If the
74 % other code fails on your version of metafont, try this:
75 %
76 % undraw (point .5tt of outerpath)..(point .5tt of innerpath);
77 % undraw (point (1-.5tt) of outerpath)..(point (1-.5tt) of innerpath);
78 %
79 endfor;
80 cullit;
81 fi
82 % Wph End of added block to make gaps.
83 %
84 currentpicture:=currentpicture t;
85 p:=currentpicture;
86 endchar;
87
88 beginchar(code+128, 0, 0, 0);
89 currentpicture:=p T;
90 endchar;
91
92 endfor
93 endfor
94 end