% +AMDG  This document was begun on 16 July 11EX, the
% Commemorations of St. Comillus de Lellis, C, and St.
% Symphorosa and her seven Sons, MM, and it is humbly
% dedicated to them and to the Immaculate Heart of Mary for
% their prayers, and to the Sacred Heart of Jesus for His
% mercy.

beginchar(oct"016",9.8em#/5,cap#,dep#); "Right-facing simple fleuron";

% draw the basal ornament
curveornw = 9.8em/6;
penpos0(thickl,90);
z0r = (curveornw/6,h);
penpos1(1.5thinl,180);
z1r = (ss,3h/4);
penpos2(thinl,225);
z2 = ((x1l+x0)/2,h/2);
penpos3(1.5thinl,180);
z3r = (x0+o,h/4);
penpos4(thickl,90);
z4l = (ss+1.5thinl,0);
penpos5(1.5thinl,0);
z5l = z0l;
penpos6(thinl,-90);
z6l = z5l;
penpos7(thinl,180);
z7l = z6l;
penpos8(1.5thinl,0);
z8r = z4r;
penpos9(thinl,-90);
z9r = z8r;
penpos10(thinl,180);
z10r = z9r;
penstroke z0e..z1e..z2e..z3e..z4e;
penstroke z0e..z5e..z6e..z7e;
penstroke z4e..z8e..z9e..z10e;

% construct the vaguely heart-shaped leaf bit
z11 = (0.6w,-dep/3);
z12 = (w-ss,0.4h);
z13 = (7w/8,h/4);
z14 = (3w/4,h/2);
z15 = (x11-thickstroke,h);
z16 = (0.4w,3h/4);
z17 = (w/2,h/2);
z18 = (w/3,h/4);
z19 = z12 shifted (-thinl,thinl);
z20 = z19 shifted (-thinl,-thinl);
z21 = z20 shifted (thinl,-thinl);
z22 = (x16,(y15+y16)/2-thinl);
fill
z11{right}..{up}z12..z19..z20..{right}z21{down}..z13..
	z14..{left}z15{left}..z22..{down}z16{down}..
	{dir -45}z17{dir -160}..{down}z18{down}..{right}cycle;

% draw the stem
penpos23(thinl,90);
z23 = z17;
penpos24(1.5thinl,90);
z24 = ((x16+x0)/2,y16);
penpos25(1.5thinl,135);
z25 = z2;
penpos26(1.5thinl,225);
z26 = z3;

penstroke z23e{left}..z24e..z25e..z26e;

picture simpfleuron; simpfleuron := currentpicture;

penlabels(0,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,100);
endchar;

beginchar(oct"017",9.8em#/5,cap#,dep#);
"Right-facing simple fleuron, upsidedown";
currentpicture := simpfleuron reflectedabout 
	((0,h/2),(w,h/2)) shifted (0,-dep/3);
endchar;

beginchar(oct"020",9.8em#/5,cap#,dep#);
"Left-facing simple fleuron";
currentpicture := simpfleuron reflectedabout ((w/2,h),(w/2,-d));
endchar;

beginchar(oct"021",9.8em#/5,cap#,dep#);
"Left-facing simple fleuron, upsidedown";
currentpicture := simpfleuron reflectedabout ((w/2,h),(w/2,-d))
	reflectedabout ((0,h/2),(w,h/2)) shifted (0,-dep/3);
endchar;

beginchar(oct"050",cap#+dep#/3,9.8em#/5,0);
"Up-facing simple fleuron";
currentpicture := simpfleuron rotated (90) shifted (cap,0);
endchar;

beginchar(oct"051",cap#+dep#/3,9.8em#/5,0);
"Up-facing simple fleuron, backwards";
currentpicture := simpfleuron rotated (90) shifted (cap,0)
	reflectedabout ((w/2,h),(w/2,0));
endchar;

beginchar(oct"077",cap#+dep#/3,9.8em#/5,0);
"Down-facing simple fleuron";
currentpicture := simpfleuron rotated (-90) 
	shifted (dep/3,9.8em/5);
endchar;

beginchar(oct"107",cap#+dep#/3,9.8em#/5,0);
"Down-facing simple fleuron, backwards";
currentpicture := simpfleuron rotated (-90) shifted (dep/3,9.8em/5)
	reflectedabout ((w/2,h),(w/2,0));
endchar;

beginchar(oct"041",9.8em#/36+1.5thinstroke#+ss#,cap#,0);
"Simple curve ornament, vertical";

penpos0(thickl,90);
z0r = (curveornw/6,h);
penpos1(1.5thinl,180);
z1r = (ss,3h/4);
penpos2(thinl,225);
z2 = ((x1l+x0)/2,h/2);
penpos3(1.5thinl,180);
z3r = (x0+o,h/4);
penpos4(thickl,90);
z4l = (ss+1.5thinl,0);
penpos5(1.5thinl,0);
z5l = z0l;
penpos6(thinl,-90);
z6l = z5l;
penpos7(thinl,180);
z7l = z6l;
penpos8(1.5thinl,0);
z8r = z4r;
penpos9(thinl,-90);
z9r = z8r;
penpos10(thinl,180);
z10r = z9r;

penstroke z0e..z1e..z2e..z3e..z4e;
penstroke z0e..z5e..z6e..z7e;
penstroke z4e..z8e..z9e..z10e;

picture curveorn; curveorn := currentpicture;

penlabels(0,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,100);
endchar;

beginchar(oct"042",9.8em#/36+1.5thinstroke#+ss#,cap#,0);
"Simple curve ornament, backwards";
currentpicture := curveorn reflectedabout ((w/2,h),(w/2,0));
endchar;

beginchar(oct"043",cap#,9.8em#/36+1.5thinstroke#+ss#,0);
"Simple curve ornament, horizontal";
currentpicture := curveorn rotated (-90) 
	shifted (0,9.8em/36+1.5thinstroke+ss);
endchar;

beginchar(oct"045",cap#,9.8em#/36+1.5thinstroke#+ss#,0);
"Simple curve ornament, horizontal, backwards";
currentpicture := curveorn rotated (90) shifted (cap,0);
endchar;

beginchar(oct"023",9.8em#/5,cap#,cap#); "Double tulip fleuron";

% set the points for the tulip
tulw = (6cap/8);
z0 = (ss+5tulw/6,h/6+2thickstroke);
z1 = (ss+tulw/2,h/6);
z2 = z1 shifted (0,thinl);
z3 = (x0-thickl,y2+thinl);
z4 = (x3+thinl,h/3);
z5 = (tulw,15h/16);
z6 = (x5-thinl,y5-thinl);
z7 = (tulw/2,2h/3);
z8 = (x3,y5);
z9 = z8 shifted (-0.5thinl,-0.5thinl);
z10 = ((x7+x9)/2,13h/16);
z11 = (x2-thinstroke/2,h);
z12 = ((x10+x11)/2,13h/16);
z13 = z1 shifted (-thinstroke/2,0);
z14 = z10 reflectedabout (z11,z13);
z15 = z1 reflectedabout (z11,z13);

% define the paths for the tulip
path rightbase; 
rightbase = z1{right}..{up}z0{dir 260}..{left}z2--cycle;
path leftbase; leftbase = rightbase reflectedabout (z11,z13);
path rightpetal; rightpetal = z2{right}..z3..z4..
	{dir 45}z6..{dir 45}z5{left}..{dir 205}z9..
	{dir -135}z7{up}--z15--cycle;
path leftpetal; leftpetal = rightpetal reflectedabout (z11,z13);
path centpetal; centpetal = z10..{dir 135}z11{dir 225}..
	z14{down}..{right}z7{right}..{up}cycle;
% unit all the paths into a macro, allowing for shifting
% and rotating around its own center
def drawtulip(expr rot)(expr shift) =
	pickup pencircle scaled thinl;
	erase draw centpetal rotatedaround (((tulw/2),(y11+y13)/2),rot) 
		shifted (shift);
	erase draw leftpetal rotatedaround (((tulw/2),(y11+y13)/2),rot) 
		shifted (shift);
	erase draw rightpetal rotatedaround (((tulw/2),(y11+y13)/2),rot) 
		shifted (shift);
	erase draw leftbase rotatedaround (((tulw/2),(y11+y13)/2),rot) 
		shifted (shift);
	erase draw rightbase rotatedaround (((tulw/2),(y11+y13)/2),rot) 
		shifted (shift);
	fill centpetal rotatedaround (((tulw/2),(y11+y13)/2),rot) 
		shifted (shift);
	fill leftpetal rotatedaround (((tulw/2),(y11+y13)/2),rot) 
		shifted (shift);
	fill rightpetal rotatedaround (((tulw/2),(y11+y13)/2),rot) 
		shifted (shift);
	fill leftbase rotatedaround (((tulw/2),(y11+y13)/2),rot) 
		shifted (shift);
	fill rightbase rotatedaround (((tulw/2),(y11+y13)/2),rot) 
		shifted (shift);
enddef;

% define the points for the stems

penpos20(thinl,45);
z20l = z4;
penpos21(1.5thinl,90);
z21 = (w/2,h/4);
penpos22(thinl,135);
z22r = z21r shifted (thinl,thinl);
penpos23(1.5thinl,-90);
z23l = (w/2,h);
penpos24(thinl,45);
z24 = z22 reflectedabout (z23,z21);
penpos25(thinl,135);
z25 = z20 reflectedabout (z23,z21);

% define the points for the flourishes

penpos30(thinl,90);
z30 = 0.5[z23,z21];
penpos31(thinl,90);
z31 = (x25r,5h/6);
penpos32(thinl,90);
z32 = z31 reflectedabout (z23,z21);
penpos33(thinl,180);
z33r = (ss,h/2);
penpos34(1.5thinl,-90);
z34r = (w/4,0);
penpos35(1.5thinl,-90);
z35 = (w/2,h/8);
penpos36(1.5thinl,-90);
z36 = z34 reflectedabout ((w/2,0),(w/2,h));
penpos37(thinl,0);
z37 = z33 reflectedabout ((w/2,0),(w/2,h));

% draw the flourishes

penstroke z30e..z32e..z33e..z34e..z35e..z36e..z37e..z31e..z30e;

% draw the two tulips
drawtulip(45,(0,0));
drawtulip(-45,(w-tulw,0));

% draw the stems, erasing first so we have the right
% overlaps
pickup pencircle scaled 1.5thinl;
erase draw z21..z22..z23..z24..z21;
penstroke z20e..z21e..z22e..z23e..z24e..z21e..z25e;

picture doubletulip; doubletulip := currentpicture;

currentpicture := doubletulip +
	doubletulip reflectedabout ((0,0),(w,0));

penlabels(0,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,100);
endchar;

beginchar(oct"024",9.8em#/5,cap#,0);
"Double tulip fleuron, half, upward";
currentpicture := doubletulip;
endchar;

beginchar(oct"027",9.8em#/5,cap#,cap#);
"Double tulip fleuron, half, downward";
currentpicture := doubletulip reflectedabout ((0,h/2),(w,h/2))
	shifted (0,-cap);
endchar;

beginchar(oct"036",cap#,9.8em#/5,0);
"Double tulip fleuron, half, rightward";
currentpicture := doubletulip rotated (-90)
	shifted (0,9.8em/5);
endchar;

beginchar(oct"037",cap#,9.8em#/5,0);
"Double tulip fleuron, half, leftward";
currentpicture := doubletulip rotated (90)
	shifted (cap,0);
endchar;

beginchar(oct"046",2cap#,9.8em#/5,0);
"Double tulip fleuron, half, leftward";
currentpicture := doubletulip rotated (90)
	shifted (cap,0) + doubletulip rotated (-90)
	shifted (cap,9.8em/5);
endchar;

beginchar(oct"053",9.8em#/5,cap#,9.8em#/5-cap#);
"Upper left corner tulip fleuron";

z0 = (ss+5tulw/6,h/6+2thickstroke);
z1 = (ss+tulw/2,h/6);
z2 = z1 shifted (0,thinl);
z11 = (x2-thinstroke/2,h);
z13 = z1 shifted (-thinstroke/2,0);
z3 = (x0-thickl,y2+thinl);
z4 = (x3+thinl,h/3);
penpos20(thinl,45);
z20l = z4;
penpos21(thinl,0);
%z21r = (0.4w,0);
z21r = (cap,0);
z22 = (w,h) rotatedaround ((0,h),-45);
penpos23(1.5thinl,-90);
z23 = (w/4,-d/3);
penpos24(thinl,0);
z24l = (ss,-2d/3);
penpos25(thinl,90);
z25l = (w/4,-d);
penpos26(0.5thinl,180);
%z26 = (w/3,-2d/3);
z26 = (0.41w,-2d/3);
penpos27(thinl,90);
z27l = (x26l,-d);
penpos28(thinl,45);
z28r = ((x26+x24)/2,y24-thinl);
penpos29(thinl,0);
z29l = (ss,-d/3);
penpos30(thinl,-135);
%z30 = (x26,(y23+y26)/2);
z30 = (x26,(y33+y23)/2);
penpos31(thinl,0);
z31l = (ss,-d/6);
penpos32(thinl,-90);
z32r = (w/3,0);
penpos33(0.5thinl,180);
z33 = (x21,y23);
penpos34(thinl,180);
z34r = (ss,h/8);
penpos35(thinl,90);
z35 = (w/8,2h/3);

penstroke z35e..z34e..z30e..z27e..z28e..z29e..z31e..z32e..z33e;
penstroke (z35e..z34e..z30e..z27e..z28e..z29e..z31e..z32e..z33e)
	reflectedabout (z20,z22);
pickup pencircle scaled 1.5thinl;
erase undraw z20..z21..z23..z24..z25..z26;
erase undraw (z20..z21..z23..z24..z25..z26)
	reflectedabout (z20,z22);
drawtulip(45,(0,0));
penstroke z20e..z21e..z23e..z24e..z25e..z26e;
penstroke (z20e..z21e..z23e..z24e..z25e..z26e)
	reflectedabout (z20,z22);

picture cornertulip; cornertulip := currentpicture;

penlabels(0,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,100);
endchar;

beginchar(oct"072",9.8em#/5,cap#,9.8em#/5-cap#);
"Upper right corner tulip fleuron";
currentpicture := cornertulip reflectedabout
	((w/2,h),(w/2,-d));
endchar;

beginchar(oct"073",9.8em#/5,cap#,9.8em#/5-cap#);
"Lower left corner tulip fleuron";
currentpicture := cornertulip reflectedabout
	((0,0),(w,0));
endchar;

beginchar(oct"110",9.8em#/5,cap#,9.8em#/5-cap#);
"Lower right corner tulip fleuron";
currentpicture := cornertulip reflectedabout
	((0,0),(w,0)) reflectedabout
	((w/2,h),(w/2,-d));
endchar;

beginchar(oct"111",2(9.8em#/5),cap#,0);
"Upward single tulip fleuron";

z0 = (ss+5tulw/6,h/6+2thickstroke);
z1 = (ss+tulw/2,h/6);
z2 = z1 shifted (0,thinl);
z11 = (x2-thinstroke/2,h);
z13 = z1 shifted (-thinstroke/2,0);
z3 = (x0-thickl,y2+thinl);
z4 = (x3+thinl,h/3);

penpos19(thinl,0);
z19 = (w/2,h/2);
penpos20(thinl,0);
z20 = (w/2,h/6);
penpos21(thinl,-90);
z21r = (0.45w,0);
penpos22(thinl,180);
z22 = (0.4w,h/2);
penpos23(thinl,-90);
z23l = (0.3w,h);
penpos24(thinl,-90);
z24r = (0.15w,0);
penpos25(thinl,180);
z25r = (ss,h/2);
penpos26(thinl,0);
z26 = (0.225w,h/2);
penpos27(thinl,90);
z27r = (0.1w,h);
penpos28(0.5thinl,-45);
z28 = (x27,y25);
penpos29(thinl,0);
z29 = (x24,3h/4);
penpos30(thinl,0);
z30 = (w/2,h/2);
penpos31(thinl,90);
z31 = (x22,5h/6);
penpos32(thinl,180);
z32 = ((x23+x26)/2,h/2);
penpos33(thinl,270);
z33r = (x23,0);
penpos34(thinl,0);
z34 = (x23+(x23-x32),y26);
penpos36(thinl,180);
z36 = ((x27+x25)/2,y29);
penpos35(thinl,90);
z35r = ((x36+x23)/2,h);
penpos37(thinl,180);
z37 = ((x25+x28)/2,h/2);
penpos38(thinl,-90);
z38 = (x28,h/4);
penpos39(0.5thinl,0);
z39 = ((x28+x26)/2,h/2);

penstroke z30e..z31e..z32e..z33e..z34e..z35e..z36e..
	z38e..z39e;
penstroke (z30e..z31e..z32e..z33e..z34e..z35e..z36e..
	z38e..z39e) reflectedabout ((w/2,h),(w/2,0));
pickup pencircle scaled 1.5thinl;
erase draw z19---z20..z21..z22..z23..z26..z24..z25..
	z27..z29..z28;
erase draw (z19---z20..z21..z22..z23..z26..z24..z25..
	z27..z29..z28) reflectedabout ((w/2,h),(w/2,0));
drawtulip(0,(w/2-tulw/2,0));
penstroke z19e---z20e..z21e..z22e..z23e..z26e..z24e..z25e..
	z27e..z29e..z28e;
penstroke (z19e---z20e..z21e..z22e..z23e..z26e..z24e..z25e..
	z27e..z29e..z28e) reflectedabout ((w/2,h),(w/2,0));

picture singletulip; singletulip := currentpicture;

penlabels(0,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,100);
endchar;

beginchar(oct"112",2(9.8em#/5),cap#,cap#);
"Downward single tulip fleuron";
currentpicture := singletulip reflectedabout
	((0,h/2),(w,h/2)) shifted (0,-cap);
endchar;

beginchar(oct"113",cap#,2(9.8em#/5),0);
"Leftward single tulip fleuron";
currentpicture := singletulip rotated (90) shifted (cap,0);
picture lefttulip; lefttulip := currentpicture;
endchar;

%beginchar(oct"114",cap#,(9.8em#/5),(9.8em#/5));
beginchar(oct"114",cap#,2(9.8em#/5),0);
"Rightward single tulip fleuron";
currentpicture := lefttulip reflectedabout ((w/2,h),(w/2,0));
endchar;

beginchar(oct"116",cap#,cap#,0);
"Upward single narrow tulip";

z0 = (ss+5tulw/6,h/6+2thickstroke);
z1 = (ss+tulw/2,h/6);
z2 = z1 shifted (0,thinl);
z11 = (x2-thinstroke/2,h);
z13 = z1 shifted (-thinstroke/2,0);
z3 = (x0-thickl,y2+thinl);
z4 = (x3+thinl,h/3);
penpos20(thinl,0);
z20 = (w/2,h/2);
penpos21(thinl,0);
z21 = (w/2,h/6);
penpos22(1.2thinl,90);
z22l = (3w/4,0);
penpos23(thinl,180);
z23l = (w-ss,h/2);
penpos24(1.2thinl,-90);
z24l = (3w/4,h);
penpos25(thinl,0);
z25 = (w/2,5h/6);

penstroke z20e---z21e..z22e..z23e..z24e..z25e;
penstroke (z20e---z21e..z22e..z23e..z24e..z25e)
	reflectedabout ((w/2,h),(w/2,0));
drawtulip(0,(w/2-tulw/2,0));
pickup pencircle scaled thinl;
draw z20--z21;

picture singlenarrowtulip; singlenarrowtulip := currentpicture;

penlabels(0,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,100);
endchar;

beginchar(oct"121",cap#,cap#,cap#);
"Downward single narrow tulip";
currentpicture := singlenarrowtulip reflectedabout
	((0,0),(w,0));
endchar;

beginchar(oct"122",cap#,cap#,cap#);
"Leftward single narrow tulip";
currentpicture := singlenarrowtulip rotatedabout
	((w/2,h/2),90);
endchar;

beginchar(oct"123",cap#,cap#,cap#);
"Leftward single narrow tulip";
currentpicture := singlenarrowtulip rotatedabout
	((w/2,h/2),-90);
endchar;

beginchar(oct"124",3cap#,cap#,0); "Right-pointing spearhead";

z0 = (0,h);
z1 = (0,0);
z2 = (ex/3,h/4);
z3 = (ex/3,3h/4);
z4 = (-ex/3,h/4);
z5 = (-ex/3,3h/4);
path solidellipse;
solidellipse = z0{right}..z3---z2..{left}z1{left}..z4---z5..{right}cycle;

fill solidellipse scaled 0.8 shifted (w/8,0.1h);
pickup pencircle scaled 1.5thinl;
z6 = (0,h/2+thickl);
z7 = z6 shifted (0,-2thickl);
z8 = (w/4,y6);
z9 = (w/4,y7);
top z10 = (w/3,h);
bot z11 = (w/3,0);
z12 = (w/2,3h/4);
z13 = (w/2,h/4);
z14 = (3w/4,2h/3);
z15 = (3w/4,h/3);
rt z16 = (w,h/2);

draw
z6--z8..z10..z12..z14..{dir -15}z16{dir -165}..z15..z13..z11..z9--z7;

pickup pencircle scaled thinl;
z17 = 0.5[z10,z11];
z18 = 0.5[z14,z15];
draw z17--z18;

picture spearhead; spearhead := currentpicture;

penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
endchar;

beginchar(oct"125",3cap#,cap#,0); "Left-pointing spearhead";
currentpicture := spearhead rotatedaround ((w/2,h/2),180);
endchar;

beginchar(oct"126",pwid#,cap#,0); "Horizontal spear shaft piece";

pickup pencircle scaled 1.5thinl;
z0 = (0,h/2+thickl);
z1 = z0 shifted (0,-2thickl);
z2 = (w,y0);
z3 = (w,y1);
draw z0--z2; draw z1--z3;

penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
endchar;

beginchar(oct"132",cap#,3cap#,0); "Up-pointing spearhead";
currentpicture := spearhead rotatedaround ((1.5cap,cap/2),90)
	shifted (-cap,cap);
endchar;

beginchar(oct"146",cap#,3cap#,0); "Down-pointing spearhead";
currentpicture := spearhead rotatedaround ((1.5cap,cap/2),-90)
	shifted (-cap,cap);
endchar;

beginchar(oct"147",cap#,pwid#,0); "Vertical spear shaft";

pickup pencircle scaled 1.5thinl;
z0 = (w/2-thickl,0);
z1 = z0 shifted (2thickl,0);
z2 = (w/2-thickl,h);
z3 = z2 shifted (2thickl,0);
draw z0--z2; draw z1--z3;
penlabels(0,1,2,3);
endchar;

beginchar(oct"157",cap#+2ss#,cap#,0); "upright fleur-de-lis";

z0 = (w/2,h+o);
z1 = (ss,h/2);
z2 = (w-ss,2h/3);
z3 = (w/2,0);
z4 = (0.36w,2h/3);
z5 = (0.64w,2h/3);
z6 = (0.45w,h/3);
z7 = (0.55w,h/3);
z8 = (x4,0);
z9 = (x5,0);
z10 = (z8 shifted (thinstroke,0)) rotatedaround (z8,-45);
z11 = (z9 shifted (thinstroke,0)) rotatedaround (z9,225);
z12 = 0.5[z10,z3]; y12 := 0;
z13 = 0.5[z11,z3]; y13 := 0;
z14 = (x3,y11);
z15 = 0.5[z1,z4]; y15 := 2h/3;
z16 = 0.5[z2,z5]; y16 := 2h/3;
z17 = (x4,h/2);
z18 = z5 shifted (thinstroke,0);
z19 = z6 shifted (-thinstroke,0);
z20 = z7 shifted (thinstroke,0);
z21 = z8 shifted (0,thinstroke);
z22 = z9 shifted (0,thinstroke);
z23 = (2x8/3,0);
z24 = (x8/3,h/4);
z25 = z23 shifted (0,thickstroke);
z26 = z21 shifted (-thinstroke,thinstroke);
z27 = z19 shifted (-thinstroke,0);
z28 = 0.5[z17,z27] shifted (-0.5thinstroke,0);
z29 = z15 shifted (0,-1.5thickstroke);
z30 = (x1,h/3);
z31 = z1 shifted (thinstroke,0);
z32 = z27 shifted (-thickstroke,0);
z33 = z32 reflectedabout ((w/2,h),(w/2,0));
z34 = z32 shifted (thinstroke,thinstroke);
z35 = z34 reflectedabout ((w/2,h),(w/2,0));
z36 = z32 shifted (thinstroke,-thinstroke);
z37 = z36 reflectedabout ((w/2,h),(w/2,0));

pickup pencircle scaled 2;
path middle;
middle = z0{dir 225}..z4..z6..z8--z10--z12--z14--z13--
	z11--z9..z7..z5..{dir 135}cycle;
fill middle;

path side; side = z30..z1..z15..z17..z19..z21..z23..
	{up}z24{dir -65}..z25..z27..z28..z29..{down}z30..cycle;
fill side;
fill side reflectedabout ((w/2,h),(w/2,0));
path binder; binder = z32..z34---z35..z33..z37---z36..cycle;
fill binder;

picture fleurdelis; fleurdelis := currentpicture;

penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
penlabels(17,18,19,20,21,22,23,24,25,26,27,28,29,30);
penlabels(31,32,33,34,35,36,37,38,39,40,41,42,43,44);
endchar;

beginchar(oct"167",cap#+2ss#,cap#,0); "downward fleur-de-lis";
currentpicture := fleurdelis reflectedabout ((0,h/2),(w,h/2));
endchar;

beginchar(oct"177",cap#,cap#+2ss#,0); "leftward fleur-de-lis";
currentpicture := fleurdelis rotatedaround ((w/2+ss,h/2),-90);
endchar;

beginchar(oct"316",cap#,cap#+2ss#,0); "rightward fleur-de-lis";
currentpicture := fleurdelis rotatedaround ((w/2,h/2-ss),90);
endchar;

beginchar(oct"317",ex#,ex#,0); "extension winding cord";

cordwid = thickstroke;
pickup pensquare scaled 1.5thinl;
top z0 = (0,h);
top z1 = (w,h);
bot lft z2 = (0,0);
bot z3 = (w,0);
draw z0--z1; draw z2--z3;
pickup pencircle scaled 0.5thinl;
z4 = (w,-cordwid/2);
z5 = z4 shifted (-cordwid/2,cordwid/2);
z6 = (w/2+cordwid/2,h);
z7 = z6 shifted (-cordwid,0);
z8 = 0.5[z6,z7] shifted (0,cordwid/2);
z9 = (0,-cordwid/2);
z10 = z9 shifted (cordwid/2,cordwid/2);
z11 = z5 shifted (cordwid,0);
z12 = (z6--z11) intersectionpoint ((w,h)--(w,0));

erase filldraw z4..z5---z7..z8..z6---z11..cycle;
draw z4..z5---z7..z8..z6---z11;
draw z10{down}..z9;

pickup pencircle scaled 0.25thinl;
z13 = 0.14285[z5,z7];
z14 = 0.28571[z5,z7];
z15 = 0.42857[z5,z7];
z16 = 0.57142[z5,z7];
z17 = 0.71428[z5,z7];
z18 = 0.85714[z5,z7];
z23 = 0.14285[z11,z6];
z24 = 0.28571[z11,z6];
z25 = 0.42857[z11,z6];
z26 = 0.57142[z11,z6];
z27 = 0.71428[z11,z6];
z28 = 0.85714[z11,z6];

draw z13{dir -45}..z23;
draw z14{dir -45}..z24;
draw z15{dir -45}..z25;
draw z16{dir -45}..z26;
draw z17{dir -45}..z27;
draw z18{dir -45}..z28;
draw z7{dir -45}..z6;

unfill z10--(-cordwid,h/2)--z9--cycle;

picture cordext; cordext := currentpicture;

penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
penlabels(17,18,19,20,21,22,23,24,25,26,27,28,29,30);
endchar;

beginchar(oct"320",ex#,ex#,0); "left end of winding cord";

pickup pensquare scaled 1.5thinl;
top rt z0 = (w,h);
top lft z1 = (w-cordwid,h);
draw z0--z1;
z2 = (w,-cordwid/2);
z3 = (w-cordwid/2,0);
z4 = (w-cordwid/2,h);
z5 = z4 shifted (-cordwid,0);
z6 = 0.5[z4,z5] shifted (0,cordwid/2);
z7 = z3 shifted (cordwid,0);
z8 = z3 shifted (-cordwid,0);
z9 = 0.5[z3,z8] shifted (0,-cordwid/2);
z10 = z5 shifted (-cordwid,0);
z11 = z6 shifted (-cordwid,0);
z12 = z10 shifted (-cordwid,0);
z13 = z11 shifted (-cordwid,0);
z14 = z8 shifted (-cordwid,0);
z15 = z9 shifted (-cordwid,0);
z16 = z14 shifted (-cordwid,0);
z17 = z15 shifted (-cordwid,0);

pickup pencircle scaled 0.5thinl;
erase filldraw z7---z4..z6..z5---z3..z2..cycle;
draw z7---z4..z6..z5---z3..z2;
% draw the rope lines on the underlying frap
pickup pencircle scaled 0.25thinl;
z23 = 0.14285[z4,z7];
z24 = 0.28571[z4,z7];
z25 = 0.42857[z4,z7];
z26 = 0.57142[z4,z7];
z27 = 0.71428[z4,z7];
z28 = 0.85714[z4,z7];
z33 = 0.14285[z5,z3];
z34 = 0.28571[z5,z3];
z35 = 0.42857[z5,z3];
z36 = 0.57142[z5,z3];
z37 = 0.71428[z5,z3];
z38 = 0.85714[z5,z3];
draw z33{dir -45}..z23;
draw z34{dir -45}..z24;
draw z35{dir -45}..z25;
draw z36{dir -45}..z26;
draw z37{dir -45}..z27;
draw z38{dir -45}..z28;

% first overlapping frap
pickup pencircle scaled 0.5thinl;
erase filldraw z5---z8..z9..z3---z4..z6..cycle;
draw z5---z8..z9..z3---z4..z6..cycle;
% next overlapping fraps
pickup pencircle scaled 0.5thinl;
draw z8---z5..z11..z10---z14..z15..cycle;
draw z10---z14..z17..z16---z12..z13..cycle;
% draw the rope marks on the straight fraps
pickup pencircle scaled 0.25thinl;
z42 = 0.00000[z4,z3];
z43 = 0.14285[z4,z3];
z44 = 0.28571[z4,z3];
z45 = 0.42857[z4,z3];
z46 = 0.57142[z4,z3];
z47 = 0.71428[z4,z3];
z48 = 0.85714[z4,z3];
z49 = 1.00000[z4,z3];
z52 = 0.00000[z5,z8];
z53 = 0.14285[z5,z8];
z54 = 0.28571[z5,z8];
z55 = 0.42857[z5,z8];
z56 = 0.57142[z5,z8];
z57 = 0.71428[z5,z8];
z58 = 0.85714[z5,z8];
z59 = 1.00000[z5,z8];
draw z52{dir -45}..z42;
draw z53{dir -45}..z43;
draw z54{dir -45}..z44;
draw z55{dir -45}..z45;
draw z56{dir -45}..z46;
draw z57{dir -45}..z47;
draw z58{dir -45}..z48;
draw z59{dir -45}..z49;
z62 = 0.00000[z5,z8];
z63 = 0.14285[z5,z8];
z64 = 0.28571[z5,z8];
z65 = 0.42857[z5,z8];
z66 = 0.57142[z5,z8];
z67 = 0.71428[z5,z8];
z68 = 0.85714[z5,z8];
z69 = 1.00000[z5,z8];
z72 = 0.00000[z10,z14];
z73 = 0.14285[z10,z14];
z74 = 0.28571[z10,z14];
z75 = 0.42857[z10,z14];
z76 = 0.57142[z10,z14];
z77 = 0.71428[z10,z14];
z78 = 0.85714[z10,z14];
z79 = 1.00000[z10,z14];
draw z72{dir -45}..z62;
draw z73{dir -45}..z63;
draw z74{dir -45}..z64;
draw z75{dir -45}..z65;
draw z76{dir -45}..z66;
draw z77{dir -45}..z67;
draw z78{dir -45}..z68;
draw z79{dir -45}..z69;
z82 = 0.00000[z10,z14];
z83 = 0.14285[z10,z14];
z84 = 0.28571[z10,z14];
z85 = 0.42857[z10,z14];
z86 = 0.57142[z10,z14];
z87 = 0.71428[z10,z14];
z88 = 0.85714[z10,z14];
z89 = 1.00000[z10,z14];
z92 = 0.00000[z12,z16];
z93 = 0.14285[z12,z16];
z94 = 0.28571[z12,z16];
z95 = 0.42857[z12,z16];
z96 = 0.57142[z12,z16];
z97 = 0.71428[z12,z16];
z98 = 0.85714[z12,z16];
z99 = 1.00000[z12,z16];
draw z92{dir -45}..z82;
draw z93{dir -45}..z83;
draw z94{dir -45}..z84;
draw z95{dir -45}..z85;
draw z96{dir -45}..z86;
draw z97{dir -45}..z87;
draw z98{dir -45}..z88;
draw z99{dir -45}..z89;

picture leftcordend; leftcordend := currentpicture;

penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
penlabels(17,18,19,20,21,22,23,24,25,26,27,28,29,30);
endchar;

beginchar(oct"321",ex#,ex#,0); "right end of winding cord";

pickup pensquare scaled 1.5thinl;
top lft z0 = (0,h);
top rt z1 = (0+cordwid,h);
draw z0--z1;
z2 = (4cordwid,-cordwid/2);
z3 = (x2-cordwid/2,0);
z4 = (x2-cordwid/2,h);
z5 = z4 shifted (-cordwid,0);
z6 = 0.5[z4,z5] shifted (0,cordwid/2);
z7 = z3 shifted (cordwid,0);
z8 = z3 shifted (-cordwid,0);
z9 = 0.5[z3,z8] shifted (0,-cordwid/2);
z10 = z5 shifted (-cordwid,0);
z11 = z6 shifted (-cordwid,0);
z12 = z10 shifted (-cordwid,0);
z13 = z11 shifted (-cordwid,0);
z14 = z8 shifted (-cordwid,0);
z15 = z9 shifted (-cordwid,0);
z16 = z14 shifted (-cordwid,0);
z17 = z15 shifted (-cordwid,0);
z18 = z16 shifted (-cordwid/2,-cordwid/2);

pickup pencircle scaled 0.5thinl;
erase filldraw z5---z8..z9..z3---z4..z6..cycle;
draw z5---z8..z9..z3---z4..z6..cycle;
draw z12---z16..z18;
% next overlapping fraps
pickup pencircle scaled 0.5thinl;
erase filldraw z8---z5..z11..z10---z14..z15..cycle;
draw z8---z5..z11..z10---z14..z15..cycle;
erase filldraw z10---z14..z17..z16---z12..z13..cycle;
draw z10---z14..z17..z16---z12..z13..cycle;
% draw the rope marks on the straight fraps
pickup pencircle scaled 0.25thinl;
z42 = 0.00000[z4,z3];
z43 = 0.14285[z4,z3];
z44 = 0.28571[z4,z3];
z45 = 0.42857[z4,z3];
z46 = 0.57142[z4,z3];
z47 = 0.71428[z4,z3];
z48 = 0.85714[z4,z3];
z49 = 1.00000[z4,z3];
z52 = 0.00000[z5,z8];
z53 = 0.14285[z5,z8];
z54 = 0.28571[z5,z8];
z55 = 0.42857[z5,z8];
z56 = 0.57142[z5,z8];
z57 = 0.71428[z5,z8];
z58 = 0.85714[z5,z8];
z59 = 1.00000[z5,z8];
draw z52{dir -45}..z42;
draw z53{dir -45}..z43;
draw z54{dir -45}..z44;
draw z55{dir -45}..z45;
draw z56{dir -45}..z46;
draw z57{dir -45}..z47;
draw z58{dir -45}..z48;
draw z59{dir -45}..z49;
z62 = 0.00000[z5,z8];
z63 = 0.14285[z5,z8];
z64 = 0.28571[z5,z8];
z65 = 0.42857[z5,z8];
z66 = 0.57142[z5,z8];
z67 = 0.71428[z5,z8];
z68 = 0.85714[z5,z8];
z69 = 1.00000[z5,z8];
z72 = 0.00000[z10,z14];
z73 = 0.14285[z10,z14];
z74 = 0.28571[z10,z14];
z75 = 0.42857[z10,z14];
z76 = 0.57142[z10,z14];
z77 = 0.71428[z10,z14];
z78 = 0.85714[z10,z14];
z79 = 1.00000[z10,z14];
draw z72{dir -45}..z62;
draw z73{dir -45}..z63;
draw z74{dir -45}..z64;
draw z75{dir -45}..z65;
draw z76{dir -45}..z66;
draw z77{dir -45}..z67;
draw z78{dir -45}..z68;
draw z79{dir -45}..z69;
z82 = 0.00000[z10,z14];
z83 = 0.14285[z10,z14];
z84 = 0.28571[z10,z14];
z85 = 0.42857[z10,z14];
z86 = 0.57142[z10,z14];
z87 = 0.71428[z10,z14];
z88 = 0.85714[z10,z14];
z89 = 1.00000[z10,z14];
z92 = 0.00000[z12,z16];
z93 = 0.14285[z12,z16];
z94 = 0.28571[z12,z16];
z95 = 0.42857[z12,z16];
z96 = 0.57142[z12,z16];
z97 = 0.71428[z12,z16];
z98 = 0.85714[z12,z16];
z99 = 1.00000[z12,z16];
draw z92{dir -45}..z82;
draw z93{dir -45}..z83;
draw z94{dir -45}..z84;
draw z95{dir -45}..z85;
draw z96{dir -45}..z86;
draw z97{dir -45}..z87;
draw z98{dir -45}..z88;
draw z99{dir -45}..z89;

picture rightcordend; rightcordend := currentpicture;

penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
penlabels(17,18,19,20,21,22,23,24,25,26,27,28,29,30);
endchar;

beginchar(oct"322",ex#,ex#,0); "inverted left end of winding cord";
currentpicture := leftcordend reflectedabout ((w/2,h),(w/2,0));
endchar;

beginchar(oct"323",ex#,ex#,0); "inverted right end of winding cord";
currentpicture := rightcordend reflectedabout ((w/2,h),(w/2,0));
endchar;

beginchar(oct"324",ex#,ex#,0); "inverted extension winding cord";
currentpicture := cordext reflectedabout ((w/2,h),(w/2,0));
endchar;

beginchar(oct"325",ex#/2,3ex#/4,0); "horizontal triple rule";

pickup pensquare scaled thinl;
top lft z0 = (0,h);
top rt z1 = (w,h);
bot lft z2 = (0,0);
bot rt z3 = (w,0);
draw z0--z1; draw z2--z3;
pickup pensquare scaled 2thinl;
lft z4 = (0,h/2);
rt z5 = (w,h/2);
draw z4--z5;

picture triplerule; triplerule := currentpicture;

penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
endchar;

beginchar(oct"327",3ex#/4,ex#/2,0); "vertical triple rule";
currentpicture := triplerule rotatedaround ((w/2,h/2),90)
	shifted (ex/8,ex/8);
endchar;