summaryrefslogtreecommitdiff
path: root/fonts/pandora/punctt.mf
blob: c6899e5d0fdfaa4d829667f3aeddae0236a36055 (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
%*****************************************************************************
%        Copyright (c) 1989 by N. N. Billawala
%*****************************************************************************


% punctt.mf  punctuation: for typewriter text set

% 8 characters


iff OK "-":  "Minus sign";
  beginchar(oct"055",.5width#+b_mono#,cap#,0); 
  pickup mathpen;
  lft z1=(0,math_axis)//;
  rt z2=lft z1+(w,0);
  draw z1--z2;
adjust(v_a*fitbasis.uc#+m_a*b_mfit#,v_a*fitbasis.uc#+m_a*b_mfit#); 
show_character; endchar;

% use different mathpen for softness
% character position, but not shape slants with obliqueness
% must make sure that the plus/minus have the same widths


iff OK "<":  "Less than"; 
  beginchar(oct"074",.4width#+b_mono#,cap#,0); 
  min_limit(join_radius)(.5mathlines);
  lft z2r=lft z4r=(0,math_axis)//;     
  top z1r=(lft x2r+min(w,math_axis+.5h),math_axis+.4h);   
  bot z3r=(lft x2r+min(w,math_axis+.5h),math_axis-.4h);    
  multpos(1,2)(mathlines,angle(z1r-z2r)+90);
  multpos(3,4)(mathlines,angle(z4r-z3r)+90);
  z40=(z1l--z2l)intersectionpoint(z3l--z4l);
 
  p1=(z40 soften(z3l,z3r,z2r,z1r,z1l) z40)--cycle;

  showpoints(1,2,3,4,40);
adjust(v_F*fitbasis.uc#+m_a*b_mfit#,v_H*fitbasis.uc#+m_a*b_mfit#); 
show_character; endchar;


iff OK ">":  "Greater than"; 
  beginchar(oct"076",.4width#+b_mono#,cap#,0); 
  min_limit(join_radius)(.5mathlines);
  rt z2r=rt z4r=(min(w,math_axis+.5h),math_axis)//;  
  top z1r=(0,math_axis+.4h);   
  bot z3r=(0,math_axis-.4h);    
  multpos(1,2)(mathlines,angle(z1r-z2r)-90);
  multpos(3,4)(mathlines,angle(z4r-z3r)-90);
  z40=(z1l--z2l)intersectionpoint(z3l--z4l);

  p1=(z40 soften(z3l,z3r,z2r,z1r,z1l) z40)--cycle;

  showpoints(1,2,3,4,40);
adjust(v_H*fitbasis.uc#+m_a*b_mfit#,v_F*fitbasis.uc#+m_a*b_mfit#); 
show_character; endchar;

% character position, but not shape slants with obliqueness
% maximum width=1.5 math_axis


iff OK "\":  "Left leaning slash";          % need to add shift if w>.45h
  beginchar(oct"134",.45width#+b_mono#,maxheight#,maxdepth#); 
  pickup  mathpen rotated angle((0,h)//-(min(w,.5(h+d)),-d)//);
  top lft z1=(0,h)//;
  bot rt z2=(min(w,.5(h+d)),-d)//;
  x1:=min(x1,x2-2);          
  draw z1--z2;
adjust(v_H*fitbasis.uc#+m_a*b_mfit#,v_H*fitbasis.uc#+m_a*b_mfit#); 
show_character; endchar;

% use different mathpen for softness
% limits character to vertical line minus 2 pixels


iff OK "_":  "Underscore"; 
  beginchar(oct"137",.5width#+mono#,cap#,0); 
  pickup mathpen;
  top lft z1=(0,0);
  top rt z2=(w,0);  
  draw z1--z2;
adjust (0,0); show_character; endchar;

% use different mathpen for softness
% no slant of shape with obliqueness
% placement just below the baseline; meant for computer programs where the
%   underscore often has the same token value as a letter




iff OK "{": "Left curly brace"; 
  beginchar(oct"173",.4width#+b_mono#,maxheight#,maxdepth#); 
  
  save_num(width_limit)=min(w,.4(h+d)); 
  z40=(width_limit,.5(h-d));
  z41=(width_limit,h)rotatedaround(z40//,-oblique);
  z42=(width_limit,-d)rotatedaround(z40//,-oblique);

  pos0(max(1,.5thin_stem.uc),90-oblique);  
  pos1(max(1,.75thin_stem.uc),90-oblique);  
  multpos(2,4)(max(1,.75stem.uc),180-oblique);
  pos3(max(1,.5stem.uc),180-oblique);
  pos5(max(1,.75thin_stem.uc),-90-oblique);  
  pos6(max(1,.5thin_stem.uc),-90-oblique);
  multpos(20,21)(2,90-oblique);  

  lft z2r=.25[z41,z42]+.7(.95width_limit,0)rotated(180-oblique);
  lft z3r=.5[z41,z42] +  (.95width_limit,0)rotated(180-oblique);    z20=z3r;
  rt z21 =.5[z41,z42] +  (   width_limit,0)rotated(180-oblique);
  lft z4r=.75[z41,z42]+.7(.95width_limit,0)rotated(180-oblique);
  top z1r=(x41-.2width_limit,h);  
  bot z5r=(x42-.2width_limit,-d);    
  z0r=whatever[z41,z42]; bot y0l=bot y1l;
  z6r=whatever[z41,z42]; top y6l=top y5l;

  ref1=z3l{dir -oblique} i_t z4l{downward} i_t z5l{right}...z6l;
  ref2=z6r...z5r{left} o_t z4r{upward} o_t z20l{-dir -oblique}--z21l--
       z21r--z20r{dir -oblique} o_t z2r{upward} o_t z1r{right}...z0r;
  ref3=z0l...z1l{left} i_t z2l{downward} i_t z3l+(0,epsilon){-dir -oblique};
     
  if softpath:
       p1=ref1 softjoin(z6l--z6r)softjoin ref2 softjoin(z0r--z0l)softjoin ref3
          --cycle;
    else:p1=ref1--ref2--ref3--cycle;  fi 

 showpoints(0,1,2,3,4,5,6,20,21,40,41,42);
adjust(v_H*fitbasis.uc#+m_a*b_mfit#,v_H*fitbasis.uc#+m_a*b_mfit#); 
show_character; endchar;


iff OK "}": "Right curly brace"; 
  beginchar(oct"175",.4width#+b_mono#,maxheight#,maxdepth#); 
  
  save_num(width_limit)=min(.95w,.4(h+d)); 
  z40=(0,.5(h-d));
  z41=(0,h)rotatedaround(z40//,-oblique);
  z42=(0,-d)rotatedaround(z40//,-oblique);;

  pos0(max(1,.5thin_stem.uc),90-oblique);  
  pos1(max(1,.75thin_stem.uc),90-oblique);  
  multpos(2,4)(max(1,.75stem.uc),-oblique);
  pos3(max(1,.5stem.uc),-oblique);
  pos5(max(1,.75thin_stem.uc),-90-oblique);  
  pos6(max(1,.5thin_stem.uc),-90-oblique);
  multpos(20,21)(2,90-oblique);  

  rt z2r=.25[z41,z42]+ .7(width_limit,0)rotated(-oblique);
  rt z3r=.5[z41,z42] +   (width_limit,0)rotated(-oblique);     z20=z3r;
  rt z21=.5[z41,z42] +(min(w,.4(h+d)),0)rotated(-oblique);
  rt z4r=.75[z41,z42]+ .7(width_limit,0)rotated(-oblique);
  top z1r=(x41+.2width_limit,h);  
  bot z5r=(x42+.2width_limit,-d);    
  z0r=whatever[z41,z42]; bot y0l=bot y1l;
  z6r=whatever[z41,z42]; top y6l=top y5l;

  ref1=z3l{-dir -oblique} i_t z4l{downward} i_t z5l{left}...z6l;
  ref2=z6r...z5r{right} o_t z4r{upward} o_t z20l{dir -oblique}--z21l--
       z21r--z20r{-dir -oblique} o_t z2r{upward} o_t z1r{left}...z0r;
  ref3=z0l...z1l{right} i_t z2l{downward} i_t z3l+(0,epsilon){dir -oblique};
     
  if softpath:
       p1=ref1 softjoin(z6l--z6r)softjoin ref2 softjoin(z0r--z0l)softjoin ref3
          --cycle;
    else:p1=ref1--ref2--ref3--cycle;  fi 

 showpoints(0,1,2,3,4,5,6,20,40,41,42);
adjust(v_H*fitbasis.uc#+m_a*b_mfit#, v_H*fitbasis.uc#+m_a*b_mfit#); 
show_character; endchar;


iff OK "|":  "Vertical bar";         % need to add shift if w>.45h
  beginchar(oct"174",I_w*width#+a_mono#,maxheight#,maxdepth#);  
  pickup mathpen;
  z0=(.5w,.5[-d,h])//;
  top z1=(x0,h);          
  bot z2=(x0,-d);
  draw z1--z2;
adjust(v_A*fitbasis.uc#+m_a*a_mfit#,v_A*fitbasis.uc#+m_a*a_mfit#); 
show_character; endchar;

% use different mathpen for softness
% always vertical; no slant but shifts position with obliqueness