1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
hebase:=1; % when |hebase| is known, this file has been input
let hebchar=\; % `|hebchar|' should precede each character
let generate=input; % `|generate|' should follow the parameters
newinternal slant;
boolean monospace;
mode_def lowres =
proofing:=0;
fontmaking:=1;
tracingtitles:=0;
pixels_per_inch:=300;
blacker:=.65;
fillin:=.2;
o_correction:=.4;
enddef;
def font_heb_setup =
define_pixels(s,u,bigend,littlend,over);
define_good_x_pixels(leftstemloc);
define_blacker_pixels(pencil,pencil1,pencil2);
define_corrected_pixels(o);
if monospace:let adjust_fit=mono_adjust_fit;
else: let adjust_fit=normal_adjust_fit; fi
pickup pencircle scaled pencil;
redis_pen:=savepen;
enddef;
def font_setup =
if monospace: let adjust_fit=mono_adjust_fit;
def mfudged=fudged enddef;
mono_charic#:=body_height#*slant;
if mono_charic#<0: mono_charic#:=0; fi
mono_charwd#:=9u#; define_whole_pixels(mono_charwd);
else: let adjust_fit=normal_adjust_fit;
def mfudged= enddef; fi
let math_fit=ignore_math_fit ;
define_pixels(u,width_adj,stem_corr,vair_corr);
define_whole_pixels(fine,letter_fit,crisp,tiny);
define_whole_vertical_pixels(body_height,asc_height,
x_height,comma_depth,desc_depth);
define_whole_blacker_pixels(thin_join,hair,stem,curve,flare,
dot_size,cap_hair,cap_stem,cap_curve);
define_whole_vertical_blacker_pixels(vair,bar,slab,cap_bar,cap_band);
forsuffixes $=hair,stem,cap_stem:
fudged$.#:=fudge*$.#; fudged$:=hround(fudged$.#*hppp+blacker);
forever: exitif fudged$>.9fudge*$; fudged$:=fudged$+1; endfor endfor
rule_thickness:=ceiling(rule_thickness#*hppp);
heavy_rule_thickness:=ceiling(3rule_thickness#*hppp);
oo:=vround(.5o#*hppp*o_correction)+eps;
lowres_fix(stem,curve,flare) 1.3;
lowres_fix(stem,curve) 1.2;
lowres_fix(cap_stem,cap_curve) 1.2;
lowres_fix(hair,cap_hair) 1.2;
lowres_fix(cap_band,cap_bar,bar,slab) 1.2;
stem':=hround(stem-stem_corr); cap_stem':=hround(cap_stem-stem_corr);
vair':=vround(vair+vair_corr);
vstem:=vround .8[vair,stem]; cap_vstem:=vround .8[vair,cap_stem];
dw:=(curve#-stem#)*hppp; bold:=curve#*hppp+blacker;
dh#:=.6designsize;
stem_shift#:=if serifs: 2stem_corr# else: 0 fi;
more_super:=max(superness,sqrt .77superness);
hein_super:=max(superness,sqrt .81225258superness); % that's $2^{-.3}$
clear_pen_memory;
if fine=0: fine:=1; fi
forsuffixes $=fine,crisp,tiny:
%%% fine $ %%%% temporary formatting convention for MFT
if $>fudged.hair: $:=fudged.hair; fi
$.breadth:=$;
pickup if $=0: nullpen else: pencircle scaled $; $:=$-eps fi;
$.nib:=savepen; breadth_[$.nib]:=$;
forsuffixes $$=lft,rt,top,bot: shiftdef($.$$,$$ 0); endfor endfor
%%% @ $ %%%% restore ordinary formatting for $
min_Vround:=max(fine.breadth,crisp.breadth,tiny.breadth);
if min_Vround<vround min_Vround: min_Vround:=vround min_Vround; fi
if flare<vround flare: flare:=vround flare; fi
forsuffixes $=vair,bar,slab,cap_bar,cap_band,vair',vstem,cap_vstem,bold:
if $<min_Vround: $:=min_Vround; fi endfor
pickup pencircle scaled rule_thickness; rule.nib:=savepen;
math_axis:=good.y(math_axis#*hppp);
pair cal.extension; cal.extension:=(.75cap_curve,0) rotated 30;
bot_flourish_line:=-.5u-o;
pair bend; bend=(.5u,0);
pair flourish_change; flourish_change=(4u,.2asc_height);
join_radius:=u;
currenttransform:=identity slanted slant
yscaled aspect_ratio scaled granularity;
if currenttransform=identity: let t_=relax
else: def t_ = transformed currenttransform enddef fi;
numeric paren_depth#; .5[body_height#,-paren_depth#]=math_axis#;
numeric asc_depth#; .5[asc_height#,-asc_depth#]=math_axis#;
body_depth:=desc_depth+body_height-asc_height;
if not string mode: if mode<=smoke: shrink_fit:=0; fi fi
enddef;
outer hebchar;
|