<picture
  class="UnitPicture"
  name="brillig"
  path="doc/obj/brillig.pn0.xml"
><![CDATA[
UnitPicture
"brillig"
userdict begin
/bril {
    0 -10 moveto 80 70 50 70 15 arcto pop pop pop pop
    10 70 10 20 15 arcto pop pop pop pop
    10 0 lineto stroke
    35 0 25 -180 90 arc
    10 10 rmoveto
    25 30 cos mul 35 add
    25 30 sin mul lineto
    currentpoint pop stroke             % y was 12.5
    25 30 cos mul 2 copy add 0 25 30 150 arc stroke
    % stack now contains x of old current point and 25cos30
    dup add add
    matrix currentmatrix exch
	0 translate
	0 -70 moveto -20 20 10 -20 -10 0 rcurveto stroke
	3.125 -12.5 moveto
	25 -50 0 75 25 25 rcurveto currentpoint stroke
	pop 0 translate
	0 70 moveto 20 -20 -10 20 10 0 rcurveto stroke
	2 2 scale
	3.125 -12.5 moveto
	25 -50 0 75 25 25 rcurveto
    setmatrix
    currentpoint stroke
} def
%
/lig {
    bril pop dup add 0 translate 180 rotate bril pop pop
} def
%
/brillig_dimensions {
%    0 -40 368.6541 80
    0 -40 420 100
} def
%
/scale_to_fit {         % _ => _; scale to fit brillig in bbox of current path
    pathbbox points2rect 4 2 roll translate 2 copy div	% w h w/h
    /brillig_dimensions load aload pop			% w h w/h bx by bw bh
    div 3 1 roll pop pop				% w h w/h bw/bh
    le {        % this is wrong, but I don't understand why
	0 exch 2 div translate 				% w h w/h
	/brillig_dimensions load 2 get div		% w h w/h/bw
	dup scale					% w h w/h/bw
    } {
	1 index 2 div 1 index 2 div translate		% w h bw/bh
	/brillig_dimensions load 3 get div		% w h bw/bh/bh
	dup scale pop					% w h
	/brillig_dimensions load 2 get 2 div neg 0 translate % w h
    } ifelse
} def
end % userdict
{ { % 0 0 1 1 rectpath
    % scale_to_fit
    0 .5 translate
    1 380 div 1 200 div scale
    newpath
    1 setlinequality
    4 setlinewidth
    1 setlinecap
    0 setgray
    lig } dlist }
330 80
]]></picture>

