| 1 |
% This is the driver file lroman.mf based on roman.mf in the |
| 2 |
% Computer Modern Roman family of fonts (by D. E. Knuth, 1979--1985) |
| 3 |
% It differs from roman.mf only in that it has been |
| 4 |
% adjusted to change capital I with a special uppercase I |
| 5 |
% for the Slides fonts: llcmss8, llcmssb8, llcmssi8 and llcmsso8. |
| 6 |
% Also the lower case l has been modified in order to avoid confusions |
| 7 |
% with other glyphs. |
| 8 |
% Written by Pierre A. MacKay, 16 Sept. 1986 |
| 9 |
% and modified by Claudio Beccari, 1999 |
| 10 |
|
| 11 |
if ligs>1: font_coding_scheme:="TeX text"; |
| 12 |
spanish_shriek=oct"074"; spanish_query=oct"076"; |
| 13 |
else: font_coding_scheme:=if ligs=0: "TeX typewriter text" |
| 14 |
else: "TeX text without f-ligatures" fi; |
| 15 |
spanish_shriek=oct"016"; spanish_query=oct"017"; fi |
| 16 |
|
| 17 |
mode_setup; font_setup; |
| 18 |
|
| 19 |
input romanu; % upper case (majuscules) |
| 20 |
input romanl; % lower case (minuscules) |
| 21 |
input greeku; % upper case Greek letters |
| 22 |
input romand; % numerals |
| 23 |
input romanp; % ampersand, question marks, currency sign |
| 24 |
input romspl; % lowercase specials (dotless \i, ligature \ae, etc.) |
| 25 |
input romspu; % uppercase specials (\AE, \OE, \O) |
| 26 |
input punct; % punctuation symbols common to roman and italic text |
| 27 |
input accent; % accents common to roman and italic text |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
if ligs>1: input romlig; fi % letter ligatures |
| 32 |
if ligs>0: input comlig; fi % ligatures common with italic text |
| 33 |
if ligs<=1: input romsub; fi % substitutes for ligatures |
| 34 |
|
| 35 |
% Redrawing capital I |
| 36 |
|
| 37 |
cmchar "The modified letter I"; |
| 38 |
beginchar("I",max(6u#,4u#+cap_stem#),cap_height#,0); |
| 39 |
italcorr cap_height#*slant-.25u#; |
| 40 |
adjust_fit(cap_serif_fit#,cap_serif_fit#); |
| 41 |
pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0); |
| 42 |
lft x1l=lft x2l=hround(.5w-.5cap_stem); top y1=h; bot y2=0; |
| 43 |
filldraw stroke z1e--z2e; % stem |
| 44 |
pickup crisp.nib; % arms |
| 45 |
pos5(hair,90); pos6(hair,90); % top arm |
| 46 |
lft x5= hround(u);rt x6=hround(w-u); top y5r=top y6r= top y1; |
| 47 |
filldraw stroke z5e--z6e; |
| 48 |
pos7(hair,-90); pos8(hair,-90); % bottom arm |
| 49 |
x7=x5; x6=x8; |
| 50 |
bot y7r= bot y8r= bot y2; |
| 51 |
filldraw stroke z7e--z8e; |
| 52 |
math_fit(0,.5ic#); penlabels(1,2,5,6,7,8); endchar; |
| 53 |
|
| 54 |
% Redrawing lower case l |
| 55 |
|
| 56 |
cmchar "The modified letter l"; |
| 57 |
beginchar("l",6u#+max(u#,.5stem#), |
| 58 |
min(asc_height#,if hefty:9/7 else:10/7 fi\\ x_height#),0); |
| 59 |
italcorr x_height#*slant -.4u#; |
| 60 |
adjust_fit(-(u#-stem#/5.5), -.5u#); |
| 61 |
numeric shaved_stem; shaved_stem=hround(stem if hefty:-\\2stem_corr fi); |
| 62 |
pickup fine.nib; |
| 63 |
pos1(shaved_stem,180); |
| 64 |
pos2(shaved_stem,180); |
| 65 |
pos3(shaved_stem,180); |
| 66 |
lft x2r=lft x3r=hround(2.5u-.5shaved_stem); |
| 67 |
y2=x_height; |
| 68 |
y3=max(.5bar_height,2vair); |
| 69 |
top y1=h; x1=x2; |
| 70 |
interim superness:=more_super; |
| 71 |
pos4(vair',-90); bot y4r=-oo; rt x5r=hround(w-u); |
| 72 |
pos5(vair,-75); top y5l=vround .2[top y4l,bar_height]; |
| 73 |
x5l:=good.x x5l; x4l=1/3[x3l,x5l]; x4r:=1/3[x3r,x5r]; y3l:=y3l+.2vair; |
| 74 |
filldraw stroke z1e--z2e..super_arc.e(3,4); % stem and hook |
| 75 |
path p; p=stroke z4e{right}..tension .9 and atleast 1..z5e; % terminal |
| 76 |
if (xpart(z5l-precontrol 1 of p)<0) or (xpart(z5r-postcontrol 2 of p)<0): |
| 77 |
filldraw stroke z4e{right}...{up}z5e; |
| 78 |
else: filldraw p; fi; |
| 79 |
penlabels(1,2,3,4,5,6,7,8); endchar; |
| 80 |
|
| 81 |
% Redrawing ligature fl |
| 82 |
|
| 83 |
cmchar "The modified ligature fl"; |
| 84 |
beginchar(oct"015",12u#+2letter_fit#,asc_height#,0); |
| 85 |
italcorr asc_height#*slant-serif_fit#+.5stem#-2u#; |
| 86 |
adjust_fit(0,serif_fit#); |
| 87 |
pickup tiny.nib; |
| 88 |
pos1(stem',0); |
| 89 |
lft x1l=hround(2.5u-.5stem'); |
| 90 |
pickup fine.nib; numeric bulb_diam, inner_jut; % letter f |
| 91 |
pos2(5/7[vair,flare],90); top y2r=h; rt x2=hround 5.3u; |
| 92 |
f_stroke(1,2,a,b,c,jut,inner_jut); % left stem, arc, terminal |
| 93 |
pickup crisp.nib; top y3r=top y4r=x_height; lft x3=hround .5u-1; |
| 94 |
pos3(bar,90); pos4(bar,90); |
| 95 |
rt x4= hround 5.3u; |
| 96 |
pickup crisp.nib; filldraw stroke z3e--z4e; % bar |
| 97 |
% |
| 98 |
pos11(stem',180);pos12(stem',180);pos13(stem',180); %letter l |
| 99 |
lft x12r=lft x13r=hround(x2+1.5u);y12=x_height; |
| 100 |
y13=max(.5bar_height,2vair);top y11=h; x11=x12; |
| 101 |
interim superness:=more_super; |
| 102 |
pos14(vair',-90); bot y14r=-oo; rt x15r=hround(w-u); |
| 103 |
pos15(vair,-75); top y15l=vround .2[top y14l,bar_height]; |
| 104 |
x15l:=good.x x15l; x14l=1/3[x13l,x15l]; x14r:=1/3[x13r,x15r]; y13l:=y13l+.2vair; |
| 105 |
filldraw stroke z11e--z12e..super_arc.e(13,14); % stem and hook |
| 106 |
path p; p=stroke z14e{right}..tension .9 and atleast 1..z15e; % terminal |
| 107 |
if (xpart(z15l-precontrol 1 of p)<0) or (xpart(z15r-postcontrol 2 of p)<0): |
| 108 |
filldraw stroke z14e{right}...{up}z15e; |
| 109 |
else: filldraw p; fi; |
| 110 |
penlabels(1,2,3,4,11,12,13,14,15); endchar; |
| 111 |
|
| 112 |
% Redrawing ligature ffl |
| 113 |
|
| 114 |
cmchar "The modified ligature ffl"; |
| 115 |
beginchar(oct"017",15u#+4letter_fit#,asc_height#,0); |
| 116 |
italcorr asc_height#*slant-serif_fit#+.5stem#-2u#; |
| 117 |
adjust_fit(0,2u#+serif_fit#); |
| 118 |
pickup tiny.nib; pos1(stem',0); lft x1l=hround(2.5u-.5stem'); % the double f |
| 119 |
pos11(stem',0); lft x11l=hround(.5w-.5stem'); |
| 120 |
pickup fine.nib; numeric bulb_diam, inner_jut; |
| 121 |
pos2(5/7[vair,flare],90); top y2r=h; rt x2=hround 5.75u; |
| 122 |
pos12(5/7[vair,flare],90); y12=y2; rt x12=hround(.5w+2.8u); |
| 123 |
f_stroke(1,2,a,b,c,jut,inner_jut); % left stem, arc, terminal |
| 124 |
f_stroke(11,12,d,e,f,inner_jut,inner_jut); % middle ditto |
| 125 |
pickup crisp.nib; top y3r=top y4r=x_height; lft x3=hround.5u-1; |
| 126 |
pos3(bar,90); pos4(bar,90); |
| 127 |
rt x4=hround(.5w+2.8u); |
| 128 |
pos3'(bar,90); x3'-x1=x4-x11; y3'=y3; |
| 129 |
pos4'(bar,90); x4'=x11; y4'=y4; |
| 130 |
filldraw stroke z3e--z3'e; filldraw stroke z4'e--z4e; % bars |
| 131 |
% |
| 132 |
pos21(stem',180);pos22(stem',180);pos23(stem',180); %letter l |
| 133 |
lft x22r=lft x23r=hround(x12+1.5u);y22=x_height; |
| 134 |
y23=max(.5bar_height,2vair);top y21=h; x21=x22; |
| 135 |
interim superness:=more_super; |
| 136 |
pos24(vair',-90); bot y24r=-oo; rt x25r=hround(x23r+4u); |
| 137 |
pos25(vair,-75); top y25l=vround .2[top y24l,bar_height]; |
| 138 |
x25l:=good.x x25l; x24l=1/3[x23l,x25l]; x24r:=1/3[x23r,x25r]; y23l:=y23l+.2vair; |
| 139 |
filldraw stroke z21e--z22e..super_arc.e(23,24); % stem and hook |
| 140 |
path p; p=stroke z24e{right}..tension .9 and atleast 1..z25e; % terminal |
| 141 |
if (xpart(z25l-precontrol 1 of p)<0) or (xpart(z25r-postcontrol 2 of p)<0): |
| 142 |
filldraw stroke z24e{right}...{up}z25e; |
| 143 |
else: filldraw p; fi; |
| 144 |
penlabels(1,2,3,4,11,12,21,22,23,24,25); endchar; |
| 145 |
|
| 146 |
%% Modified accents |
| 147 |
|
| 148 |
cmchar "Breve accent"; |
| 149 |
beginchar(oct"025",9u#,min(asc_height#,2x_height#),0); |
| 150 |
italcorr h#*slant+.5vair#-1.5u#; |
| 151 |
adjust_fit(0,0); |
| 152 |
pickup crisp.nib; pos1(vair,-180); pos3(vair,0); |
| 153 |
numeric mid_thickness; mid_thickness=vround 1/3[vair,stem]; |
| 154 |
pos2(mid_thickness,-90); x2=.5w; |
| 155 |
bot y2r=vround max(x_height+o+tiny,1/3[x_height,h]+o-.5mid_thickness); |
| 156 |
top y1=top y3=max(h,top y2l+.8vair); lft x1r=w-rt x3r=hround(2u-.5vair); |
| 157 |
filldraw stroke z1e{down}...z2e{right}...{up}z3e; % stroke |
| 158 |
penlabels(1,2,3); endchar; |
| 159 |
|
| 160 |
|
| 161 |
cmchar "Scandinavian circle accent"; |
| 162 |
beginchar(oct"027",13u#+4/3(asc_height#-x_height#)*slant,asc_height#,0); |
| 163 |
adjust_fit(cap_serif_fit#,cap_serif_fit#); |
| 164 |
numeric circ_hair,circ_vair; |
| 165 |
circ_hair=hround min(hair,u+.5); %circ_vair=vround min(vair,(h-x_height)/6+.5); |
| 166 |
circ_vair=circ_hair; |
| 167 |
penpos1(circ_vair,90); penpos3(circ_vair,-90); |
| 168 |
penpos2(circ_hair,180); penpos4(circ_hair,0); |
| 169 |
x2r=hround(.5w-u-.5circ_hair); |
| 170 |
x4r=w-x2r; x1=x3=.5w; |
| 171 |
y2=y4=.5[y1,y3]; |
| 172 |
y3r=vround(1/3[x_height,h]+apex_o); y1r-y3r=x4r-x2r; |
| 173 |
penstroke pulled_arc.e(1,2) & pulled_arc.e(2,3) |
| 174 |
& pulled_arc.e(3,4) & pulled_arc.e(4,1) & cycle; % bowl |
| 175 |
penlabels(1,2,3,4); endchar; |
| 176 |
|
| 177 |
iff ligs>0: cmchar "Dot accent"; |
| 178 |
numeric dot_diam#; dot_diam#=max(dot_size#,cap_curve#); |
| 179 |
beginchar(oct"137",5u#,min(asc_height#,10/7x_height#+.5dot_diam#),0); |
| 180 |
define_whole_blacker_pixels(dot_diam); |
| 181 |
italcorr h#*slant+.5dot_diam#-2u#; |
| 182 |
adjust_fit(0,0); |
| 183 |
pickup tiny.nib; pos1(dot_diam,0); pos2(dot_diam,90); |
| 184 |
x1=x2=.5w; z1=z2; |
| 185 |
y2l= vround(.5[x_height,h]+apex_o); |
| 186 |
dot(1,2); % dot |
| 187 |
penlabels(1,2); endchar; |
| 188 |
|
| 189 |
cmchar "Umlaut (double dot) accent"; |
| 190 |
numeric dot_diam#,dot_diam; |
| 191 |
dot_diam#=max(dot_size#,cap_curve#); |
| 192 |
beginchar(oct"177",9u#,min(asc_height#,10/7x_height#+.5dot_diam#),0); |
| 193 |
dot_diam=max(tiny.breadth,hround(max(dot_size,cap_curve)-2stem_corr)); |
| 194 |
italcorr h#*slant+.5dot_diam#-2.25u#; |
| 195 |
adjust_fit(0,0); |
| 196 |
pickup tiny.nib; pos1(dot_diam,0); pos2(dot_diam,90); |
| 197 |
x1=x2=2.75u; z1=z2; |
| 198 |
y2l= vround(.5[x_height,h]+apex_o); |
| 199 |
dot(1,2); % left dot |
| 200 |
pos3(dot_diam,0); penpos4(y2r-y2l,90); y3=y4=y1; x3=x4=w-x1; |
| 201 |
dot(3,4); % right dot |
| 202 |
penlabels(1,2,3,4); endchar; |
| 203 |
|
| 204 |
|
| 205 |
ligtable "!": "`" =: spanish_shriek; |
| 206 |
ligtable "?": "`" =: spanish_query; |
| 207 |
font_slant slant; font_x_height x_height#; |
| 208 |
if monospace: font_normal_space 9u#; % no stretching or shrinking |
| 209 |
font_quad 18u#; |
| 210 |
font_extra_space 9u#; |
| 211 |
else: font_normal_space 6u#+2letter_fit#; |
| 212 |
font_normal_stretch 3u#; font_normal_shrink 2u#; |
| 213 |
font_quad 18u#+4letter_fit#; |
| 214 |
font_extra_space 2u#; |
| 215 |
k#:=-.5u#; kk#:=-1.5u#; kkk#:=-2u#; % three degrees of kerning |
| 216 |
ligtable "k": if serifs: "v": "a" kern -u#, fi\\"w": "e" kern k#, |
| 217 |
"a" kern k#, "o" kern k#, "c" kern k#; |
| 218 |
ligtable "P": "A" kern kk#, |
| 219 |
"y": "o" kern k#, "e" kern k#, "a" kern k#, "." kern kk#, "," kern kk#; |
| 220 |
ligtable "F": "V": "W": if serifs: "o" kern kk#, "e" kern kk#, "u" kern kk#, |
| 221 |
"r" kern kk#, "a" kern kk#, "A" kern kkk#, |
| 222 |
else: "o" kern k#, "e" kern k#, "u" kern k#, |
| 223 |
"r" kern k#, "a" kern k#, "A" kern kk#, fi |
| 224 |
"K": "X": "O" kern k#, "C" kern k#, "G" kern k#, "Q" kern k#; |
| 225 |
ligtable "T": "y" kern if serifs: k# else: kk# fi, |
| 226 |
"Y": "e" kern kk#, "o" kern kk#, |
| 227 |
"r" kern kk#, "a" kern kk#, "A" kern kk#, "u" kern kk#; |
| 228 |
ligtable "O": "D": "X" kern k#, "W" kern k#, "A" kern k#, |
| 229 |
"V" kern k#, "Y" kern k#; |
| 230 |
if serifs: ligtable "h": "m": "n": |
| 231 |
"t" kern k#, "u" kern k#, "b" kern k#, "y" kern k#, "v" kern k#, "w" kern k#; |
| 232 |
ligtable "c": "h" kern k#, "k" kern k#; fi |
| 233 |
ligtable "o": "b": "p": "e" kern -k#, "o" kern -k#, "x" kern k#, |
| 234 |
"d" kern -k#, "c" kern -k#, "q" kern -k#, |
| 235 |
"a": if serifs: "v" kern k#, "j" kern u#, else: "r" kern k#, fi |
| 236 |
"t": "y" kern k#, |
| 237 |
"u": "w" kern k#; |
| 238 |
ligtable "A": if serifs: "R": fi\\ "t" kern k#, |
| 239 |
"C" kern k#, "O" kern k#, "G" kern k#, "U" kern k#, "Q" kern k#, |
| 240 |
"L": "T" kern kk#, "Y" kern kk#, "V" kern kkk#, "W" kern kkk#; |
| 241 |
ligtable "g": "j" kern -k#; % logjam |
| 242 |
ligtable "I": "I" kern -k#; fi % Richard III |
| 243 |
ligtable "l": "e" kern k#, "o" kern k#; |
| 244 |
% there are ligature/kern programs for |"f"| in the {\tt romlig} file |
| 245 |
% and for |"-"|, |"`"|, and |"'"| in the {\tt comlig} file |
| 246 |
bye. |
| 247 |
|