% Copyright (C) 1997, 1999, 2001, 2002 Claudio Beccari % file cbaccent.mf v.2.0f 2001/04/09 % Added cap-cedilla and sloping sides of nexus 2001/02/25 % modified circumflex for the cbleipzig fonts 2001/04/22 % % The accent macros that follow are used by all the vowel macros for % generating the ligatures; they mostly come from Computer Modern. % % CB added the tests on boolean monotoniko whose value is set either by the % driver files or it is false by default. Fixed the currentbreadth problem, % and changed several dimensions so as to work well with different parameter % settings. % % Several accents were completely redesigned, in particular grave and acute % and their combinations with diaeresis or breaths are such that do not % change according to the letter they accompany; in a different way % also the circumflex and the diaeresis have been modified accordingly. % % Booleans monotoniko and toniko are remains of a previous test version % where the monotoniko accent was the single one for modern Greek designed as % a vertical stroke; thanks to Apostolos Syropoulos this feature has been % eliminated. % (1999) CB added definitions for adscript iota to be used with upper % case Alpha, Eta and Omega, and for the corresponding small cap variants. boolean toniko, squeeze; % minimum distance between vowel and accent def separator=max(1,vround(x_height/10)) enddef; def grave(expr center) = numeric acc_sgn,acc_displ; acc_displ:=center; if monotoniko: acc_sgn:=0; else: acc_sgn:=+1; fi generate_grave; enddef; def acute(expr center) = numeric acc_sgn,acc_displ; acc_displ:=center; if monotoniko: acc_sgn:=0; else: acc_sgn:=-1; fi generate_grave; enddef; % The next definition draws both the grave (as its name suggests) and the % acute accents, the difference being the value of acc_sgn, where % acc_sgn=+1 tilts the accent to the left (grave) % acc_sgn=-1 tilts the accent to the right (acute) % acc_sgn=0 does not tilt the accent (monotoniko) vardef generate_grave= numeric accent_tilt, alto, basso; accent_tilt:=if cbleipzig or cbroman:20else:30fi; alto:=h; basso:=vround .8[h,x_height]; 1/3[x22,x21]=acc_displ; if serifs: pickup crisp.nib; accent_tilt:= acc_sgn*(accent_tilt+angle(alto-basso,.5currentbreadth)); pos22(max(stem/5,currentbreadth+eps),accent_tilt); pos21(stem,accent_tilt); if monotoniko: bot y22=basso; top y21=alto; x22-x21=(alto-basso)*sind accent_tilt; else: bot y22=basso; top y21+.5stem=alto; z21-z22=whatever*dir(90+accent_tilt); fi filldraw circ_stroke z21e--z22e; % diagonal else: pickup fine.nib; accent_tilt:= acc_sgn*accent_tilt; pos21(stem,0); pos22(vair,0); top y21=alto; bot y22=basso; x22-x21=(alto-basso)*sind accent_tilt; filldraw stroke z21e--z22e; % diagonal fi penlabels(21,22); currentbreadth:=0; enddef; def circumflex(expr center)= if monotoniko: grave(center); else: generate_circumflex(center); fi enddef; def generate_circumflex(expr center)= numeric mid_width; if slitex: % for slides it looks like a cap mid_width=vair; pos21(vair,-180); pos23(vair,0); y21=y23; lft x21r=hround(center-if monospace and (w<6u):1.5u else:max(3u,2w/5)fi); .5[rt x23r,lft x21r]=center; x22=center; pos22(mid_width,90); bot y23=vround(max(h-2mid_width,x_height+mid_width)); top y22r=h+o; if bot y23>=top y22r: bot y23:= top y22r-mid_width; fi filldraw stroke z21e{up}...z22e...{down}z23e; elseif cbleipzig: h':=if h=Circ_ht:h else:10/7x_height fi; numeric theta; theta=angle(1/6(6u-vair),1/4(asc_height-x_height)); pickup crisp.nib; mid_width=.4[vair,stem]; pos[21](vair,theta+90); pos[22](vair,theta+90); pos[23](vair,theta+90); pos[24](vair,theta+90); z[22]-z[21]= z[24]-z[23]=(mid_width-crisp)*dir theta; lft x[21]r=hround(center-max(3u,w/2-2.5u)); rt x[24]l=hround(center+max(3u,w/2-2.5u)); top y[24]r=h'; pair delta; ypart delta=3(y[23]l-y[21]l); delta=whatever*dir theta; numeric deltay; deltay=vround(Circ_ht-(y24r-y23r)-(.4(bot y[21]l-top y[21]r)+2/3[x_height,Circ_ht])); bot y[21]l=y23l-deltay; %if h=Circ_ht: % vround(bot y[21]l-top y[21]r+min(2/3[x_height,Circ_ht],y[23]l-.25vair)); %else: % vround(y[23]l-.5dot_size) %fi; filldraw z[21]l..controls(z[21]l+delta)and(z[23]l-delta)..z[23]l..z[24]l--z[24]r.. controls(z[24]r-delta)and(z[22]r+delta)..z[22]r..z[21]r--cycle; % stroke else: mid_width:=if squeeze:.3 else: .5 fi [vair,stem]; pickup fine.nib; pos21(hround(mid_width-eps),180); pos22(vair,90); pos23(mid_width,45); pos24(vair,90); pos25(hround(mid_width-eps),180); lft x21r=hround(center-if monospace: if(w<5u):1.5u else:max(3u,w/3)fi else: max(3u,w/3) fi); .5[rt x25l,lft x21r]=center; (x22-x21)=x23-x22=x24-x23=(x25-x24); if h=Circ_ht: bot y21l=bot y24l=vround(.45[h,x_height+.5mid_width]); else: bot y21l=bot y24l=vround(max(.5[h,x_height],x_height if not SansSerif:+o fi+separator)); fi top y22r=top y25r=h; y23=.5[y22,y24]; filldraw stroke z21e{up}...z22e{right}..z23e..{right}z24e...{up}z25e; % stroke fi penlabels(21,22,23,24,25); currentbreadth:=0; enddef; vardef diaeresis(expr center)= generate_diaeresis(center,dot_size,dot_size+1.75u,h,x_height+separator); enddef; vardef diaeresis_acute(expr center)= acute(center); generate_diaeresis(center,6/8dot_size,13/8dot_size if cbleipzig or SansSerif:+u fi,.5[h,x_height],x_height+separator); enddef; vardef diaeresis_grave(expr center)= grave(center); generate_diaeresis(center,6/8dot_size,13/8dot_size if cbleipzig or SansSerif:+u fi,.5[h,x_height],x_height+separator); enddef; vardef diaeresis_circumflex(expr center)= if monotoniko: grave(center); generate_diaeresis(center,.9dot_size,-1,.5[h,x_height],x_height+separator); else: generate_circumflex(center); numeric sp_bottom, sp_top; if (not slitex): sp_top=vround(.15[bot y21l,x_height]); sp_top+sp_bottom=bot y21l+x_height; else: sp_top=vround(.5[bot y21l,bot y22l]-separator); sp_bottom=vround(x_height+separator); fi generate_diaeresis(center,6/8dot_size,11/8dot_size if cbleipzig:+u fi,sp_top,sp_bottom); fi enddef; vardef generate_diaeresis(expr center,target_dot_diam,sep,eff_h,base)= pickup tiny.nib; numeric dot_diam; dot_diam:=max(tiny.breadth,hround(target_dot_diam)); pos31(dot_diam,0); pos32(dot_diam,90); x31=x32; top y32r=vround(eff_h); if bot y32l=0 : center=.5[x31,x33]; x33-x31=sep; else: y35l=y35r=.5[y31,y32]; z35l=whatever[z21l,z22l]; z35r=whatever[z21r,z22r]; rt x31r=hround((min(x35l,x35r)-.5currentbreadth)-.05w); lft x33l=hround((max(x35l,x35r)+.5currentbreadth)+.05w); fi dot(31,32); dot(33,34); penlabels(31,32,33,34,35); currentbreadth:=0; enddef; def rough(suffix $,@)(expr dot_size,depth,shear) = if (not monotoniko): pickup fine.nib; pos$(dot_size,90); if square_dots: pos$'(dot_size,180); z$'=z$; dot($',$); % squarish dot comma_join_:=max(fine.breadth,floor .7dot_size); comma_bot_:=max(fine.breadth,floor .5dot_size); pos@0(comma_join_,180); pos@1(comma_join_,180); pos@2(comma_bot_,180); y@0=y$; y@1=y$l; y@2=y@1+dot_size-depth; x@0r=x@1r=x$'r; lft x@2r=good.x(x$-eps); filldraw stroke z@0e--z@1e..z@2e; % tail else: tail_thick:=if cbleipzig: max(.4dot_size,currentbreadth+eps); elseif SansSerif: max(dot_size/2,currentbreadth+eps); else: if (fine>.2dot_size):floor(min(fine.breadth,vair)) else:max(vair/2,currentbreadth+eps)fi fi; pos@1(tail_thick,90); pos@2(tail_thick,180); pos@3(tail_thick,-90); z@1r=z$r; lft x@2r=hround(x$-.5depth+.5shear if (cbleipzig and (top y$r.2dot_size):floor(min(fine.breadth,vair)) else:max(vair/2,currentbreadth+eps)fi fi; pos@1(tail_thick,90); pos@2(tail_thick,0); pos@3(tail_thick,-90); z@1r=z$r; rt x@2r=hround(x$+.5depth+.5shear if (cbleipzig and (top y$r0 : center=.5[x31,x33]; x33-x31=sep; else: y35l=y35r=.5[y31,y32]; z35l=whatever[z21l,z22l]; z35r=whatever[z21r,z22r]; rt x31r=hround((min(x35l,x35r)-.5currentbreadth)-.05w); lft x33l=hround((max(x35l,x35r)+.5currentbreadth)+.05w); fi dot(31,32); dot(33,34); penlabels(31,32,33,34,35); endchar;% "Diaeresis" cmchar "Rough breathing"; beginchar("<",if monospace:9else:4fi u#,acc_ht#,0); adjust_fit(0,0); toniko:=monotoniko; monotoniko:=false; spirit(.5w)<; monotoniko:=toniko; endchar;% "Rough breathing" cmchar "Smooth breathing"; beginchar(">",if monospace:9else:4fi u#,acc_ht#,0); adjust_fit(0,0); toniko:=monotoniko; monotoniko:=false; spirit(.5w)>; monotoniko:=toniko; endchar;% "Smooth breathing" cmchar "Rough breathing with acute"; beginchar(oct"126",if monospace:9else:5fi u#,acc_ht#,0); adjust_fit(0,0); toniko:=monotoniko; monotoniko:=false; spirit_acute(.5w)<; monotoniko:=toniko; endchar;% "Rough breathing with acute" cmchar "Rough breathing with grave"; beginchar(oct"103",if monospace:9else:5fi u#,acc_ht#,0); adjust_fit(0,0); toniko:=monotoniko; monotoniko:=false; spirit_grave(.5w)<; monotoniko:=toniko; endchar;% "Rough breathing with grave" cmchar "Rough breathing with circumflex"; beginchar(oct"100",if monospace:9else:6fi u#,Circ_ht#,0); adjust_fit(0,0); toniko:=monotoniko; monotoniko:=false; squeeze:=true; spirit_circumflex(.5w)<; monotoniko:=toniko; endchar;% "Rough breathing with circumflex" cmchar "Smooth breathing with acute"; beginchar(oct"136",if monospace:9else:5fi u#,acc_ht#,0); adjust_fit(0,0); toniko:=monotoniko; monotoniko:=false; spirit_acute(.5w)>; monotoniko:=toniko; endchar;% "Smooth breathing with acute" cmchar "Smooth breathing with grave"; beginchar(oct"137",if monospace:9else:5fi u#,acc_ht#,0); adjust_fit(0,0); toniko:=monotoniko; monotoniko:=false; spirit_grave(.5w)>; monotoniko:=toniko; endchar;% "Smooth breathing with grave" cmchar "Smooth breathing and circumflex"; beginchar(oct"134",if monospace:9else:6fi u#,Circ_ht#,0); adjust_fit(0,0); toniko:=monotoniko; monotoniko:=false; squeeze:=true; spirit_circumflex(.5w)>; monotoniko:=toniko; endchar;% "Smooth breathing and circumflex" cmchar "Diaeresis with acute"; beginchar(oct"043",if monospace:9else:5fi u#,acc_ht#,0); adjust_fit(0,0); toniko:=monotoniko; monotoniko:=false; diaeresis_acute(.5w); monotoniko:=toniko; endchar;% "Diaeresis with acute" cmchar "Diaeresis with grave"; beginchar(oct"044",if monospace:9else:5fi u#,acc_ht#,0); adjust_fit(0,0); toniko:=monotoniko; monotoniko:=false; diaeresis_grave(.5w); monotoniko:=toniko; endchar;% "Diaeresis with grave" cmchar "Diaeresis with circumflex"; beginchar(oct"040",if monospace:9else:8fi u#,Circ_ht#,0); adjust_fit(0,0); toniko:=monotoniko; monotoniko:=false; squeeze:=true; diaeresis_circumflex(.5w); monotoniko:=toniko; endchar;% "Diaeresis with circumflex" cmchar "Iota subscript"; beginchar("|",if monospace:9else:2fi u#,0,.6desc_depth#); adjust_fit(0,0); toniko:=monotoniko; monotoniko:=false; iota_sub(.5w); monotoniko:=toniko; endchar;% "Iota subscript" cmchar "Breve accent"; beginchar(oct"036",7u#,min(asc_height#,2x_height#),0); italcorr h#*slant+.5vair#-1.5u#; adjust_fit(0,0); pickup crisp.nib; pos1(vair,-180); pos3(vair,0); top y1=top y3=h; lft x1r=w-rt x3r=0; numeric mid_thickness; mid_thickness=vround 1/3[vair,stem]; pos2(mid_thickness,-90); x2=.5w; bot y2r=vround (1/3[x_height,h]+o-.5mid_thickness); filldraw stroke z1e{down}...z2e{right}...{up}z3e; % stroke currentbreadth:=0; endchar;% "Breve accent" cmchar"Wide breve accent"; beginchar(oct"227",12u#,min(asc_height#,2x_height#),0); italcorr h#*slant+.5vair#-1.5u#; adjust_fit(0,0); pickup crisp.nib; pos1(vair,-180); pos3(vair,0); top y1=top y3=h; lft x1r=w-rt x3r=0; numeric mid_thickness; mid_thickness=vround 1/3[vair,stem]; pos2(mid_thickness,-90); x2=.5w; bot y2r=vround (1/3[x_height,h]+o-.5mid_thickness); filldraw stroke z1e{(1,-1)}...z2e{right}...{1,1}z3e; % stroke currentbreadth:=0; penlabels(1,2,3,4,5); endchar;% "Wide breve accent" cmchar "Macron (bar) accent"; numeric macron_breadth#; macron_breadth#=.2[vair#,stem#]; beginchar(oct"037",7u#,.15[x_height#,asc_height#]+macron_breadth#,0); italcorr h#*slant-.75u#; adjust_fit(0,0); numeric macron_breadth; macron_breadth:=Vround .2[vair,stem]; pickup if serifs: crisp.nib else: fine.nib fi; pos1(macron_breadth,90); pos2(macron_breadth,90); %top y1r=top y2r=h+o; lft x1=w-rt x2=0; bot y1l=bot y2l=vround (h+o); filldraw stroke z1e--z2e; % bar currentbreadth:=0; endchar;% "Macron (bar) accent" cmchar "Lowered cap to go under iota or upsilon"; beginchar(oct"001",6u#,0,desc_depth#); adjust_fit(0,0); numeric mid_width;mid_width=1/3[vair,stem]; pickup if serifs: crisp.nib else: fine.nib fi; pos1(vair,135); pos2(mid_width,90); pos3(vair,45); lft x1r=0; rt x3r=w; bot y1l=max(-d,-3mid_width)-separator=bot y3l; x2=.5[lft x1r,rt x3r]; top y2r=-separator; filldraw double_circ_stroke z1e..z2e..z3e; penlabels(1,2,3); currentbreadth:=0; endchar;% "Lowered cap to go under iota or upsilon" cmchar "Small tie to go under any letter"; beginchar(oct"024",6u#,0,desc_depth#); adjust_fit(0,0); numeric mid_width;mid_width=1/3[vair,stem]; pickup if serifs: crisp.nib else: fine.nib fi; pos1(vair,-135); pos2(mid_width,-90); pos3(vair,-45); lft x1r=0; rt x3r=w; top y1l=-separator=top y3l; x2=.5[lft x1r,rt x3r]; bot y2r=max(-d,-3mid_width)-separator; filldraw double_circ_stroke z1e..z2e..z3e; penlabels(1,2,3); currentbreadth:=0; endchar;% "Small tie to go under any letter" %endinput; % questi sono i due lati di un circonflesso ^ col vertice alla base cmchar "Left side of nexus"; beginchar(oct"020",2.5u#,0,desc_depth#); adjust_fit(0,0); pickup if serifs: crisp.nib else: fine.nib fi; pos1(hair,135); pos2(1.5u,angle((-slant,1))); lft x1r=0; bot y1l=-d; rt x2l=hround(w+eps); top y2r=h; filldraw circ_stroke z1e--z2e; penlabels(1,2); endchar;% "Left side of nexus" cmchar "Right side of nexus"; beginchar(oct"021",3.5u#,0,desc_depth#); adjust_fit(0,0); pickup if serifs: crisp.nib else: fine.nib fi; pos2(hair,45); pos1(1.5u,angle((-slant,1))); lft x1l=hround(0-eps); top y1r=h; rt x2r=w; bot y2l=-d; filldraw circ_stroke z2e--z1e; penlabels(1,2); endchar;% "Right side of nexus" endinput;