+ stroke_and_fill?
+} bind def
+
+/draw_partial_ellipse % filled connect x-radius y-radius startangle endangle thickness draw_partial_ellipse
+% Note that filled is not boolean to permit for different graylevels (ie for trill keys)
+{
+ gsave
+ currentpoint translate
+ /thickness exch def
+ /endangle exch def
+ /startangle exch def
+ /y_radius exch def
+ /x_radius exch def
+ /endrad x_radius y_radius mul
+ x_radius x_radius mul
+ endangle cos endangle cos mul mul
+ y_radius y_radius mul
+ endangle sin endangle sin mul mul add sqrt div def
+ /endangle endangle sin endrad mul y_radius div
+ endangle cos endrad mul x_radius div atan def
+ /startrad x_radius y_radius mul
+ x_radius x_radius mul
+ startangle cos startangle cos mul mul
+ y_radius y_radius mul
+ startangle sin startangle sin mul mul add sqrt div def
+ /startangle startangle sin startrad mul y_radius div
+ startangle cos startrad mul x_radius div atan def
+ /connect exch def
+ /filled exch def
+ /savematrix matrix currentmatrix def
+ thickness setlinewidth
+ x_radius y_radius scale
+ startangle cos startangle sin moveto
+ 0 0 1 startangle
+ startangle endangle eq { endangle 360 add } { endangle } ifelse
+ arc
+ connect {
+ startangle cos startangle sin moveto endangle cos endangle sin lineto }
+ if
+ savematrix setmatrix filled stroke_and_fill?
+ grestore