%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % bangmac.mf: METAFONT file that defines various macros % for use in bangla fonts %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% This file is part of the package BANGTEX, containing Bangla fonts %% and style files for the TeX/LaTeX typesetting systems %% %% Copyright (C) 2001, 2002 Palash Baran Pal %% e-mail: pbpal@theory.saha.ernet.in internet: %% internet: http://tnp.saha.ernet.in/~pbpal %% Address: Saha Institute of Nuclear Physics %% 1/AF Bidhan Nagar %% Calcutta 700064, INDIA %% %% Original release: January 2001 %% Latest modification released: January 2002 %% %% 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 2 of the License, 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., 59 Temple Place, Suite 330, Boston, MA %% 02111-1307 USA %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% def matra(expr wa,wb) = begingroup save x,y,lslope,rslope; lslope = matra_slope; rslope = matra_slope; z1'r = (wa,matra_f*h); z2'r = (wb,matra_f*h); if wa>0: x1'r := x1'r - 0.5*stem_width; lslope := 90; x12=x1'r + stem_width; y12 = matra_h*h + .5matra_t*h/sind(lslope); x13=x1'r; y13=y12; x11=x1'r; y11 = y12 + stem_width/sind(lslope); fill z13--z11--z12--cycle; fi if wbangle(z2-z1): chdir:=-1; fi phi = th + chdir*90; if phi>0: psi=phi-180; else: psi=phi+180; fi fill z2--z3..{dir psi}z4--z5{dir phi}..cycle; endgroup enddef; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macro for the Tiki to be used for the letters "Ta", hraswa i and u %% etc. xa is the x-coordinate of the right end of the Tiki and xb is %% the same for the left end. def Tiki(expr xa,xb) = begingroup save x,y; bot z1 = (xa,matra_f*h); z2 = (xb,h); z1'= (.5[x1,x2],.5[y1,y2]); pickup pencircle xscaled .7pt yscaled .3pt rotated 90; Tiki_pen := savepen; draw z1{up}..{left}z1'{left}..{dir 60}z2; penlabels(1,2); endgroup enddef; def baTi(expr za,zb,zc,zd) = begingroup save x,y,lab,phi; z1 = za; z2 = zb; z3 = zc; z4 = zd; lab = length(z1-z2); phi = 100; x3' = x3; y3'-y3 = min(2.3*lab,.3[y2,y3]); z4' = z4 + .4*lab * dir (phi-120); fill z2{down}..{left}z3{left}..{dir 100}z4--z4'{dir (phi-180)}..{right}z3'{right}..{up}z1--cycle; penlabels(1,2,3,4); endgroup enddef; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% This is the golla to be used for bisarga, anuswar etc. def golla(expr za,balld) = begingroup save x,y; z1r = za + .5balld * dir (45); z2r = za + .5balld * dir (135); z3r = za + .5balld * dir (-135); z4r = za + .5balld * dir (-45); penpos1(.15balld,45); penpos2(.25balld,135); penpos3(.15balld,-135); penpos4(.25balld,-45); penstroke z1e..z2e..z3e..z4e..cycle; endgroup enddef; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% The base of E, also used as ra-fala def Ebase(expr za,zb,t) = begingroup save x,y,w,h; numeric w,h; w=abs(xpart(za) - xpart(zb)); h=abs(ypart(za) - ypart(zb)); x1 = xpart(za); y1l= ypart(za); penpos1(t,90); z2l = z1 + (-.3w,.13h); penpos2(1.4t,90); y3 = y2; x3 = x2 -.4w; penpos3(1.4t,90); z4l = zb; penpos4(t/3,-40); penstroke z1e..{left}z2e{left}..z3e;%..z4e; fill z3l{left}..z4l--z4l--z4l..{right}z3r--cycle; penlabels(1,2,3,4); endgroup enddef; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% The shape at the right of ina, Sh+N etc. %% The starting point is za, the x-distance between za and the %% highest/lowest point is w, the total height is 2h, and t is the %% thickness of the lines. def clover(expr za,w,h,t) = begingroup save x,y,currenttransform; transform currenttransform; currenttransform := identity shifted za slanted slantval; numeric theta,balld; theta = 60; balld = .7w-.7t; z1 = (0,0); penpos1(0,-90); z2r = (x1+.5w,y1-h); penpos2(t,-90); z3r = (w,y1-.5h); penpos3(.7t,0); z4l = (x2,y1); penpos4(.5balld,theta); fill fullcircle scaled (balld) shifted z4l; penstroke z1e..z2e..{up}z3e{up}..{dir (theta+90)}z4e; z4'l = z4l; penpos4'(.5balld,-theta); x3' = x3; y3' - y4l = y4l - y3; penpos3'(.7t,0); x2' = x2; y2' -y4l = y4l - y2; penpos2'(t,90); penstroke z1e..z2'e..{down}z3'e{down}..{dir (-theta-90)}z4'e; penlabels(1,2,2',3,3',4,4'); endgroup enddef; %% End of file bangmac.mf