summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ghab/ghab.mf
blob: 37a83f100e673ee375420c67da537b3c3905a6c6 (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
184
%%
%% This is file `ghab.mf',

%% 
%%   __________________________________
%%   Copyright © 2011–2013 Persian TeX Group
%% 
%%   License information appended.
%% 
%%


font_identifier:="ghab";
em#=10pt#;
u# := 1/20em#;
zekh#=1.2u#;
wd#:=2zekh#;
mode_setup;
define_pixels(em,u,zekh,wd);
pickup pencircle scaled zekh;

def loaf(expr bp,lp)=begingroup
save x,y,p;
path p[];
numeric teta;
  pickup pencircle scaled zekh;
  z1=bp;
  z2=lp;
  teta=angle(z2-z1);
  z2b=z2 rotatedaround(z1,-teta);
  x4=.4[x1,x2b];
  x5=.1[x4,x2b];
  y3=y4;x3=x2b;
  y4-y2b=.25(x2b-x1);
  y5=1.2[y2b,y4];
  p1=z1{dir-45}..tension 1.2 ..{up}z3..{down}z4..tension1.3..z5..tension1.4..z4;
 
  p2=p1 rotatedaround(z1,teta);
  p3=p2 reflectedabout(z1,z2);
  draw p2;
  draw p3;
endgroup;
enddef;

beginchar(1,em#,0.5em#,0.5em#);
z1=(0,0);
z2=(x1+wd,0);
z3=(.5w,-d+wd);
z4=(.5w,-d);
z6=(w,0);
z7=(.5w,h);
loaf(z2,z6);
loaf(z3,z7);
draw z1--z2;
draw z3--z4;
endchar;

beginchar(2,em#,0.5em#,0.5em#);
z1=(0,0);
z2=(x1+wd,0);
z3=(.5w,-d+wd);
z4=(.5w,-d);
z6=(w,0);
z7=(.5w,h);
currenttransform:=identity reflectedabout((.5w,0),(.5w,10));
loaf(z2,z6);
loaf(z3,z7);
draw z1--z2;
draw z3--z4;
endchar;

beginchar(3,em#,0.5em#,0.5em#);
z1=(0,0);
z2=(x1+wd,0);
z3=(.5w,-d+wd);
z4=(.5w,-d);
z6=(w,0);
z7=(.5w,h);
currenttransform:=identity reflectedabout((0,0),(5,0));
loaf(z2,z6);
loaf(z3,z7);
draw z1--z2;
draw z3--z4;
endchar;

beginchar(4,em#,0.5em#,0.5em#);
z1=(0,0);
z2=(x1+wd,0);
z3=(.5w,-d+wd);
z4=(.5w,-d);
z6=(w,0);
z7=(.5w,h);
currenttransform:=identity reflectedabout((0,0),(5,0));
currenttransform:=currenttransform reflectedabout((.5w,0),(.5w,10));
loaf(z2,z6);
loaf(z3,z7);
draw z1--z2;
draw z3--z4;
endchar;

wh#=em#;
define_pixels(wh);
currenttransform:=identity;
beginchar(8,wh#,wh#,0);
z1=(0,h);
z2=(w,0);
pickup pencircle scaled .4pt;
draw z1{dir 0}..{dir -90}z2;
endchar;

beginchar(9,wh#,wh#,0);
z1=(0,0);
z2=(w,h);
pickup pencircle scaled .4pt;
draw z1{dir 90}..{dir 0}z2;
endchar;

beginchar(10,wh#,0,wh#);
z1=(0,0);
z2=(w,-d);
pickup pencircle scaled .4pt;
draw z1{dir -90}..{dir 0}z2;
endchar;

beginchar(11,wh#,0,wh#);
z1=(0,-d);
z2=(w,0);
pickup pencircle scaled .4pt;
draw z1{dir 0}..{dir 90}z2;
endchar;

beginchar(16,wh#,wh#,0);
z1=(0,h);
z2=(w,0);
pickup pencircle scaled .8pt;
draw z1{dir 0}..{dir -90}z2;
endchar;

beginchar(17,wh#,wh#,0);
z1=(0,0);
z2=(w,h);
pickup pencircle scaled .8pt;
draw z1{dir 90}..{dir 0}z2;
endchar;

beginchar(18,wh#,0,wh#);
z1=(0,0);
z2=(w,-d);
pickup pencircle scaled .8pt;
draw z1{dir -90}..{dir 0}z2;
endchar;

beginchar(19,wh#,0,wh#);
z1=(0,-d);
z2=(w,0);
pickup pencircle scaled .8pt;
draw z1{dir 0}..{dir 90}z2;
endchar;


font_size em#;  % the "design size" of this font
font_slant  0;
font_normal_space 1/4em#;
font_normal_stretch 1/6em#;
font_normal_shrink 1/6em#;
font_x_height zekh#;
font_quad em#;
font_extra_space 1/3em#;
end.
%% 
%% Copyright © 2011–2013      by Persian TeX Group     <persian-tex@tug.org>
%% 
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status)
%% by Persian TeX Group.
%% 
%% 
%% 
%% 
%%
%% End of file `ghab.mf'.