| 1 |
% The basic correction for write-white fonts occurs in the definition |
| 2 |
% font_setup. This can be used to overwrite the write-black |
| 3 |
% definition in cmbase.mf |
| 4 |
% |
| 5 |
def white_setup = |
| 6 |
if monospace: let adjust_fit=mono_adjust_fit; |
| 7 |
def mfudged=fudged enddef; |
| 8 |
mono_charic#:=body_height#*slant; |
| 9 |
if mono_charic#<0: mono_charic#:=0; fi |
| 10 |
mono_charwd#:=9u#; define_whole_pixels(mono_charwd); |
| 11 |
else: let adjust_fit=normal_adjust_fit; |
| 12 |
def mfudged= enddef; fi |
| 13 |
if math_fitting: let math_fit=do_math_fit |
| 14 |
else: let math_fit=ignore_math_fit fi; |
| 15 |
define_pixels(u,width_adj,serif_fit,cap_serif_fit,jut,cap_jut,beak, |
| 16 |
bar_height,dish,bracket,beak_jut,stem_corr,vair_corr,apex_corr); |
| 17 |
define_blacker_pixels(notch_cut,cap_notch_cut); |
| 18 |
forsuffixes $=notch_cut,cap_notch_cut: if $<3: $:=3; fi endfor |
| 19 |
define_whole_pixels(letter_fit,fine,crisp,tiny); |
| 20 |
define_whole_vertical_pixels(body_height,asc_height, |
| 21 |
cap_height,fig_height,x_height,comma_depth,desc_depth,serif_drop); |
| 22 |
define_whole_blacker_pixels(thin_join,hair,stem,curve,flare, |
| 23 |
dot_size,cap_hair,cap_stem,cap_curve); |
| 24 |
define_whole_vertical_blacker_pixels(vair,bar,slab,cap_bar,cap_band); |
| 25 |
define_corrected_pixels(o,apex_o); |
| 26 |
forsuffixes $=hair,stem,cap_stem: |
| 27 |
fudged$.#:=fudge*$.#; fudged$:=hround(fudged$.#*hppp+blacker); |
| 28 |
forever: exitif fudged$>.9fudge*$; fudged$:=fudged$+1; endfor endfor |
| 29 |
rule_thickness:=ceiling(rule_thickness#*hppp); |
| 30 |
heavy_rule_thickness:=ceiling(3rule_thickness#*hppp); |
| 31 |
oo:=vround(.5o#*hppp*o_correction)+eps; |
| 32 |
apex_oo:=vround(.5apex_o#*hppp*o_correction)+eps; |
| 33 |
lowres_fix(stem,curve,flare) 1.3; |
| 34 |
lowres_fix(stem,curve) 1.2; |
| 35 |
lowres_fix(cap_stem,cap_curve) 1.2; |
| 36 |
lowres_fix(hair,cap_hair) 1.2; |
| 37 |
lowres_fix(cap_band,cap_bar,bar,slab) 1.2; |
| 38 |
stem':=hround(stem-stem_corr); cap_stem':=hround(cap_stem-stem_corr); |
| 39 |
vair':=vround(vair+vair_corr); |
| 40 |
vstem:=vround .8[vair,stem]; cap_vstem:=vround .8[vair,cap_stem]; |
| 41 |
ess:=(ess#/stem#)*stem; cap_ess:=(cap_ess#/cap_stem#)*cap_stem; |
| 42 |
dw:=(curve#-stem#)*hppp; bold:=curve#*hppp+blacker; |
| 43 |
dh#:=.6designsize; |
| 44 |
stem_shift#:=if serifs: 2stem_corr# else: 0 fi; |
| 45 |
more_super:=max(superness,sqrt .77superness); |
| 46 |
hein_super:=max(superness,sqrt .81225258superness); % that's $2^{-.3}$ |
| 47 |
clear_pen_memory; |
| 48 |
if fine=0: fine:=1; fi |
| 49 |
forsuffixes $=fine,crisp,tiny: |
| 50 |
%%% fine $ %%%% temporary formatting convention for MFT |
| 51 |
if $>fudged.hair: $:=fudged.hair; fi |
| 52 |
$.breadth:=$; |
| 53 |
pickup if $=0: nullpen else: pencircle scaled $; $:=$-eps fi; |
| 54 |
$.nib:=savepen; breadth_[$.nib]:=$; |
| 55 |
forsuffixes $$=lft,rt,top,bot: shiftdef($.$$,$$ 0); endfor endfor |
| 56 |
%%% @ $ %%%% restore ordinary formatting for $ |
| 57 |
min_Vround:=max(fine.breadth,crisp.breadth,tiny.breadth,2); % "WRITE WHITE" ONLY! |
| 58 |
if min_Vround<vround min_Vround: min_Vround:=vround min_Vround; fi |
| 59 |
if flare<vround flare: flare:=vround flare; fi |
| 60 |
forsuffixes $=vair,bar,slab,cap_bar,cap_band,vair',vstem,cap_vstem,bold: |
| 61 |
if $<min_Vround: $:=min_Vround; fi endfor |
| 62 |
pickup pencircle scaled rule_thickness; rule.nib:=savepen; |
| 63 |
math_axis:=good.y(math_axis#*hppp); |
| 64 |
pickup pencircle scaled if hefty:(.6[vair,fudged.hair]) else:fudged.hair fi; |
| 65 |
light_rule.nib:=savepen; |
| 66 |
pickup pencircle xscaled cap_curve yscaled cap_hair rotated 30; |
| 67 |
cal.nib:=savepen; |
| 68 |
pair cal.extension; cal.extension:=(.75cap_curve,0) rotated 30; |
| 69 |
pickup pencircle xscaled cap_curve yscaled cap_hair rotated 70; |
| 70 |
tilted.nib:=savepen; |
| 71 |
pickup pencircle xscaled curve yscaled cap_hair rotated 70; |
| 72 |
med_tilted.nib:=savepen; |
| 73 |
pickup pencircle xscaled cap_stem yscaled cap_hair rotated 30; |
| 74 |
med_cal.nib:=savepen; |
| 75 |
pickup pencircle xscaled stem yscaled cap_hair rotated 30; |
| 76 |
light_cal.nib:=savepen; |
| 77 |
pickup pencircle xscaled(cap_curve+dw) yscaled cap_hair rotated 30; |
| 78 |
heavy_cal.nib:=savepen; |
| 79 |
bot_flourish_line:=-.5u-o; |
| 80 |
pair bend; bend=(.5u,0); |
| 81 |
pair flourish_change; flourish_change=(4u,.2asc_height); |
| 82 |
join_radius:=u; |
| 83 |
currenttransform:=identity slanted slant |
| 84 |
yscaled aspect_ratio scaled granularity; |
| 85 |
if currenttransform=identity: let t_=relax |
| 86 |
else: def t_ = transformed currenttransform enddef fi; |
| 87 |
numeric paren_depth#; .5[body_height#,-paren_depth#]=math_axis#; |
| 88 |
numeric asc_depth#; .5[asc_height#,-asc_depth#]=math_axis#; |
| 89 |
body_depth:=desc_depth+body_height-asc_height; |
| 90 |
shrink_fit:=1+hround(2letter_fit#*hppp)-2letter_fit; |
| 91 |
if not string mode: if mode<=smoke: shrink_fit:=0; fi fi |
| 92 |
forsuffixes $=thin_join,hair,curve,flare,dot_size,cap_hair,cap_curve, |
| 93 |
vair,bar,slab,cap_bar,cap_band,stem',cap_stem',vair',fudged.hair, |
| 94 |
fudged.stem,fudged.cap_stem: $:=max($,2); endfor % "WRITE WHITE" ONLY! |
| 95 |
enddef; |
| 96 |
|