summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/fonts/source/public/musixtex-fonts/xslgen.mf
blob: 36096f1055dfd210f3d74564c682bf7fa2880f59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
%
%   This file is part of MusiXTeX
%
%   MusiXTeX is free software; you can redistribute it 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.
%
%   MusiXTeX 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 MusiXTeX; see the file COPYING.  If not, write to
%   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
%   Boston, MA 02111-1307, USA.
%
% WpH May, 19, 1997 modified to be dashed.
%

min_bow:= internote;
max_bow:=3internote;
slope:=17.5/100;
gap:=thick;                  %Wph length of space between dashes.
dash:=1.6thick;              %Wph Length of each rising or falling dash.
pointendl:=dash;             %WpH length of first and last dash.
centerdashl:=-dash;          %WpH length of center dash.
if unknown makedotted: makedotted:=0; fi % WpH
path outerpath, innerpath;   %Wph declaration of path variables.

code=-1;

for iht=1 upto 8:
  for iwd=0 upto 15:
    beginchar(incr code, 0, 0, 0);
      mw#:=(minwidth+iwd*delwidth)*pt#;
      define_pixels(mw);
      x1 = y1= 0; x3= mw; y3= 2y2'= iht*internote; x2'= .5x3;
      mheight:=y3;
      z2-z2'= whatever*dir(angle(z3-z1)+90);
      my_bow:=min(max_bow, slope*mw);
      my_bow:=max(my_bow, min_bow);
      z1'=(z1-(0,my_bow)) rotated angle(z3-z1);
      (z1'-z2)=whatever*(z1-z2');
      penpos1(.15thick,(angle(z3-z1)+90));
      penpos2(thick,(angle(z3-z1)+90));
      penpos3(.15thick,(angle(z3-z1)+90));
      penstroke (flex(z1e,z2e,z3e));  
%{{{
      currentpen:= pencircle;
      draw (flex(z1,z2,z3));% draw z1--z3; draw z2'--z2--z1'--z1;
%}}}
      %
      % WpH start of added block to make gaps.
    if makedotted<>1: 
        % variable makedotted has not been given a value.
        % Dotted lines will not be made.
    else:
          cullit;
          outerpath:= flex(z1r,z2r,z3r);    
          innerpath:= flex(z1l,z2l,z3l);    
          cl:=abs(z2-z1); %apporximate curve length/2
          tcount:=(cl-pointendl-0.5centerdashl)/(gap+dash); % number of gaps on rise or fall.
          tcount:=floor(tcount + .5); %round to nearest int number
          tinc:=((cl-pointendl-.5centerdashl)/tcount); 
          pickup pencircle scaled gap;
          for k=0 upto tcount-1:
            tt:=((pointendl + .5gap) + k*tinc)/(cl);
            undraw (point tt of outerpath)..(point tt of innerpath);
            undraw (point (2-tt) of outerpath)..(point (2-tt) of innerpath);
%
%              I expected the undraw statements to be the following. If the 
%              other code fails on your version of metafont, try this:
%
%               undraw (point .5tt of outerpath)..(point .5tt of innerpath);
%               undraw (point (1-.5tt) of outerpath)..(point (1-.5tt) of innerpath);
%   
          endfor;
          cullit;
      fi
      % Wph End of added block to make gaps.
      %
      currentpicture:=currentpicture t;
      p:=currentpicture;
    endchar;

    beginchar(code+128, 0, 0, 0);
      currentpicture:=p T;
    endchar;

  endfor
endfor
end