+ define_pixels (ht, wd, stem_ht);
+
+ save ellipse, T;
+ path ellipse;
+ transform T;
+
+ T := identity xscaled linethickness
+ yscaled 0.4 ht
+ rotated -dalpha;
+ pickup pencircle transformed T;
+ ellipse := fullcircle transformed T;
+
+ if direction > 0:
+ bot y1 = bot y3 = bot y5 = -direction * 0.33 ht;
+ top y2 = top y4 = +direction * 0.33 ht;
+ else:
+ top y1 = top y3 = top y5 = -direction * 0.33 ht;
+ bot y2 = bot y4 = +direction * 0.33 ht;
+ fi;
+
+ lft x1 = 0.0 wd;
+ lft x2 = 0.2 wd;
+ lft x3 = 0.4 wd;
+ lft x4 = 0.6 wd;
+ lft x5 = 0.8 wd;
+
+ y6 - y5 = direction * stem_ht;
+ y6 - y5 = (x6 - x5) * tand (90 - dalpha);
+
+ if direction > 0:
+ fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
+ -- get_subpoint (ellipse, z2 - z1, z2)
+ -- get_subpoint (ellipse, z3 - z2, z2)
+ -- get_subpath (ellipse, z3 - z2, z4 - z3, z3)
+ -- get_subpoint (ellipse, z4 - z3, z4)
+ -- get_subpoint (ellipse, z5 - z4, z4)
+ -- get_subpath (ellipse, z5 - z4, z6 - z5, z5)
+ -- get_subpath (ellipse, z6 - z5, z5 - z6, z6)
+ -- get_subpoint (ellipse, z5 - z6, z5)
+ -- get_subpoint (ellipse, z4 - z5, z5)
+ -- get_subpath (ellipse, z4 - z5, z3 - z4, z4)
+ -- get_subpoint (ellipse, z3 - z4, z3)
+ -- get_subpoint (ellipse, z2 - z3, z3)
+ -- get_subpath (ellipse, z2 - z3, z1 - z2, z2)
+ -- cycle;
+ else:
+ fill get_subpath (ellipse, z1 - z2, z2 - z1, z1)
+ -- get_subpath (ellipse, z2 -z1, z3 - z2, z2)
+ -- get_subpoint (ellipse, z3 - z2, z3)
+ -- get_subpoint (ellipse, z4 - z3, z3)
+ -- get_subpath (ellipse, z4 -z3, z5 - z4, z4)
+ -- get_subpoint (ellipse, z5 - z4, z5)
+ -- get_subpoint (ellipse, z6 - z5, z5)
+ -- get_subpath (ellipse, z6 - z5, z5 - z6, z6)
+ -- get_subpath (ellipse, z5 - z6, z4 - z5, z5)
+ -- get_subpoint (ellipse, z4 - z5, z4)
+ -- get_subpoint (ellipse, z3 - z4, z4)
+ -- get_subpath (ellipse, z3 - z4, z2 - z3, z3)
+ -- get_subpoint (ellipse, z2 - z3, z2)
+ -- get_subpoint (ellipse, z1 - z2, z2)
+ -- cycle;
+ fi;