+ % direction
+ save d_, d_sign;
+ pair d_;
+
+ if d_up:
+ d_ := up;
+ d_sign := 1;
+ else:
+ d_ := down;
+ d_sign := -1;
+ fi;
+
+ % convexity and eccentricity
+ save convexity;
+
+ convexity# := d_sign * -0.05ht#;
+
+ % y shift offset
+ save yoffs;
+
+ if down_shift:
+ yoffs# := -0.11 ht#;
+ else:
+ yoffs# := 0.00 ht#;
+ fi;
+
+ define_pixels (convexity, yoffs, ht, wd);
+
+ pickup pencircle scaled linethickness;
+
+ save height, yoffs_bt, p, circle, circle_r;
+ path p, circle, circle_r;
+
+ height# = 0.47 ht#;
+ yoffs_bt# = yoffs# - 0.5 height# - 0.25 convexity#;
+
+ define_pixels (height, yoffs_bt);
+
+ circle := fullcircle scaled linethickness;
+
+ x1 = x6;
+ x2 = x5;
+ x3 = x4;
+ y1 + height = y6;
+ y2 + height = y5;
+ y3 + height = y4;
+
+ save box_top, box_bt;
+
+ z1 = (0.00 wd + linethickness / 2, yoffs_bt - 2.5 convexity);
+ z2 = (0.06 wd, yoffs_bt + 1.4 convexity);
+ z3 = (0.42 wd - linethickness / 2, yoffs_bt - 1.0 convexity);
+ box_top# = height# + yoffs_bt# +
+ max (-1.0 convexity#, 1.4 convexity#, 0);
+ box_bt# = yoffs_bt# +
+ min (-1.0 convexity#, 1.4 convexity#, 0);
+ p = z1{-d_}
+ .. {curl 1}z2{right}
+ .. z3
+ -- z4
+ .. {left}z5{curl 1}
+ .. {d_}z6
+ -- cycle;
+
+ labels (1, 2, 3, 4, 5, 6);
+
+ save dirs;
+ pair dirs[];
+
+ dirs12 := direction (0 + epsilon) of p;
+ dirs21 := direction (1 - epsilon) of p;
+ dirs23 := direction (1 + epsilon) of p;
+ dirs32 := direction (2 - epsilon) of p;
+ dirs45 := direction (3 + epsilon) of p;
+ dirs54 := direction (4 - epsilon) of p;
+ dirs56 := direction (4 + epsilon) of p;
+ dirs65 := direction (5 - epsilon) of p;
+
+ fill get_subpath (circle, down, dirs12, z1)
+ .. get_subpath (circle, dirs21, dirs23, z2)
+ .. get_subpath (circle, dirs32, up, z3)
+ -- get_subpath (circle, up, dirs45, z4)
+ .. get_subpath (circle, dirs54, dirs56, z5)
+ .. get_subpath (circle, dirs65, down, z6)
+ -- cycle;
+
+ save stem_bt;
+
+ if left_stem:
+ pickup pencircle scaled 0.6 linethickness;
+
+ lft x11 = x1 - linethickness / 2;
+ bot y11 = yoffs - 1.1 ht - linethickness / 2;
+ x12 = x11;
+ y12 = y1;
+
+ draw_rounded_block (bot lft z11, top rt z12,
+ 0.6 linethickness);
+ stem_bt# = yoffs# - 1.1 ht#;
+
+ labels (11, 12);
+ else:
+ stem_bt# = 0;
+ fi;
+
+ set_char_box (0.00 wd#, 0.42 wd#,
+ max (0, -box_bt#, -stem_bt#) + linethickness# / 2,
+ max (0, box_top#) + linethickness# / 2);
+ fet_endchar;
+enddef;
+
+
+def inclinatum_char (expr verbose_name, internal_name,
+ small, stropha, auctum) =
+ fet_beginchar (verbose_name, "s" & internal_name);
+ save ht, alpha;
+
+ alpha := 35;