def foundation_left =
	z0 = (.5w,h);
	penpos0(croswid, a3);
	z1 = z0;
	penpos1(knotwid, a3);
	z2 = (.75w, .75h);
	penpos2(knotwid, a3);
	z7 = (w, .75h);
	penpos7(knotwid, a4);
	z3 = z0r;
	penpos3(knotwid, a2);
	z4 = (.25w,.75h);
	penpos4(knotwid, a2);
	z5 = (.25w,.25h);
	penpos5(knotwid, a3);
	z6 = (w, .25h);
	penpos6(knotwid, a3);

	llrrexp(7);
	penstroke z1e---z2e{right}---z7e;
	penstroke z3e---z4e---z5e{right}---z6e;
enddef;

def foundation_right =
	z0 = (.5w,h);
	penpos0(croswid, a3);
	z1 = z0;
	penpos1(knotwid, a3);
	z2 = (.75w,.75h);
	penpos2(knotwid, a3);
	z3 = (.75w,.25h);
	penpos3(knotwid, a2);
	z4 = (0w,.25h);
	penpos4(knotwid, a1);
	z5 = z0r;
	penpos5(knotwid, a2);
	z6 = (.25w,.75h);
	penpos6(knotwid, a2);
	z7 = (0w,.75h);
	penpos7(knotwid, a2);

	llrrexp(7);
	penstroke z1e---z2e---z3e{left}---z4e;
	penstroke z5e---z6e{left}---z7e;
enddef;

def foundation_ileft =
	z0 = (.5w,h);
	penpos0(croswid, a3);
	z1 = z0;
	penpos1(knotwid, a3);
	z2 = z3r;
	penpos2(knotwid, a3);
	z3 = (w,.5h);
	penpos3(croswid, a2);
	z4 = z3;
	penpos4(knotwid, a2);
	z5 = (.75w,.25h);
	penpos5(knotwid, a2);
	z6 = (0w,.25h);
	penpos6(knotwid, a1);
	z7 = z0r;
	penpos7(knotwid, a2);
	z8 = (.25w,.75h);
	penpos8(knotwid, a2);
	z9 = (0w,.75h);
	penpos9(knotwid, a2);

	llrrexp(9);
	penstroke z1e---z2e;
	penstroke z4e---z5e{left}---z6e;
	penstroke z7e---z8e{left}---z9e;
enddef;

def foundation_iright =
	z0 = (.5w,h);
	penpos0(croswid, a3);
	z1 = z0;
	penpos1(knotwid, a3);
	z2 = (.75w,.75h);
	penpos2(knotwid, a3);
	z3 = (w,.75h);
	penpos3(knotwid, a4);
	z4 = z0r;
	penpos4(knotwid, a2);
	z5 = (0w,.5h);
	penpos5(knotwid, a2);
	z6 = z5;
	penpos6(croswid, a2);
	z7 = z6l;
	penpos7(knotwid, a3);
	z8 = (.25w,.25h);
	penpos8(knotwid, a3);
	z9 = (w,.25h);
	penpos9(knotwid, a3);

	llrrexp(9);
	penstroke z1e---z2e{right}---z3e;
	penstroke z4e---z5e;
	penstroke z7e---z8e{right}---z9e;
enddef;

beginchar ("I", sqwid#, sqht#, 0); "found-b left";
	foundation_left;
endchar;

beginchar ("J", sqwid#, sqht#, 0); "found-b right";
	foundation_right;
endchar;

beginchar ("K", sqwid#, sqht#, 0); "found-b mid-l";
	foundation_ileft;
endchar;

beginchar ("L", sqwid#, sqht#, 0); "found-b mid-r";
	foundation_iright;
endchar;

beginchar ("M", sqwid#, sqht#, 0); "found-t right";
	foundation_left;
	currentpicture := currentpicture rotated 180 shifted (w, h);
endchar;

beginchar ("N", sqwid#, sqht#, 0); "found-b left";
	foundation_right;
	currentpicture := currentpicture rotated 180 shifted (w, h);
endchar;

beginchar ("O", sqwid#, sqht#, 0); "found-b mid-l";
	foundation_ileft;
	currentpicture := currentpicture rotated 180 shifted (w, h);
endchar;

beginchar ("P", sqwid#, sqht#, 0); "found-b mid-r";
	foundation_iright;
	currentpicture := currentpicture rotated 180 shifted (w, h);
endchar;

beginchar ("Q", sqwid#, sqht#, 0); "found-l top";
	foundation_left;
	currentpicture := currentpicture rotated 270 shifted (0, h);
endchar;

beginchar ("R", sqwid#, sqht#, 0); "found-l bot";
	foundation_right;
	currentpicture := currentpicture rotated 270 shifted (0, h);
endchar;

beginchar ("S", sqwid#, sqht#, 0); "found-l mid-t";
	foundation_ileft;
	currentpicture := currentpicture rotated 270 shifted (0, h);
endchar;

beginchar ("T", sqwid#, sqht#, 0); "found-l mid-b";
	foundation_iright;
	currentpicture := currentpicture rotated 270 shifted (0, h);
endchar;

beginchar ("U", sqwid#, sqht#, 0); "found-r bot";
	foundation_left;
	currentpicture := currentpicture rotated 90 shifted (w, 0);
endchar;

beginchar ("V", sqwid#, sqht#, 0); "found-r top";
	foundation_right;
	currentpicture := currentpicture rotated 90 shifted (w, 0);
endchar;

beginchar ("W", sqwid#, sqht#, 0); "found-r mid-b";
	foundation_ileft;
	currentpicture := currentpicture rotated 90 shifted (w, 0);
endchar;

beginchar ("X", sqwid#, sqht#, 0); "found-r mid-t";
	foundation_iright;
	currentpicture := currentpicture rotated 90 shifted (w, 0);
endchar;
