% This file contains symbol definitions for operators used in linear logic.
% The glyph defintions are derived from those in Knuth's Computer Modern and
% from the AMS Symbol fonts, to make them assorted with TeX's standard fonts.
%
% This file was written by Emmanuel Beffara, you can distribute it and/or
% modify it under the terms of the LaTeX Project Public License.

mode_setup; font_setup;

cmchar "Reversed ampersand (par)";

% The code is exactly the one for the ampersand, with a transformation applied
% at the end.

beginchar(0,14u#,asc_height#,0);
italcorr x_height#*slant-serif_fit# - if serifs: .4u# else: 1.5u# fi;
adjust_fit(0,serif_fit#);
pickup tiny.nib; pos2(slab,-90); x2=4u; bot y2r=-o;
if not hefty:(x,y2l)=whatever[z2r,(w-5u,x_height)]; x2l:=x; fi
if serifs: pos0(fudged.hair,0);
 rt x0r+jut=hround(w-.9u); top y0=x_height;
 pos1(fudged.hair,0); z1=whatever[z0,(.6[x0,x2],0)];
 y1=max(y0-1.5bracket-.2x_height,2/3x_height);
 filldraw stroke z0e---z1e...{left}z2e;  % short diagonal
else: pickup fine.nib; pos1(.25[slab,flare],-15); rt x1r=hround(w-2u);
 y1r=good.y .75[bar_height,x_height]; x1l:=good.x x1l; y1l:=good.y y1l;
 top z2'l=(x2l,tiny.top y2l); bot z2'r=(x2r,tiny.bot y2r);
 filldraw stroke term.e(2',1,right,1,4); fi  % short diagonal and terminal
pickup tiny.nib; numeric slope,theta,reduced_hair;
slope=(h-2vair-slab)/10.5u; theta=angle(-slope,1);
reduced_hair=max(tiny.breadth,hround(fudged.hair if hefty:-2stem_corr fi));
lft x3r=hround .75u; x5=.5[x3r,x6l]; lft x6r=hround .5(w-u);
x3l-x3r=curve-tiny; pos6(reduced_hair,180);
pos5(vair,theta); y5=.5h;
ellipse_set(2l,3l,4l,5l); ellipse_set(2r,3r,4r,5r);
pos7(vair,270); top y7l=h+o; x7=.45[x6r,x8r];
pos8(fudged.stem,30); x8l=good.x(x8l+3.5u-x8); y8r=y6;
ellipse_set(7l,6l,5',5l);
filldraw stroke z2e{left}...z3e{up}...z4e---z5e...{up}z6e
 ...z7e{left}...z8e{down};  % bowls
pos10(slab,90); x10=w-3.5u; bot y10l=-o;
pos9(fudged.stem,angle(z8-z10)-90);
z9=.5[z8,z10]+(1.75u,0) rotated(angle(z8-z10)+90);
filldraw stroke z8e{down}...z9e{z10-z8}...{right}z10e;  % long diagonal
if serifs: pickup crisp.nib; pos10'(slab,90); z10'=z10;
 pos11(fudged.hair,180); rt x11l=hround(w-u); y11=.5bar_height;
 filldraw stroke z10'e{right}...{up}z11e;  % terminal
 numeric inner_jut; if rt x6l+.5u<lft x0l-1.5jut: inner_jut=1.5jut;
 else: rt x6l+.5u=lft x0l-inner_jut; fi
 dish_serif(0,1,a,.6,inner_jut,b,.5,jut)(dark);  % serif
else: pickup fine.nib; pos10'(slab,90); z10'=z10;
 pos11(Vround .5[slab,flare],90);
 rt x11=hround(r-letter_fit-u); bot y11l=vround .07bar_height-o;
 filldraw stroke term.e(10',11,right,1,4); fi  % terminal
penlabels(0,1,2,3,4,5,6,7,8,9,10,11);

%%% here it is:

currentpicture := currentpicture scaled -1 shifted (w,h);
endchar;

% The definition of the large symbols is the one for the ampersand, adapted
% for a bigger size, with parameters taken from the definition of sum
% operators.

charlist 8: 9;  % large "with"

cmchar "\textstyle large ampersand";
beginchar(8,19u#,0,10/6dh#);
italcorr x_height#*slant-serif_fit# - if serifs: .4u# else: 1.5u# fi;
adjust_fit(0,serif_fit#);
pickup tiny.nib; pos2(slab,-90); x2=(4/14)*w; bot y2r=-d-o;
% this is dirty:
save x_height; x_height:=.62[-d,h];
if not hefty:(x,y2l)=whatever[z2r,(w-5u,x_height)]; x2l:=x; fi
if serifs: pos0(rule_thickness,0);
 rt x0r+jut=hround(w-.9u); top y0=.62[-d,h];
 pos1(rule_thickness,0); z1=whatever[z0,(.6[x0,x2],-d)];
 y1=max(y0-1.5bracket-.124*(d+h),.413[-d,h]);
 filldraw stroke z0e---z1e...{left}z2e;  % short diagonal
else: pickup fine.nib; pos1(.25[slab,flare],-15); rt x1r=hround(w-2u);
 y1r=good.y .51[-d,h]; x1l:=good.x x1l; y1l:=good.y y1l;
 top z2'l=(x2l,tiny.top y2l); bot z2'r=(x2r,tiny.bot y2r);
 filldraw stroke term.e(2',1,right,1,4); fi  % short diagonal and terminal
pickup tiny.nib; numeric slope,theta,reduced_hair;
slope=(asc_height-2vair-rule_thickness)/10.5u; theta=angle(-slope,1);
reduced_hair=max(tiny.breadth,hround(slab if hefty:-2stem_corr fi));
lft x3r=hround (3w/56); x5=.5[x3r,x6l]; lft x6r=hround 14/28 w;
x3l-x3r=curve-tiny; pos6(reduced_hair,180);
pos5(reduced_hair,theta); y5=.5[-d,h];
ellipse_set(2l,3l,4l,5l); ellipse_set(2r,3r,4r,5r);
pos7(reduced_hair,270); top y7l=h+o; x7=.45[x6r,x8r];
pos8(curve,30); x8l=good.x(x8l+w/4-x8); y8r=y6;
ellipse_set(7l,6l,5',5l);
filldraw stroke z2e{left}...z3e{up}...z4e---z5e...{up}z6e
 ...z7e{left}...z8e{down};  % bowls
pos10(slab,90); x10=10.5/14 w; bot y10l=-d-o;
pos9(curve,angle(z8-z10)-90);
z9=.5[z8,z10]+(1.75u,0) rotated(angle(z8-z10)+90);
filldraw stroke z8e{down}...z9e{z10-z8}...{right}z10e;  % long diagonal
if serifs: pickup crisp.nib; pos10'(slab,90); z10'=z10;
 pos11(rule_thickness,180); rt x11l=hround(13/14 w);
 y11=(.5(bar_height/asc_height)) [-d,h];
 filldraw stroke z10'e{right}...{up}z11e;  % terminal
 numeric inner_jut; if rt x6l+.5u<lft x0l-1.5jut: inner_jut=1.5jut;
 else: rt x6l+.5u=lft x0l-inner_jut; fi
 dish_serif(0,1,a,.6,inner_jut,b,.5,jut)(dark);  % serif
else: pickup fine.nib; pos10'(slab,90); z10'=z10;
 pos11(Vround .5[rule_thickness,flare],90);
 rt x11=hround(r-letter_fit-u); bot y11l=vround .0316(h+d)-d-o;
 filldraw stroke term.e(10',11,right,1,4); fi  % terminal
penlabels(0,1,2,3,4,5,6,7,8,9,10,11); endchar;

cmchar "\displaystyle large ampersand";
beginchar(9,26u#,0,14/6dh#);
italcorr x_height#*slant-serif_fit# - if serifs: .4u# else: 1.5u# fi;
adjust_fit(0,serif_fit#);
numeric thick_stem, thin_stem;
thick_stem=bold+4dw; thin_stem=rule_thickness+dw;
pickup tiny.nib; pos2(max(slab,thin_stem),-90); x2=(4/14)*w; bot y2r=-d-o;
% this is dirty:
save x_height; x_height:=.62[-d,h];
if not hefty:(x,y2l)=whatever[z2r,(w-5u,x_height)]; x2l:=x; fi
if serifs: pos0(thin_stem,0);
 rt x0r+jut=hround(w-.9u); top y0=.62[-d,h];
 pos1(thin_stem,0); z1=whatever[z0,(.6[x0,x2],-d)];
 y1=max(y0-1.5bracket-.124*(d+h),.413[-d,h]);
 filldraw stroke z0e---z1e...{left}z2e;  % short diagonal
else: pickup fine.nib; pos1(.25[slab,flare],-15); rt x1r=hround(w-2u);
 y1r=good.y .51[-d,h]; x1l:=good.x x1l; y1l:=good.y y1l;
 top z2'l=(x2l,tiny.top y2l); bot z2'r=(x2r,tiny.bot y2r);
 filldraw stroke term.e(2',1,right,1,4); fi  % short diagonal and terminal
pickup tiny.nib; numeric slope,theta,reduced_hair;
slope=(asc_height-2vair-thin_stem)/10.5u; theta=angle(-slope,1);
reduced_hair=max(tiny.breadth,hround(max(slab,thin_stem) if hefty:-2stem_corr fi));
lft x3r=hround (3w/56); x5=.5[x3r,x6l]; lft x6r=hround 14/28 w;
x3l-x3r=thick_stem-tiny; pos6(reduced_hair,180);
pos5(reduced_hair,theta); y5=.5[-d,h];
ellipse_set(2l,3l,4l,5l); ellipse_set(2r,3r,4r,5r);
pos7(reduced_hair,270); top y7l=h+o; x7=.45[x6r,x8r];
pos8(thick_stem,30); x8l=good.x(x8l+w/4-x8); y8r=y6;
ellipse_set(7l,6l,5',5l);
filldraw stroke z2e{left}...z3e{up}...z4e---z5e...{up}z6e
 ...z7e{left}...z8e{down};  % bowls
pos10(thin_stem,90); x10=10.5/14 w; bot y10l=-d-o;
pos9(thick_stem,angle(z8-z10)-90);
z9=.5[z8,z10]+(1.75u,0) rotated(angle(z8-z10)+90);
filldraw stroke z8e{down}...z9e{z10-z8}...{right}z10e;  % long diagonal
if serifs: pickup crisp.nib; pos10'(thin_stem,90); z10'=z10;
 pos11(thin_stem,180); rt x11l=hround(13/14 w);
 y11=(.5(bar_height/asc_height)) [-d,h];
 filldraw stroke z10'e{right}...{up}z11e;  % terminal
 numeric inner_jut; if rt x6l+.5u<lft x0l-1.5jut: inner_jut=1.5jut;
 else: rt x6l+.5u=lft x0l-inner_jut; fi
 dish_serif(0,1,a,.6,inner_jut,b,.5,jut)(dark);  % serif
else: pickup fine.nib; pos10'(thin_stem,90); z10'=z10;
 pos11(Vround .5[thin_stem,flare],90);
 rt x11=hround(r-letter_fit-u); bot y11l=vround .0316(h+d)-d-o;
 filldraw stroke term.e(10',11,right,1,4); fi  % terminal
penlabels(0,1,2,3,4,5,6,7,8,9,10,11); endchar;

charlist 10: 11;  % large "par"

cmchar "\textstyle large reversed ampersand";
beginchar(10,19u#,0,10/6dh#);
italcorr x_height#*slant-serif_fit# - if serifs: .4u# else: 1.5u# fi;
adjust_fit(0,serif_fit#);
pickup tiny.nib; pos2(slab,-90); x2=(4/14)*w; bot y2r=-d-o;
% this is dirty:
save x_height; x_height:=.62[-d,h];
if not hefty:(x,y2l)=whatever[z2r,(w-5u,x_height)]; x2l:=x; fi
if serifs: pos0(rule_thickness,0);
 rt x0r+jut=hround(w-.9u); top y0=.62[-d,h];
 pos1(rule_thickness,0); z1=whatever[z0,(.6[x0,x2],-d)];
 y1=max(y0-1.5bracket-.124*(d+h),.413[-d,h]);
 filldraw stroke z0e---z1e...{left}z2e;  % short diagonal
else: pickup fine.nib; pos1(.25[slab,flare],-15); rt x1r=hround(w-2u);
 y1r=good.y .51[-d,h]; x1l:=good.x x1l; y1l:=good.y y1l;
 top z2'l=(x2l,tiny.top y2l); bot z2'r=(x2r,tiny.bot y2r);
 filldraw stroke term.e(2',1,right,1,4); fi  % short diagonal and terminal
pickup tiny.nib; numeric slope,theta,reduced_hair;
slope=(asc_height-2vair-rule_thickness)/10.5u; theta=angle(-slope,1);
reduced_hair=max(tiny.breadth,hround(slab if hefty:-2stem_corr fi));
lft x3r=hround (3w/56); x5=.5[x3r,x6l]; lft x6r=hround 14/28 w;
x3l-x3r=curve-tiny; pos6(reduced_hair,180);
pos5(reduced_hair,theta); y5=.5[-d,h];
ellipse_set(2l,3l,4l,5l); ellipse_set(2r,3r,4r,5r);
pos7(reduced_hair,270); top y7l=h+o; x7=.45[x6r,x8r];
pos8(curve,30); x8l=good.x(x8l+w/4-x8); y8r=y6;
ellipse_set(7l,6l,5',5l);
filldraw stroke z2e{left}...z3e{up}...z4e---z5e...{up}z6e
 ...z7e{left}...z8e{down};  % bowls
pos10(slab,90); x10=10.5/14 w; bot y10l=-d-o;
pos9(curve,angle(z8-z10)-90);
z9=.5[z8,z10]+(1.75u,0) rotated(angle(z8-z10)+90);
filldraw stroke z8e{down}...z9e{z10-z8}...{right}z10e;  % long diagonal
if serifs: pickup crisp.nib; pos10'(slab,90); z10'=z10;
 pos11(rule_thickness,180); rt x11l=hround(13/14 w);
 y11=(.5(bar_height/asc_height)) [-d,h];
 filldraw stroke z10'e{right}...{up}z11e;  % terminal
 numeric inner_jut; if rt x6l+.5u<lft x0l-1.5jut: inner_jut=1.5jut;
 else: rt x6l+.5u=lft x0l-inner_jut; fi
 dish_serif(0,1,a,.6,inner_jut,b,.5,jut)(dark);  % serif
else: pickup fine.nib; pos10'(slab,90); z10'=z10;
 pos11(Vround .5[slab,flare],90);
 rt x11=hround(r-letter_fit-u); bot y11l=vround .0316(h+d)-d-o;
 filldraw stroke term.e(10',11,right,1,4); fi  % terminal
currentpicture := currentpicture scaled -1 shifted (w,h-d);
penlabels(0,1,2,3,4,5,6,7,8,9,10,11); endchar;

cmchar "\displaystyle large reversed ampersand";
beginchar(11,26u#,0,14/6dh#);
italcorr x_height#*slant-serif_fit# - if serifs: .4u# else: 1.5u# fi;
adjust_fit(0,serif_fit#);
numeric thick_stem, thin_stem;
thick_stem=bold+4dw; thin_stem=rule_thickness+dw;
pickup tiny.nib; pos2(max(slab,thin_stem),-90); x2=(4/14)*w; bot y2r=-d-o;
% this is dirty:
save x_height; x_height:=.62[-d,h];
if not hefty:(x,y2l)=whatever[z2r,(w-5u,x_height)]; x2l:=x; fi
if serifs: pos0(thin_stem,0);
 rt x0r+jut=hround(w-.9u); top y0=.62[-d,h];
 pos1(thin_stem,0); z1=whatever[z0,(.6[x0,x2],-d)];
 y1=max(y0-1.5bracket-.124*(d+h),.413[-d,h]);
 filldraw stroke z0e---z1e...{left}z2e;  % short diagonal
else: pickup fine.nib; pos1(.25[thin_stem,flare],-15); rt x1r=hround(w-2u);
 y1r=good.y .51[-d,h]; x1l:=good.x x1l; y1l:=good.y y1l;
 top z2'l=(x2l,tiny.top y2l); bot z2'r=(x2r,tiny.bot y2r);
 filldraw stroke term.e(2',1,right,1,4); fi  % short diagonal and terminal
pickup tiny.nib; numeric slope,theta,reduced_hair;
slope=(asc_height-2vair-thin_stem)/10.5u; theta=angle(-slope,1);
reduced_hair=max(tiny.breadth,hround(max(slab,thin_stem) if hefty:-2stem_corr fi));
lft x3r=hround (3w/56); x5=.5[x3r,x6l]; lft x6r=hround 14/28 w;
x3l-x3r=thick_stem-tiny; pos6(reduced_hair,180);
pos5(reduced_hair,theta); y5=.5[-d,h];
ellipse_set(2l,3l,4l,5l); ellipse_set(2r,3r,4r,5r);
pos7(reduced_hair,270); top y7l=h+o; x7=.45[x6r,x8r];
pos8(thick_stem,30); x8l=good.x(x8l+w/4-x8); y8r=y6;
ellipse_set(7l,6l,5',5l);
filldraw stroke z2e{left}...z3e{up}...z4e---z5e...{up}z6e
 ...z7e{left}...z8e{down};  % bowls
pos10(thin_stem,90); x10=10.5/14 w; bot y10l=-d-o;
pos9(thick_stem,angle(z8-z10)-90);
z9=.5[z8,z10]+(1.75u,0) rotated(angle(z8-z10)+90);
filldraw stroke z8e{down}...z9e{z10-z8}...{right}z10e;  % long diagonal
if serifs: pickup crisp.nib; pos10'(thin_stem,90); z10'=z10;
 pos11(thin_stem,180); rt x11l=hround(13/14 w);
 y11=(.5(bar_height/asc_height)) [-d,h];
 filldraw stroke z10'e{right}...{up}z11e;  % terminal
 numeric inner_jut; if rt x6l+.5u<lft x0l-1.5jut: inner_jut=1.5jut;
 else: rt x6l+.5u=lft x0l-inner_jut; fi
 dish_serif(0,1,a,.6,inner_jut,b,.5,jut)(dark);  % serif
else: pickup fine.nib; pos10'(thin_stem,90); z10'=z10;
 pos11(Vround .5[thin_stem,flare],90);
 rt x11=hround(r-letter_fit-u); bot y11l=vround .0316(h+d)-d-o;
 filldraw stroke term.e(10',11,right,1,4); fi  % terminal
currentpicture := currentpicture scaled -1 shifted (w,h-d);
penlabels(0,1,2,3,4,5,6,7,8,9,10,11); endchar;

input llcommon;
bye.
