% Filename: stmabase.mf % Authors: Jeremy Gibbons and Alan Jeffrey % Maintained by: Alan Jeffrey % E-mail: jeffrey@cs.chalmers.se % Last modified: 24 May 1991 % This is the base file for the St Mary's Road symbol font, stmaryrd.mf. % Copyright 1991 Jeremy Gibbons and Alan Jeffrey. % 20 May 1991: Created the base file out of macros from alans.mf, % galileo.mf and msbm.mf. % The following stolen from the AMS bsymbols.mf file: def char_negate(suffix c,t,b) = %c is center point; t is top point; b is bottom pickup rule.nib; w-x.t=x.b; y.t-y.c=y.c-y.b; draw z.t--z.b; penlabels(t,c,b); enddef; def char_center(suffix c) = % find center of type character x.c=w/2; y.c=.5[-d,h]; enddef; % The command to draw semantic brackets: def left_semantic_bracket(expr breadth,do_top,do_bot) = pickup crisp.nib; numeric thickness; thickness=hround breadth; pos1(thickness,0); pos2(thickness,0); top y1=h; bot y2=1-d; lft x1l=lft x2l=hround(2.5u-.5thickness); filldraw stroke z1e--z2e; % stem1 pos3(thickness,90); pos4(thickness,90); pos5(thickness,90); pos6(thickness,90); x3=x5=x1l; rt x4=rt x6=hround(w-.75u+.5thickness); y3r=y4r=y1; y5l=y6l=y2; if do_top: filldraw stroke z3e--z4e; fi % upper bar if do_bot: filldraw stroke z5e--z6e; fi % lower bar pos7(thickness,0); pos8(thickness,0); y7=y1; y8=y2; x7=x8=x1+hround(0.5(w - 3.25u)); filldraw stroke z7e--z8e; % stem2 penlabels(1,2,3,4,5,6,7,8); enddef; def right_semantic_bracket(expr breadth,do_top,do_bot) = pickup crisp.nib; numeric thickness; thickness=hround breadth; pos1(thickness,0); pos2(thickness,0); top y1=h; bot y2=1-d; rt x1r=rt x2r=hround(w-2.5u+.5thickness); filldraw stroke z1e--z2e; % stem1 pos3(thickness,90); pos4(thickness,90); pos5(thickness,90); pos6(thickness,90); x3=x5=x1r; lft x4=lft x6=hround(.75u-.5thickness); y3r=y4r=y1; y5l=y6l=y2; if do_top: filldraw stroke z3e--z4e; fi % upper bar if do_bot: filldraw stroke z5e--z6e; fi % lower bar pos7(thickness,0); pos8(thickness,0); y7=y1; y8=y2; x7=x8=x1-hround(0.5(w - 3.25u)); filldraw stroke z7e--z8e; % stem2 penlabels(1,2,3,4,5,6,7,8); enddef; % The command to draw a circle (with free symmetry hacks): def begincircle (expr n) = beginarithchar(n); pickup rule.nib; if .5w <> good.x .5w: change_width; fi lft x6=hround u-eps; x2=w-x6; y2=math_axis; y8-y2 = .5(x2-x6); circle_points; draw_circle % circle enddef; % And to draw a box (with free symmetry hacks): def beginbox (expr n) = beginarithchar(n); pickup rule.nib; if .5w <> good.x .5w: change_width; fi lft x1=hround 1.5u-eps; x2=w-x1; x3=x2; x4=x1; y1-y4 = x2-x1; .5[y1,y4]=math_axis; y1=y2; y3=y4; draw z1--z2--z3--z4--cycle; % box enddef