| 1 |
%% |
| 2 |
%% This is file `cpctitle.mf', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% pacioli.dtx (with options: `mfd') |
| 8 |
%% |
| 9 |
%% Copyright 1999 Peter R. Wilson |
| 10 |
%% |
| 11 |
%% This program is provided under the terms of the |
| 12 |
%% LaTeX Project Public License distributed from CTAN |
| 13 |
%% archives in directory macros/latex/base/lppl.txt. |
| 14 |
%% |
| 15 |
%% Author: Peter Wilson (CUA and NIST) |
| 16 |
%% now at: [email protected] |
| 17 |
%% |
| 18 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 19 |
%% MACRO SECTION %%%%%%%%%%%%%%%%%%%%%%%%%% |
| 20 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 21 |
def makebox(text rule) = |
| 22 |
for y=0,half_height,cap_height,body_height,x_height,-desc_depth,-body_depth: |
| 23 |
rule((l,y)t_,(r,y)t_); endfor % horizontals |
| 24 |
for x=l,r: rule((x,-body_depth)t_,(x,body_height)t_); endfor % verticals |
| 25 |
for x=u*(1+floor(1/u)) step u until r-1: |
| 26 |
rule((x,-body_depth)t_,(x,body_height)t_); endfor % more verticals |
| 27 |
if charic<>0: |
| 28 |
rule((r+charic*pt,h.o_),(r+charic*pt,.5h.o_)); fi % italic correction |
| 29 |
enddef; |
| 30 |
|
| 31 |
|
| 32 |
def proofpcbb(suffix $)(expr xoff, yoff) = |
| 33 |
if proofing > 0: |
| 34 |
x$bl = x$ - xoff; y$bl = y$ - yoff; % Bottom Left Hand Corner |
| 35 |
z$br = (x$bl+cap_height, y$bl); % BRHC |
| 36 |
z$tr = (x$bl+cap_height, y$bl+cap_height); % TRHC |
| 37 |
z$tl = (x$bl, y$bl+cap_height); % TLHC |
| 38 |
z$bc = 1/2[z$bl,z$br]; z$tc = 1/2[z$tl,z$tr]; % horizontal mid points |
| 39 |
pair hc, vc; |
| 40 |
hc = (2u,0); vc = (0,2u); |
| 41 |
pickup pensquare scaled 2; |
| 42 |
for s = z$bl, z$br, z$tr, z$tl, z$bc, z$tc: |
| 43 |
draw s-hc--s+hc; |
| 44 |
draw s-vc--s+vc; |
| 45 |
endfor |
| 46 |
fi |
| 47 |
enddef; |
| 48 |
|
| 49 |
|
| 50 |
let cm_arm=arm; |
| 51 |
|
| 52 |
vardef arm(suffix $,$$,@)(expr darkness, armjut) = % arm from |z$| to |z$$| |
| 53 |
numeric vjut_; vjut_= abs(bot y$l-bot y$$); |
| 54 |
x@0=good.x(x$$r-armjut); y@0=y$r; |
| 55 |
if serifs: y@1=y$l; z@1=z$$l+whatever*(z$$r-z@0); |
| 56 |
if x$$>=x$: x@2=x@1 - vjut_; else: x@2=x@1+vjut_; fi y@2=y$l; |
| 57 |
filldraw z$$l{z@1-z$$l}...darkness[z@1,.5[z@2,z$$l]]{z@2-z$$l}... |
| 58 |
z@2if x$$>=x$: {left} else: {right} fi |
| 59 |
---z$l--z$r--z@0--z$$r..cycle; % arm and beak |
| 60 |
else: filldraw z$l--z$r--z@0--z$$r--cycle; fi % sans-serif arm |
| 61 |
penlabels(@0,@1,@2); enddef; |
| 62 |
|
| 63 |
|
| 64 |
vardef foot(suffix $, $$, @)(expr darkness, armjut) = % curved beak on E and L |
| 65 |
numeric vjut_; vjut_= abs(bot y$-bot y$$); |
| 66 |
x@0=good.x(x$$r-armjut); y@0=y$r; |
| 67 |
if serifs: |
| 68 |
y@1=y$l; z@1=z$$l+whatever*(z$$r-z@0); |
| 69 |
x@2=x@1-vjut_; y@2=y$l; |
| 70 |
filldraw z$$l{z@1-z$$l}...darkness[z@1,.5[z@2,z$$l] ]...z@2 |
| 71 |
---z$l--z$r--z@0--z$$r--cycle; % arm and beak |
| 72 |
else: |
| 73 |
filldraw z$l--z$r--(x$$r,y$r)--(x$$r,y$l)--cycle; |
| 74 |
fi |
| 75 |
penlabels(@0,@1,@2); enddef; |
| 76 |
|
| 77 |
|
| 78 |
vardef pulled_super_arc.l(suffix $, $$)(expr darkness)= |
| 79 |
pair corner; |
| 80 |
if y$=y$r: corner=(x$l, y$$l); |
| 81 |
else: corner=(x$$l,y$l); fi |
| 82 |
z$l{corner-z$l}...(darkness)[corner, .5[z$l, z$$l]]{z$$l-z$l} |
| 83 |
...{z$$l-corner}z$$l enddef; |
| 84 |
|
| 85 |
vardef pulled_super_arc.r(suffix $, $$)(expr darkness)= |
| 86 |
pair corner; |
| 87 |
if y$=y$r: corner=(x$r,y$$r); |
| 88 |
else: corner=(x$$r, y$r); fi |
| 89 |
z$r{corner-z$r}...(darkness)[corner, .5[z$r, z$$r]]{z$$r-z$r} |
| 90 |
...z$$r{z$$r-corner} enddef; |
| 91 |
|
| 92 |
vardef pulled_arc@#(suffix $, $$)= |
| 93 |
pulled_super_arc@#($,$$)(eta) enddef; |
| 94 |
|
| 95 |
|
| 96 |
let cm_font_setup=font_setup; % Knuth's original font_setup |
| 97 |
|
| 98 |
def slim_font_setup = % trimmed font_setup for use with Pacioli caps only |
| 99 |
if monospace: let adjust_fit=mono_adjust_fit; |
| 100 |
def mfudged=fudged enddef; |
| 101 |
mono_charic#:=body_height#*slant; |
| 102 |
if mono_charic#<0: mono_charic#:=0; fi |
| 103 |
mono_charwd#:=9u#; define_whole_pixels(mono_charwd); |
| 104 |
else: let adjust_fit=normal_adjust_fit; |
| 105 |
def mfudged= enddef; fi |
| 106 |
define_pixels(u,width_adj,serif_fit,cap_serif_fit,jut,cap_jut,bar_height, |
| 107 |
dish,bracket,beak_jut,apex_o,apex_corr); |
| 108 |
define_whole_pixels(letter_fit,fine,crisp,tiny); |
| 109 |
define_whole_vertical_pixels(body_height,asc_height, |
| 110 |
cap_height,x_height,comma_depth,desc_depth); |
| 111 |
define_whole_blacker_pixels(hair,stem,cap_stem); |
| 112 |
define_whole_vertical_blacker_pixels(vair,dslab,slab); |
| 113 |
if slab<eps: slab:=eps fi; |
| 114 |
define_corrected_pixels(o); |
| 115 |
forsuffixes $=hair,stem,cap_stem: |
| 116 |
fudged$.#:=fudge*$.#; fudged$:=hround(fudged$.#*hppp+blacker); |
| 117 |
forever: exitif fudged$>.9fudge*$; fudged$:=fudged$+1; endfor endfor |
| 118 |
rule_thickness:=ceiling(rule_thickness#*hppp); |
| 119 |
heavy_rule_thickness:=ceiling(3rule_thickness#*hppp); |
| 120 |
oo:=vround(.5o#*hppp*o_correction)+eps; |
| 121 |
apex_oo:=vround(.5apex_o#*hppp*o_correction)+eps; |
| 122 |
lowres_fix(stem) 1.3; |
| 123 |
ess:=(ess#/stem#)*stem; cap_ess:=(cap_ess#/cap_stem#)*cap_stem; |
| 124 |
dw:=(curve#-stem#)*hppp; bold:=curve#*hppp+blacker; |
| 125 |
dh#:=.6designsize; |
| 126 |
more_super:=max(superness,sqrt .77superness); |
| 127 |
hein_super:=max(superness,sqrt .81225258superness); % that's $2^{-.3}$ |
| 128 |
clear_pen_memory; |
| 129 |
if fine=0: fine:=1; fi |
| 130 |
forsuffixes $=fine,crisp,tiny: |
| 131 |
%%% fine $ %%%% temporary formatting convention for MFT |
| 132 |
if $>fudged.hair: $:=fudged.hair; fi |
| 133 |
$.breadth:=$; |
| 134 |
pickup if $=0: nullpen else: pencircle scaled $; $:=$-eps fi; |
| 135 |
$.nib:=savepen; breadth_[$.nib]:=$; |
| 136 |
forsuffixes $$=lft,rt,top,bot: shiftdef($.$$,$$ 0); endfor endfor |
| 137 |
%%% @ $ %%%% restore ordinary formatting for $ |
| 138 |
min_Vround:=max(fine.breadth,crisp.breadth,tiny.breadth); |
| 139 |
if min_Vround<vround min_Vround: min_Vround:=vround min_Vround; fi |
| 140 |
pickup pencircle scaled rule_thickness; rule.nib:=savepen; |
| 141 |
currenttransform:=identity slanted slant |
| 142 |
yscaled aspect_ratio scaled granularity; |
| 143 |
if currenttransform=identity: let t_=relax |
| 144 |
else: def t_ = transformed currenttransform enddef fi; |
| 145 |
numeric paren_depth#; .5[body_height#,-paren_depth#]=math_axis#; |
| 146 |
numeric asc_depth#; .5[asc_height#,-asc_depth#]=math_axis#; |
| 147 |
body_depth:=desc_depth+body_height-asc_height; |
| 148 |
shrink_fit:=1+hround(2letter_fit#*hppp)-2letter_fit; |
| 149 |
if not string mode: if mode<=smoke: shrink_fit:=0; fi fi |
| 150 |
enddef; |
| 151 |
|
| 152 |
|
| 153 |
def pacioli_font_setup= % contains special stuff for Pacioli fonts |
| 154 |
define_pixels(side,thick,thin,medium,half_height); |
| 155 |
define_pixels(Hrad,Lrad,lrad,srad,trad); |
| 156 |
define_pixels(dot_size,math_axis,flare,stem_corr,curve); |
| 157 |
if not known dslab#: dslab=eps; fi |
| 158 |
enddef; |
| 159 |
|
| 160 |
|
| 161 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 162 |
%% END OF MACROS %%%%%%%%%%%%%%%%%%%%%%%%%% |
| 163 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 164 |
|
| 165 |
|
| 166 |
font_coding_scheme:="ASCII caps and punctuation"; |
| 167 |
|
| 168 |
mode_setup; |
| 169 |
|
| 170 |
pacioli_font_setup; |
| 171 |
if whole_font: font_setup; %slab:=eps; |
| 172 |
define_whole_vertical_blacker_pixels(dslab,slab); |
| 173 |
else: slim_font_setup; fi |
| 174 |
|
| 175 |
|
| 176 |
input cpcromanu; % Pacioli upper case (majuscules) |
| 177 |
input cpcpunct; % punctuation |
| 178 |
input cpclig; % the several dashes |
| 179 |
input cpcromanp % ampersand and ?mark |
| 180 |
|
| 181 |
|
| 182 |
font_slant slant; font_x_height x_height#; |
| 183 |
if monospace: font_normal_space 9u#; % no stretching or shrinking |
| 184 |
font_quad 18u#; |
| 185 |
font_extra_space 9u#; |
| 186 |
else: font_normal_space 6u#+2letter_fit#; |
| 187 |
font_normal_stretch 3u#; font_normal_shrink 2u#; |
| 188 |
font_quad 18u#+4letter_fit#; |
| 189 |
font_extra_space 2u#; |
| 190 |
k#:=-.5u#; kk#:=-1.5u#; kkk#:=-2u#; % three degrees of kerning |
| 191 |
ligtable "P": "T": "Y": "A" kern kk#; |
| 192 |
ligtable "F": "V": "W": "A" kern if serifs: kkk# else: kk#fi, |
| 193 |
"K": "X": "O" kern k#, "C" kern k#, "G" kern k#, "Q" kern k#; |
| 194 |
ligtable "O": "D": "X" kern k#, "W" kern k#, "A" kern k#, |
| 195 |
"V" kern k#, "Y" kern k#; |
| 196 |
ligtable "A": if serifs: "R": fi |
| 197 |
"C" kern k#, "O" kern k#, "G" kern k#, "U" kern k#, "Q" kern k#, |
| 198 |
"L": "T" kern kk#, "Y" kern kkk#, "V" kern kk#, "W" kern kkk#; |
| 199 |
ligtable "I": "I" kern -k#; fi % Richard III |
| 200 |
|
| 201 |
bye. |
| 202 |
|