| 1 |
%% |
| 2 |
%% xppffgen.mf - an alternative font for MusiXTeX \ppff |
| 3 |
%% font source code, letter figure definition |
| 4 |
%% |
| 5 |
%% Modified from official cmbxti10.mf cmbase.mf textit.mf itall.mf |
| 6 |
%% (Computer Modern Text Italic family) |
| 7 |
%% |
| 8 |
%% by Hiroaki MORIMOTO <[email protected]> |
| 9 |
%% |
| 10 |
%% August, 2004. |
| 11 |
%% |
| 12 |
|
| 13 |
mode_setup; font_setup; |
| 14 |
|
| 15 |
%----patches for cmbase-------------------------------------------------------- |
| 16 |
def bulb(suffix $,$$,$$$) = |
| 17 |
pair uprevsl, dnrevsl; |
| 18 |
uprevsl := (0,y$r-y$$r) slanted -slant; |
| 19 |
dnrevsl := (0,y$$r-y$r) slanted -slant; |
| 20 |
z$$$r=z$$r; |
| 21 |
% path_.l:=z$l{x$$r-x$r,0}...{0,y$$r-y$r}z$$l; |
| 22 |
path_.l:=z$l{x$$r-x$r,0}...{dnrevsl}z$$l; |
| 23 |
% draw path_.l--z$$r{0,y$r-y$$r}...{x$r-x$$r,0}z$r--cycle; % link |
| 24 |
filldraw path_.l--z$$r{uprevsl}...{x$r-x$$r,0}z$r--cycle; % link |
| 25 |
% path_.r:=z$$$l{0,y$r-y$$r}..z$$$r{0,y$$r-y$r}; % near-circle |
| 26 |
path_.r:=z$$$l{uprevsl}..z$$$r{dnrevsl}; % near-circle |
| 27 |
% filldraw subpath(0,xpart(path_.r intersectiontimes path_.l)) of path_.r |
| 28 |
% --z$$r{0,y$$r-y$r}..cycle; % bulb |
| 29 |
filldraw path_.r--z$$r{dnrevsl}..cycle; % bulb |
| 30 |
enddef; |
| 31 |
|
| 32 |
def hook_out(suffix $,$$,$$$)suffix modifier= % |x$| and |x$$$| (only) are known |
| 33 |
pos$(stem,0); pos$$(vair,90); |
| 34 |
x$$$:=hround(x$$$+.5hair-eps)-.5hair; pos$$$(hair,180); |
| 35 |
y$=1/4x_height; bot y$$l=-oo; y$$$=1/3x_height; |
| 36 |
% if skewed.modifier: x$$=x$+1.25u; |
| 37 |
% filldraw stroke z$e{-u,-x_height}...z$$e{right}...{up}z$$$e; % hook |
| 38 |
% else: x$$=x$+1.5u; |
| 39 |
% filldraw stroke z$e{down}...z$$e{right} |
| 40 |
% ...{x$$$-(x$+2.5u),x_height}z$$$e; fi enddef; % hook |
| 41 |
x$$=x$$$-u; |
| 42 |
filldraw stroke z$e{down}...z$$e{right} |
| 43 |
...{up slanted .5slant}z$$$e; % hook |
| 44 |
enddef; |
| 45 |
|
| 46 |
def hook_in(suffix $,$$,$$$)suffix modifier= % |x$| and |x$$$| (only) are known |
| 47 |
x$:=hround(x$-.5hair)+.5hair; pos$(hair,180); |
| 48 |
% x$:=hround(x$-.5hair)+.5hair; pos$(vair,180); |
| 49 |
pos$$(vair,90); pos$$$(stem,0); |
| 50 |
% pos$$(hair,90); pos$$$(stem,0); |
| 51 |
% y$=2/3x_height; top y$$r=x_height+oo; y$$$=3/4x_height; |
| 52 |
y$=.55x_height; top y$$r=x_height+.9oo; y$$$=3/4x_height; |
| 53 |
% if skewed.modifier: x$$=x$$$-1.25u; |
| 54 |
x$$=x$+u; |
| 55 |
% filldraw stroke z$e{up}..z$$e{right}...{-u,-x_height}z$$$e; % hook |
| 56 |
filldraw stroke z$e{up slanted .5slant}...z$$e{right}...{down}z$$$e; % hook |
| 57 |
% else: x$$=x$$$-1.5u; |
| 58 |
% filldraw stroke z$e{x$$$-2.5u-x$,x_height} |
| 59 |
% ...z$$e{right}...{down}z$$$e; fi enddef; % hook |
| 60 |
enddef; |
| 61 |
|
| 62 |
%----letter f------------------------------------------------------------------ |
| 63 |
cmchar "Italic letter f"; |
| 64 |
%beginchar("f",max(1.5u#,stem#)+max(3.5u#,2flare#),asc_height#,desc_depth#); |
| 65 |
beginchar("f",max(1.5u#,stem#)+max(3.5u#,2flare#)-.6u#,asc_height#,desc_depth#); |
| 66 |
%italcorr asc_height#*slant+.75u#; |
| 67 |
italcorr asc_height#*slant; |
| 68 |
adjust_fit(if monospace:u#,u# else: 0,0 fi); pickup fine.nib; |
| 69 |
%numeric theta; z88=(.5w-.5u,h); z89=(.5w+.5u,-d); theta=angle(z88-z89); |
| 70 |
numeric theta; z88=(.5w,h); z89=(.5w,-d); theta=angle(z88-z89); |
| 71 |
pos0(flare,0); pos1(hair,0); pos2(vair,90); |
| 72 |
%pos3(.5[hair,stem],180); pos4(stem,theta+90); |
| 73 |
%pos3(.5[hair,stem],180); pos4(stem,270-theta); |
| 74 |
pos3(.5[hair,stem],180); pos4(stem,180); |
| 75 |
%pos5(stem,theta-90); pos6(.5[hair,stem],0); |
| 76 |
%pos5(stem,90-theta); pos6(.5[hair,stem],0); |
| 77 |
pos5(stem,0); pos6(.5[hair,stem],0); |
| 78 |
%pos7(vair,-90); pos8(hair,-180); pos9(flare,-180); |
| 79 |
pos7(vair,-75); pos8(hair,-180); pos9(flare,-180); |
| 80 |
%rt x1r=hround(w+.25u); lft x8r=hround-.35u; x2=.6[x1,x4]; x7=.6[x8,x5]; |
| 81 |
rt x1r=hround(w+.25u)+.9u; lft x8r=hround-1.4u; x2=.6[x1,x4]; x7=.6[x8,x5]; |
| 82 |
%y9-.5flare=vround -.85d; y2-y0=y9-y7; top y2r=h+oo; bot y7r=-d-oo; |
| 83 |
y9-.5flare=vround -d; y2-y0=y9-y7; top y2r=h+oo+.2hair; bot y7r=-d-oo-.2hair; |
| 84 |
%y4=.25[x_height,h]; y5=.5[-d,y4]; |
| 85 |
y4=.2[x_height,h]; y5=.47[-d,y4]; |
| 86 |
z4=whatever[z88,z89]; z5=whatever[z88,z89]; |
| 87 |
%x3=.8[x2+x4-x88,x88]; x6=.8[x7+x5-x89,x89]; y3=.8[y4,y2]; y6=.8[y5,y7]; |
| 88 |
x3=.8[x2+x4-x88,x88]; x6=.8[x7+x5-x89,x89]; y3=.7[y4,y2]; y6=.7[y5,y7]; |
| 89 |
bulb(2,1,0); bulb(7,8,9); % bulbs |
| 90 |
filldraw stroke z2e{left}...z3e...{z89-z88}z4e; % upper arc |
| 91 |
filldraw z4r--z5l--z5r--z4l--cycle; % stem |
| 92 |
filldraw stroke z5e{z89-z88}...z6e...{left}z7e; % lower arc |
| 93 |
pickup crisp.nib; pos20(bar,90); pos21(bar,90); |
| 94 |
%top y20r=top y21r=x_height; |
| 95 |
top y20r=top y21r=x_height; |
| 96 |
%lft x20=lft x4r-.5stem-u; rt x21=rt x4l+.5stem+1.5u; |
| 97 |
lft x20=lft x4r-.5stem-1.1u; rt x21=rt x4l+.5stem+1.1u; |
| 98 |
filldraw stroke z20e--z21e; % crossbar |
| 99 |
math_fit(desc_depth#*slant+u#,x_height#*slant); |
| 100 |
penlabels(0,1,2,3,4,5,6,7,8,9,20,21,88,89); |
| 101 |
currentpicture:=currentpicture shifted (.3u,.025x_height); |
| 102 |
endchar; |
| 103 |
|
| 104 |
|
| 105 |
%----letter p------------------------------------------------------------------ |
| 106 |
cmchar "Italic letter p"; |
| 107 |
%beginchar("p",9u#,x_height#,desc_depth#); |
| 108 |
%beginchar("p",6.7u#,x_height#,desc_depth#); |
| 109 |
beginchar("p",7u#,x_height#,desc_depth#); |
| 110 |
italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.5u# fi; |
| 111 |
adjust_fit(0,0); pickup fine.nib; |
| 112 |
x0=0-.1u; x2-.5stem=hround(2.5u-.5stem); hook_in(0,1,2); % opening hook |
| 113 |
pos4(hair,-180); pos5(vair,-90); pos6(curve,0); pos7(vair,90); |
| 114 |
%x4=x2; rt x6r=hround(w-1.5u+.5curve); x5=x7=.5[x4,x6]; |
| 115 |
%x4=.4[x2,x2r]; rt x6r=hround(w+.25u+.5curve); x5=.55[x4,x6]; x7=.4[x4,x6]; |
| 116 |
x4=.4[x2,x2r]; rt x6r=hround(w-.05u+.5curve); x5=.55[x4,x6]; x7=.4[x4,x6]; |
| 117 |
%bot y5r=-oo+.5hair; top y7r=h+oo+.25hair; y4=.55[y5,y7]; y6=.45[y5,y7]; |
| 118 |
bot y5r=-oo+hair; top y7r=h+oo+.1hair; y4=.55[y5,y7]; y6=.45[y5,y7]; |
| 119 |
filldraw stroke super_arc.e(4,5) & pulled_arc.e(5,6) |
| 120 |
& pulled_arc.e(6,7) & super_arc.e(7,4); % bowl |
| 121 |
filldraw stroke super_arc.e(4,5) & super_arc.e(5,6) |
| 122 |
& super_arc.e(6,7) & super_arc.e(7,4); % bowl |
| 123 |
pickup tiny.nib; pos2'(stem,0); pos3(stem,0); |
| 124 |
z2=z2'; x3=x2; bot y3=-d; filldraw stroke z2'e--z3e; % stem |
| 125 |
dish_serif(3,2',a,1/3,.75jut,b,1/3,jut); % serif |
| 126 |
math_fit(-min(2/3x_height#*slant-.5hair#-.5u#, |
| 127 |
2u#-.5stem#-desc_depth#*slant),ic#); |
| 128 |
penlabels(0,1,2,3,4,5,6,7); |
| 129 |
currentpicture:=currentpicture shifted (.25u,.025x_height); |
| 130 |
endchar; |
| 131 |
|
| 132 |
|
| 133 |
%----letter m------------------------------------------------------------------ |
| 134 |
cmchar "Italic letter m"; |
| 135 |
beginchar("m",9u#,x_height#,0); |
| 136 |
%italcorr 1/3x_height#*slant; |
| 137 |
italcorr 1/3x_height#*slant+.5hair#+.5u#; |
| 138 |
x_height_o:=x_height; x_height:=.8x_height; |
| 139 |
adjust_fit(if monospace:-1.5u#,-2u# else: 0,0 fi); pickup fine.nib; |
| 140 |
%w := .9w; |
| 141 |
numeric shaved_stem; %shaved_stem=mfudged.stem; |
| 142 |
shaved_stem=.2[ess,stem]; |
| 143 |
save stem; stem=shaved_stem; |
| 144 |
pos2(stem,0); x1=x2; |
| 145 |
%if monospace: pos1(stem,0); lft x1l=hround(2.5u-.5stem); top y1=h; |
| 146 |
%else:% x0=0; lft x2l=hround(2.5u-.5stem); |
| 147 |
% x0=0; lft x2l=hround(2.5u-.5stem); |
| 148 |
% x0=0+.08w; lft x2l=hround(2.5u-.5stem); |
| 149 |
x0=0-.5hair+.5stem; lft x2l=hround(2.5u-.5stem); |
| 150 |
hook_in(0,a,1);% fi % opening hook |
| 151 |
y2-.5stem=-oo; filldraw circ_stroke z2e--z1e; % left stem |
| 152 |
%x4+.5stem=hround(.5w+.5stem); ital_arch(2,3,4); % left arch |
| 153 |
%x4+.5stem=hround(.675w+.5stem); ital_arch(2,3,4); % left arch |
| 154 |
x4+.5stem=hround(.58w+.5stem); ital_arch(2,3,4); % left arch |
| 155 |
pos5(stem,0); y5=y2; x5=x4; |
| 156 |
filldraw circ_stroke z5e--z4e; % middle stem |
| 157 |
%x7+.5stem=hround(w-2.5u+.5stem); |
| 158 |
%x7+.5stem=hround(1.35w-2.5u+.5stem); |
| 159 |
x7+.5stem=hround(1.16w-2.5u+.5stem); |
| 160 |
%x8=x7-.25u; ital_arch(5,6,7); % right arch |
| 161 |
x8=x7; ital_arch(5,6,7); % right arch |
| 162 |
%if monospace: pos9(vair,90); x9=good.x .5[x8,w]; bot y9l=0; y8=1/3h; |
| 163 |
% pos8(stem,0); filldraw stroke z8e{-u,-x_height}...{right}z9e; % terminal |
| 164 |
%else:% x9=w; hook_out(8,b,9)(skewed); fi % closing hook |
| 165 |
%x9=1.25w; hook_out(8,b,9)(skewed);% fi % closing hook |
| 166 |
x9=w+1u; hook_out(8,b,9)(skewed);% fi % closing hook |
| 167 |
%filldraw stroke z7e{down}..{-u,-x_height}z8e; % right stem |
| 168 |
%filldraw stroke z7e{down}--{down}z8e; % right stem |
| 169 |
filldraw stroke z7e--z8e; % right stem |
| 170 |
math_fit(-2/3x_height#*slant+.5hair#+.5u#,ic#); |
| 171 |
penlabels(0,a,1,2,3,4,5,6,7,8,b,9); |
| 172 |
x_height:=x_height_o; |
| 173 |
currentpicture:=currentpicture shifted (.6u,.19x_height); |
| 174 |
endchar; |
| 175 |
|
| 176 |
|
| 177 |
%----letter s------------------------------------------------------------------ |
| 178 |
cmchar "Italic letter s"; |
| 179 |
%beginchar("s",5.25u#+max(1.75u#,flare#),x_height#,0); |
| 180 |
beginchar("s",4.8u#,x_height#,0); |
| 181 |
%italcorr x_height#*slant-.5u#; |
| 182 |
italcorr 1/3x_height#*slant+.5hair#+.5u#; |
| 183 |
adjust_fit(0,0); pickup fine.nib; |
| 184 |
%numeric theta; theta=90-angle(40u,h); slope:=-h/40u; % angle at middle |
| 185 |
numeric theta; theta=90-angle(16u,h); slope:=-h/16u; % angle at middle |
| 186 |
pos2(vair,-90); pos0(max(fine.breadth,ess),theta); pos7(vair,-90); |
| 187 |
%x2l=x0=x7=.5w; top y2l=h+oo; bot y7r=-oo; |
| 188 |
%x2l+.08w=x0=x7-.08w=.5w; top y2l=h+oo-.1x_height; bot y7r=-oo+.1x_height; |
| 189 |
x0=.5w; top y2l=h+oo-.1x_height; bot y7r=-oo+.1x_height; |
| 190 |
x2=.4w; x7=.6w; |
| 191 |
y0-.5ess=y7l+.55(y2r-y7l-ess); |
| 192 |
%lft x3l=hround u-eps; rt x6r=hround(w-.5u)+eps; |
| 193 |
%lft x3l=hround u-eps+.2u; rt x6r=hround(w-.5u)+eps-.2u; |
| 194 |
lft x3l=0-.1u; rt x6r=w+.2u; |
| 195 |
x3r-x3l=x6r-x6l=hround .5[vair,ess]-fine; |
| 196 |
ellipse_set(2l,3l,4l,0l); ellipse_set(2r,3r,4r,0r); y3=y3r; |
| 197 |
ellipse_set(7l,6l,5l,0l); ellipse_set(7r,6r,5r,0r); y6=y6r; |
| 198 |
interim superness:=more_super; |
| 199 |
filldraw stroke super_arc.e(2,3) & z3e{down} |
| 200 |
..z4e---z5e..z6e{down} & super_arc.e(6,7); % main stroke |
| 201 |
pos1(hair,0); pos10(hround .75[hair,flare],0); |
| 202 |
pos2'(vair,90); z2'=z2; |
| 203 |
pos8(hair,-180); pos9(flare,-180); |
| 204 |
%rt x10r=hround(w-u)+2eps; lft x9r=hround .5u-2eps; y10=.78h; y9=.25h; |
| 205 |
%rt x10r=hround(w-u)+2eps-.5u; lft x9r=hround 1u-2eps+.5u; y10=.78h; y9=.25h; |
| 206 |
lft x9r=+.35u; rt x10r=w-.55u; y9=.25h; y10=.75h; |
| 207 |
bulb(2',1,10); bulb(7,8,9); % bulbs |
| 208 |
math_fit(0,ic#); penlabels(0,1,2,3,4,5,6,7,8,9,10); |
| 209 |
currentpicture:=currentpicture shifted (u,.09x_height); |
| 210 |
endchar; |
| 211 |
|
| 212 |
%----letter z------------------------------------------------------------------ |
| 213 |
cmchar "Italic letter z"; |
| 214 |
%beginchar("z",5.5u#+max(1.5u#,stem#),x_height#,0); |
| 215 |
beginchar("z",5.2u#,x_height#,0); |
| 216 |
%italcorr x_height#*slant+.5hair#; |
| 217 |
italcorr 1/3x_height#*slant+.5hair#+.5u#; |
| 218 |
adjust_fit(if monospace:.5u#,.5u# else: 0,0 fi); pickup fine.nib; |
| 219 |
%pos1(hair,0); pos2(stem,-90); pos3(vair,-90); pos4(hair,0); |
| 220 |
%pos1(hair,0); pos2(ess,-90); pos3(vair,-90); pos4(hair,0); |
| 221 |
pos1(hair,-0); pos2(.3[ess,stem],-80); pos3(.7[vair,ess],-90); pos4(hair,-30); |
| 222 |
%lft x1l=hround(u-.5hair); x2=2.5u; x3=w-2u; rt x4r=hround(w-.5u); |
| 223 |
%lft x1l=hround(.5u-.5hair); x2=2.2u; x3=w-2u; rt x4r=hround(w-.5u); |
| 224 |
lft x1l=hround(.0u-.5hair); x2=1.2u; x3=2.9u; rt x4r=hround(1.1w-.6u)-.2u; |
| 225 |
%top y1=.78h; top y2l=top y4=h+oo; y3=.825h; |
| 226 |
%top y1=.78h-.1x_height; top y2l=top y4=h+oo-.1x_height; y3=.825h-.1x_height; |
| 227 |
%top y1=.78h-.1x_height; top y2l=top y4=h+oo-.1x_height; y3=.825h-.04x_height; |
| 228 |
top y1=.76h-.1x_height; top y2l=top h+oo-.1x_height; y4l=h-.1x_height; y3=.85h-.1x_height; |
| 229 |
%pos5(hair,0); pos6(vair,-90); pos7(stem,-90); pos8(hair,0); |
| 230 |
%pos5(hair,0); pos6(vair,-90); pos7(ess,-90); pos8(hair,0); |
| 231 |
pos5(hair,-30); pos6(.7[vair,ess],-90); pos7(.5[ess,stem],-80); pos8(hair,-0); |
| 232 |
%x5=x1; x6=2.5u; x7=w-2u; x8+.5hair=hround(w+.5hair-eps); |
| 233 |
%x5=x1+u; x6=3.5u; x7=w-1u; x8+.5hair=hround(w+.5hair-eps)+u; |
| 234 |
%x5=x1+.5u; x6=2.5u; x7=.87w; x8+.5hair=hround(1.1w+.5hair-eps); |
| 235 |
x5=x1+.5u; x6=2.5u; x7=.95w; x8+.5hair=hround(1.1w+.5hair-eps); |
| 236 |
%bot y5=bot y7r=-oo; y6=.175h; bot y8=.31h; |
| 237 |
%bot y5=.1x_height; y7r=-oo; y6=.175h+.1x_height; bot y8=.31h; |
| 238 |
bot y5=.1x_height; y7r=-oo; y6=.175h+.03x_height; bot y8=.31h; |
| 239 |
pair p; p=(z4-z5) yscaled 2; |
| 240 |
filldraw stroke z1e{up}...z2e{right}..z3e{right}...{p}z4e; % upper bar |
| 241 |
filldraw stroke z5e{p}...z6e{right}..{right}z7e...{up}z8e; % lower bar |
| 242 |
filldraw stroke z5e{p}..{p}z4e; % diagonal |
| 243 |
math_fit(0,1/3x_height#*slant+.5hair#+.5u#); |
| 244 |
penlabels(1,2,3,4,5,6,7,8); |
| 245 |
currentpicture:=currentpicture shifted (.7u,.09x_height); |
| 246 |
endchar; |
| 247 |
|
| 248 |
|
| 249 |
%----font dimensions----------------------------------------------------------- |
| 250 |
font_slant slant; font_x_height x_height#; |
| 251 |
% font_normal_space 6u#+2letter_fit#; |
| 252 |
font_normal_space 4u#+2letter_fit#; |
| 253 |
font_normal_stretch 3u#; font_normal_shrink 2u#; |
| 254 |
font_quad 18u#+4letter_fit#; |
| 255 |
font_extra_space 2u#; |
| 256 |
|
| 257 |
ligtable "f": "f" kern -.7u#; |
| 258 |
ligtable "p": "f" kern +.5u#; |
| 259 |
|
| 260 |
bye. |
| 261 |
|