summaryrefslogtreecommitdiff
path: root/language/gurmukhi/singh/defs.mf
blob: 54225e30db84b05b427fc4a94bf3a9a9b967f2dc (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
%    DEFS.MF
%    Header file with Metafont-parameters for the Devanagari fonts
% 
%    Copyright (C) 1991  University of Groningen, The Netherlands
%
%    Author:   Frans J. Velthuis
%    Internet: velthuis@rc.rug.nl
%    Bitnet:   velthuis@hgrrug5
%
%    This program 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 1, or (at your option)
%    any later version.
%
%    This program 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.
% 
  penwd# :=thick# * cosd(rot-90);
  usthick# := thick#;
  mb# := .2ht#;
  define_pixels(penwd,usthick,mb);
  define_blacker_pixels(thin,thick,subthick);
  thin := max(thin,1); subthick := max(subthick,1);
  smoothing := 0;
  pickup pencircle xscaled thick yscaled thin rotated rot;
  scpenwd := pen_rt - pen_lft;
  frame_pen := savepen;
  pickup pencircle xscaled subthick yscaled thin rotated rot;
  sub_pen := savepen;
  picture v[];
  numeric vbar[];
  extra_endchar := extra_endchar & "chardp := chardp + mb#;" ;

  def tframe =
  pickup frame_pen;
  z1=(w-brm-.7rm,h); z2=(w,h);
  x3=good.x w-brm; y3=h; z4=(x3,0);
  draw z1--z2;
  draw z3--z4;
  enddef;

  def aframe =
  pickup frame_pen;
  z1=(w-rm-brm,h); z2=(w,h);
  x3=good.x w-brm; y3=h; z4=(x3,0);
  draw z1--z2;
  draw z3--z4;
  enddef;

  def endsav =
  vbar[charcode]=x3;
  cullit;
  v[charcode]=currentpicture;
  endchar;
  enddef;

  def cutoff(expr t) =
  x23 = vbar[t];
  fill (-penwd,-d-mb-penwd)--(x23-.6scpenwd,-d-mb-penwd)--(x23-.6scpenwd,
  h+penwd)--(-penwd,h+penwd)--cycle withweight 2;
  cull currentpicture keeping(2,2);
  addto currentpicture also v[t];
  cull currentpicture keeping (2,2);
  w := floor(x23-.6scpenwd);
  enddef;

  def addpic(expr t) =
  addto currentpicture also v[t];
  enddef;

  def frame =
  pickup frame_pen;
  z1 = (0,ht); z2 = (w,ht);
  x3 = good.x w-brm; y3 = ht; z4 = (x3,0);
  draw z1--z2; draw z3--z4;
  enddef;

  def sqdot(expr p)=
  x25:=floor(xpart p)+.5;
  y25:=floor(ypart p)+.5;
  dwd:=ceiling(thick);
  if not odd dwd: dwd:= dwd+1; fi
  fill unitsquare shifted -(.5,.5) rotated 45 scaled (.5sqrt2 * dwd)
  shifted z25;
  enddef;

  def low_n(expr nw,nh)=
  	y38 := good.y nh; x38 := x3;
        y39 := y38 - .6penwd; x39 := nw;
        filldraw fullcircle scaled 1.2penwd shifted(x39,y39);
        z40 = (x39,y38);
        draw z38--z40;
  enddef;