| 1 |
% This file contains accents common to text roman and italic fonts. |
| 2 |
% Modified by WaS for the CM Bright fonts [1995/10/15 v0.998]. |
| 3 |
% Character codes \0022--\0030, \0040, \0136--\0137, \0175--\0177 are generated. |
| 4 |
% (Actually the accents in positions \0040, \0137, and \0175 are not generated |
| 5 |
% unless |ligs>0|, since other symbols are substituted |
| 6 |
% for those accents in non-ligature fonts.) |
| 7 |
|
| 8 |
cmchar "Grave accent"; |
| 9 |
beginchar(oct"022",9u#,min(asc_height#,2x_height#),0); |
| 10 |
adjust_fit(0,0); |
| 11 |
if serifs: pickup crisp.nib; x1-.5stem=hround 2u; x2=2/3[x1,w-x1]; |
| 12 |
y1+.5stem=h+eps; y2=max(2/3[h,x_height],x_height+o+hair); |
| 13 |
numeric theta; theta=angle(z2-z1)+90; |
| 14 |
pos1(stem,theta); pos2(hair,theta); |
| 15 |
filldraw circ_stroke z1e--z2e; % diagonal |
| 16 |
else: pickup fine.nib; pos1(stem,0); pos2(vair,0); |
| 17 |
lft x1l=hround 1.5u; rt x2r=hround(.5w+.25u+.5vair); |
| 18 |
top y1=h; bot y2=vround 2/3[h,x_height]; |
| 19 |
filldraw stroke z1e--z2e; fi % diagonal |
| 20 |
penlabels(1,2); endchar; |
| 21 |
|
| 22 |
cmchar "Acute accent"; |
| 23 |
beginchar(oct"023",9u#,min(asc_height#,2x_height#),0); |
| 24 |
italcorr h#*slant-if serifs: 1.5 fi u#; |
| 25 |
adjust_fit(0,0); |
| 26 |
if serifs: pickup crisp.nib; x1+.5stem=hround(w-2u); x2=2/3[x1,w-x1]; |
| 27 |
y1+.5stem=h+eps; y2=max(2/3[h,x_height],x_height+o+hair); |
| 28 |
numeric theta; theta=angle(z2-z1)+90; |
| 29 |
pos1(stem,theta); pos2(hair,theta); |
| 30 |
filldraw circ_stroke z1e--z2e; % diagonal |
| 31 |
else: pickup fine.nib; pos1(stem,0); pos2(vair,0); |
| 32 |
rt x1r=hround(w-1.5u); lft x2l=hround(.5w-.25u-.5vair); |
| 33 |
top y1=h; bot y2=vround 2/3[h,x_height]; |
| 34 |
filldraw stroke z1e--z2e; fi % diagonal |
| 35 |
penlabels(1,2); endchar; |
| 36 |
|
| 37 |
cmchar "Hachek (check) accent"; |
| 38 |
beginchar(oct"024",9u#,.75[x_height#,min(asc_height#,2x_height#)],0); |
| 39 |
h':=vround min(asc_height,2x_height); % height of circumflex being inverted |
| 40 |
if serifs: italcorr h#*slant+.5hair#-1.75u#; |
| 41 |
adjust_fit(0,0); |
| 42 |
pickup crisp.nib; pos2'(.5[vair,curve],90); top y2'r=h; |
| 43 |
pos2(.5[vair,curve],90); x2=.5w; |
| 44 |
x1=w-x3=good.x 2.25u; top y1=top y3=h; y1-y2=.5(y2'-x_height); |
| 45 |
pos1(hair,angle(z2-z1)+90); pos3(hair,angle(z3-z2)+90); |
| 46 |
filldraw stroke z1e--z2e--z3e; % diagonals |
| 47 |
else: italcorr h#*slant-.5stem#+.5vair#-.75u#; |
| 48 |
adjust_fit(0,0); |
| 49 |
pickup fine.nib; pos1(vair,0); pos3(vair,0); x1=w-x3; |
| 50 |
pos2(stem,0); bot y2=vround(1/12[x_height,h']+o); x2=.5w; |
| 51 |
top y1=top y3=h+o; lft x1l=hround(rt x2r-3.25u-.5vair); |
| 52 |
z0=whatever[z1r,z2r]=whatever[z2l,z3l]; |
| 53 |
y4l=y4r=y2; x4l=good.x .2[x2l,x2]; x4r=w-x4l; |
| 54 |
filldraw z4l--z1l--z1r--z0--z3l--z3r--z4r--cycle; fi % diagonals |
| 55 |
penlabels(0,1,2,3,4); endchar; |
| 56 |
|
| 57 |
cmchar "Breve accent"; |
| 58 |
beginchar(oct"025",9u#,min(asc_height#,2x_height#),0); |
| 59 |
italcorr h#*slant+.5vair#-1.5u#; |
| 60 |
adjust_fit(0,0); |
| 61 |
pickup crisp.nib; pos1(vair,-180); pos3(vair,0); |
| 62 |
top y1=top y3=h; lft x1r=w-rt x3r=hround(2u-.5vair); |
| 63 |
numeric mid_thickness; mid_thickness=vround 1/3[vair,stem]; |
| 64 |
pos2(mid_thickness,-90); x2=.5w; |
| 65 |
bot y2r=vround max(x_height+o+tiny,1/3[x_height,h]+o-.5mid_thickness); |
| 66 |
filldraw stroke z1e{down}...z2e{right}...{up}z3e; % stroke |
| 67 |
penlabels(1,2,3); endchar; |
| 68 |
|
| 69 |
cmchar "Macron (bar) accent"; |
| 70 |
numeric macron_breadth#; macron_breadth#=.2[vair#,stem#]; |
| 71 |
beginchar(oct"026",9u#,.4[x_height#,asc_height#]+macron_breadth#,0); |
| 72 |
italcorr h#*slant-.75u#; |
| 73 |
adjust_fit(0,0); |
| 74 |
numeric macron_breadth; macron_breadth:=Vround .2[vair,stem]; |
| 75 |
pickup if serifs: crisp.nib else: fine.nib fi; |
| 76 |
pos1(macron_breadth,90); pos2(macron_breadth,90); |
| 77 |
top y1r=top y2r=h+o; lft x1=w-rt x2=hround 1.25u; |
| 78 |
filldraw stroke z1e--z2e; % bar |
| 79 |
penlabels(1,2); endchar; |
| 80 |
|
| 81 |
cmchar "Scandinavian circle accent"; |
| 82 |
beginchar(oct"027",13u#+4/3(asc_height#-x_height#)*slant,asc_height#,0); |
| 83 |
adjust_fit(cap_serif_fit#,cap_serif_fit#); |
| 84 |
numeric circ_hair,circ_vair; |
| 85 |
circ_hair=hround min(hair,u+.5); circ_vair=vround min(vair,(h-x_height)/6+.5); |
| 86 |
penpos1(circ_vair,90); penpos3(circ_vair,-90); |
| 87 |
penpos2(circ_hair,180); penpos4(circ_hair,0); |
| 88 |
x2r=hround(.5w-1.5u-.5circ_hair); |
| 89 |
x4r=w-x2r; x1=x3=.5w; y1r=h+apex_o; y2=y4=.5[y1,y3]; |
| 90 |
y3r=vround(1/3[x_height,h]+apex_o); |
| 91 |
penstroke pulled_arc.e(1,2) & pulled_arc.e(2,3) |
| 92 |
& pulled_arc.e(3,4) & pulled_arc.e(4,1) & cycle; % bowl |
| 93 |
penlabels(1,2,3,4); endchar; |
| 94 |
|
| 95 |
cmchar "Cedilla accent"; |
| 96 |
beginchar(oct"030",8u#,0,.875desc_depth#); |
| 97 |
adjust_fit(0,0); |
| 98 |
x1=.5w+.5u; |
| 99 |
if serifs: pickup crisp.nib; pos1(stem,0); pos2(stem,0); |
| 100 |
pos3(vair,90); pos4(stem,0); pos5(vair,-90); |
| 101 |
x1=x2; z3l=z2l; x4=x2+1.5u; x5=x3-1.5u; |
| 102 |
bot y1=-o; bot y2=-vround 2/7d-o; y4=.5[y3,y5]; bot y5=-d-o; |
| 103 |
filldraw stroke z1e--z2e; % stem |
| 104 |
filldraw stroke z3e{right}...z4e{down}...{left}z5e; % hook |
| 105 |
else: pickup fine.nib; pos1(vair,0); top y1=-o-2; |
| 106 |
pos2(.5[vair,stem],0); bot y2=-d-o; x2=x1-1.25u; |
| 107 |
filldraw stroke z1e--z2e; fi % diagonal |
| 108 |
penlabels(1,2,3,4,5); endchar; |
| 109 |
|
| 110 |
iff ligs>0: cmchar "Cross for Polish l and L"; |
| 111 |
if unknown l_width#: |
| 112 |
l_width#:=5u#+2serif_fit#; fi % nominal width of `l' |
| 113 |
if unknown L_stem#: |
| 114 |
L_stem#:=cap_serif_fit#+max(2u#+.5cap_stem#,3u#); fi % center of `L' stem |
| 115 |
ligtable oct"040": "l" kern -l_width#-2letter_fit#, |
| 116 |
"L" kern -.5l_width#-L_stem#-2letter_fit#; |
| 117 |
beginchar(oct"040",l_width#,x_height#,0); |
| 118 |
adjust_fit(stem_shift#,-stem_shift#); |
| 119 |
pickup crisp.nib; x2-x1=max(4u,2.8u+stem); .5[x1,x2]=.5w; |
| 120 |
y1-.5bar=.2[bar_height,x_height]; y2+.5bar=.8[bar_height,x_height]; |
| 121 |
numeric theta; theta=angle(z2-z1)+90; |
| 122 |
pos1(bar,theta); pos2(bar,theta); |
| 123 |
filldraw stroke z1e--z2e; % diagonal |
| 124 |
penlabels(1,2); endchar; |
| 125 |
|
| 126 |
cmchar "Circumflex (hat) accent"; |
| 127 |
beginchar(oct"136",9u#,min(asc_height#,2x_height#),0); |
| 128 |
if serifs: italcorr .5[x_height#,h#]*slant+.5hair#-1.75u#; |
| 129 |
adjust_fit(0,0); |
| 130 |
pickup crisp.nib; pos2(.5[vair,curve],90); top y2r=h; x2=.5w; |
| 131 |
x1=w-x3=good.x 2.25u; y1=y3=.5[x_height,y2]; |
| 132 |
pos1(hair,angle(z2-z1)+90); pos3(hair,angle(z3-z2)+90); |
| 133 |
filldraw stroke z1e--z2e--z3e; % diagonals |
| 134 |
else: italcorr 2/3[x_height#,h#]*slant-.5stem#+.5vair#-.75u#; |
| 135 |
adjust_fit(0,0); |
| 136 |
pickup fine.nib; pos1(vair,0); pos3(vair,0); x1=w-x3; |
| 137 |
pos2(stem,0); top y2=h; x2=.5w; bot y1=bot y3=vround 2/3[h,x_height]-eps; |
| 138 |
lft x1l=hround(rt x2r-3.25u-.5vair); % same slope as in the acute accent |
| 139 |
z0=whatever[z1r,z2r]=whatever[z2l,z3l]; |
| 140 |
y4l=y4r=y2; x4l=good.x .2[x2l,x2]; x4r=w-x4l; |
| 141 |
filldraw z4l--z1l--z1r--z0--z3l--z3r--z4r--cycle; fi % diagonals |
| 142 |
penlabels(0,1,2,3,4); endchar; |
| 143 |
|
| 144 |
iff ligs>0: cmchar "Dot accent"; % (WaS) |
| 145 |
% numeric dot_diam#; dot_diam#=max(dot_size#,cap_curve#); |
| 146 |
dot_diam#:=min(dot_size#,stem'/hppp); |
| 147 |
beginchar(oct"137",5u#,min(asc_height#,1.3x_height#+.5dot_diam#),0); |
| 148 |
% define_whole_blacker_pixels(dot_diam); |
| 149 |
dot_diam:=min(stem',dot_size); |
| 150 |
italcorr h#*slant+.5dot_diam#-2u#; |
| 151 |
adjust_fit(0,0); |
| 152 |
pickup tiny.nib; pos1(dot_diam,0); pos2(dot_diam,90); |
| 153 |
x1=x2=.5w; top y2r=h+1; |
| 154 |
if bot y2l<x_height+o+slab: y2l:=min(y2r-eps,x_height+o+slab+.5tiny); fi |
| 155 |
y1=.5[y2l,y2r]; dot(1,2); % dot |
| 156 |
penlabels(1,2); endchar; |
| 157 |
|
| 158 |
iff ligs>0: cmchar "Long Hungarian umlaut accent"; |
| 159 |
beginchar(oct"175",9u#,min(asc_height#,2x_height#),0); |
| 160 |
italcorr h#*slant-u#; |
| 161 |
adjust_fit(0,0); |
| 162 |
x3-x1=x4-x2=hround 3u; y3=y1; y4=y2; |
| 163 |
if serifs: pickup crisp.nib; x3+.5stem=hround(w-1.5u); x2=2.5u; |
| 164 |
y1+.5stem=h; y2=max(2/3[h,x_height],x_height+o+hair); |
| 165 |
numeric theta; theta=angle(z2-z1)+90; |
| 166 |
pos1(stem,theta); pos2(hair,theta); |
| 167 |
pos3(stem,theta); pos4(hair,theta); |
| 168 |
filldraw circ_stroke z1e--z2e; % left diagonal |
| 169 |
filldraw circ_stroke z3e--z4e; % right diagonal |
| 170 |
else: pickup fine.nib; pos1(stem,0); pos2(vair,0); |
| 171 |
pos3(stem,0); pos4(vair,0); |
| 172 |
rt x3r=hround(w-1.5u); lft x4l=hround(.5w+u-.5vair); |
| 173 |
top y1=h; bot y2=vround 2/3[h,x_height]; |
| 174 |
filldraw stroke z1e--z2e; % left diagonal |
| 175 |
filldraw stroke z3e--z4e; fi % right diagonal |
| 176 |
penlabels(1,2,3,4); endchar; |
| 177 |
|
| 178 |
cmchar "Tilde (squiggle) accent"; |
| 179 |
beginchar(oct"176",9u#,min(asc_height#,10/7x_height#+.5dot_size#),0); |
| 180 |
italcorr h#*slant-u#; |
| 181 |
adjust_fit(0,0); |
| 182 |
if serifs: numeric theta; theta=angle(1/6(6u-vair),1/4(h-x_height)); |
| 183 |
pickup crisp.nib; numeric mid_width; mid_width=.4[vair,stem]; |
| 184 |
pos1(vair,theta+90); pos2(vair,theta+90); |
| 185 |
pos3(vair,theta+90); pos4(vair,theta+90); |
| 186 |
z2-z1=z4-z3=(mid_width-crisp)*dir theta; |
| 187 |
lft x1r=w-rt x4l=hround 1.5u; top y4r=h; |
| 188 |
bot y1l=vround(bot y1l+min(2/3[x_height,h],y3l-.25vair)-top y1r); |
| 189 |
pair delta; ypart delta=3(y3l-y1l); delta=whatever*dir theta; |
| 190 |
filldraw z1l..controls(z1l+delta)and(z3l-delta)..z3l..z4l |
| 191 |
--z4r..controls(z4r-delta)and(z2r+delta)..z2r..z1r--cycle; % stroke |
| 192 |
else: pickup fine.nib; pos1(vair,180); pos2(vair,90); |
| 193 |
pos3(.5[vair,slab],90); pos4(vair,90); pos5(vair,180); |
| 194 |
lft x1r=w-rt x5l=hround 1.5u; x2-x1=x3-x2=x4-x3=x5-x4; |
| 195 |
bot y1=bot y4l=vround(.75[x_height,h]-vair); |
| 196 |
top y2r=top y5=h; y3=.5[y2,y4]; |
| 197 |
filldraw stroke z1e{up}...z2e{right}..z3e..{right}z4e...{up}z5e; fi % stroke |
| 198 |
penlabels(1,2,3,4,5); endchar; |
| 199 |
|
| 200 |
cmchar "Umlaut (double dot) accent"; % (WaS) |
| 201 |
dot_diam#:=min(dot_size#,stem'/hppp); |
| 202 |
%beginchar(oct"177",9u#,min(asc_height#,10/7x_height#+.5dot_diam#),0); |
| 203 |
beginchar(oct"177",9u#,min(asc_height#,1.3x_height#+.5dot_diam#),0); |
| 204 |
dot_diam:=min(stem',hround(dot_size-2stem_corr)); |
| 205 |
italcorr h#*slant+.5dot_diam#-2.25u#; |
| 206 |
adjust_fit(0,0); |
| 207 |
pickup tiny.nib; pos1(dot_diam,0); pos2(dot_diam,90); |
| 208 |
x1=x2=2.75u; top y2r=h+1; |
| 209 |
if bot y2l<x_height+o+slab: y2l:=min(y2r-eps,x_height+o+slab+.5tiny); fi |
| 210 |
y1=.5[y2l,y2r]; dot(1,2); % left dot |
| 211 |
pos3(dot_diam,0); penpos4(y2r-y2l,90); y3=y4=y1; x3=x4=w-x1; |
| 212 |
dot(3,4); % right dot |
| 213 |
penlabels(1,2,3,4); endchar; |