summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/aspectratio/ar9.mf
blob: 4e1ca20bcfe509b2b2de2f4f9101f1d511c998ae (plain)
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
% Computer Modern Roman 9 point
if unknown cmbase: input cmbase fi

font_identifier:="AR"; font_size 9pt#;

u#:=18.5/36pt#;      % unit width
width_adj#:=0pt#;    % width adjustment for certain characters
serif_fit#:=0pt#;    % extra sidebar near lowercase serifs
cap_serif_fit#:=4.6/36pt#;  % extra sidebar near uppercase serifs
letter_fit#:=0pt#;    % extra space added to all sidebars

body_height#:=243/36pt#;  % height of tallest characters
asc_height#:=225/36pt#;    % height of lowercase ascenders
cap_height#:=221.4/36pt#;  % height of caps
fig_height#:=208.8/36pt#;  % height of numerals
x_height#:=139.5/36pt#;    % height of lowercase without ascenders
math_axis#:=81/36pt#;    % axis of symmetry for math symbols
bar_height#:=78.3/36pt#;  % height of crossbar in lowercase e
comma_depth#:=63/36pt#;    % depth of comma below baseline
desc_depth#:=63/36pt#;    % depth of lowercase descenders

crisp#:=8/36pt#;    % diameter of serif corners
tiny#:=8/36pt#;      % diameter of rounded corners
fine#:=7/36pt#;      % diameter of sharply rounded corners
thin_join#:=7/36pt#;    % width of extrafine details
hair#:=9/36pt#;      % lowercase hairline breadth
stem#:=23/36pt#;    % lowercase stem breadth
curve#:=27/36pt#;    % lowercase curve breadth
ess#:=25/36pt#;      % breadth in middle of lowercase s
flare#:=29/36pt#;    % diameter of bulbs or breadth of terminals
dot_size#:=35/36pt#;    % diameter of dots
cap_hair#:=10/36pt#;    % uppercase hairline breadth
cap_stem#:=28/36pt#;    % uppercase stem breadth
cap_curve#:=32/36pt#;    % uppercase curve breadth
cap_ess#:=30/36pt#;    % breadth in middle of uppercase s
rule_thickness#:=.38pt#;  % thickness of lines in math symbols

dish#:=1/36pt#;      % amount erased at top or bottom of serifs
bracket#:=18/36pt#;    % vertical distance from serif base to tangent
jut#:=27/36pt#;      % protrusion of lowercase serifs
cap_jut#:=33/36pt#;    % protrusion of uppercase serifs
beak_jut#:=9.2/36pt#;    % horizontal protrusion of beak serifs
beak#:=63/36pt#;    % vertical protrusion of beak serifs
vair#:=8/36pt#;      % vertical diameter of hairlines
notch_cut#:=9pt#;    % maximum breadth above or below notches
bar#:=10/36pt#;      % lowercase bar thickness
slab#:=10/36pt#;    % serif and arm thickness
cap_bar#:=10/36pt#;    % uppercase bar thickness
cap_band#:=10/36pt#;    % uppercase thickness above/below lobes
cap_notch_cut#:=9pt#;    % max breadth above/below uppercase notches
serif_drop#:=3.6/36pt#;    % vertical drop of sloped serifs
stem_corr#:=1/36pt#;    % for small refinements of stem breadth
vair_corr#:=1/36pt#;    % for small refinements of hairline height
apex_corr#:=0pt#;    % extra width at diagonal junctions

o#:=7/36pt#;      % amount of overshoot for curves
apex_o#:=7/36pt#;    % amount of overshoot for diagonal junctions

slant:=.25;      % tilt ratio $(\Delta x/\Delta y)$
fudge:=1;      % factor applied to weights of heavy characters
math_spread:=.2;    % extra openness of math symbols
superness:=1/sqrt2;    % parameter for superellipses
superpull:=1/6;      % extra openness inside bowls
beak_darkness:=11/30;    % fraction of triangle inside beak serifs
ligs:=2;      % level of ligatures to be included

square_dots:=false;    % should dots be square?
hefty:=false;      % should we try hard not to be overweight?
serifs:=true;      % should serifs and bulbs be attached?
monospace:=false;    % should all characters have the same width?
variant_g:=true;    % should an italic-style g be used?
low_asterisk:=false;    % should the asterisk be centered at the axis?
math_fitting:=true;    % should math-mode spacing be used?

mode_setup; font_setup;


cmchar "The ligature AR";
beginchar("A",if serifs: 12u#+.5max(2u#,cap_curve#)
 else:12.5u#-.5width_adj# fi,cap_height#,0);
italcorr .75cap_height#*slant- if serifs: 1.75 else: .5 fi\\ u#;
adjust_fit(6u#+cap_serif_fit#,0);
pickup tiny.nib; pos1(cap_stem',0); pos2(cap_stem',0);
lft x1l=lft x2l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
filldraw stroke z1e--z2e; % stem
penpos3(cap_band,90); penpos4(cap_band,90);
penpos5(cap_curve if hefty:-3stem_corr fi,0);
penpos6(vair,-90); penpos7(vair,-90);
z3r=top z1; y4=y3; y5=.5[y4l,y6l]; y6=y7;
x7=x2; y7l=vround(.5h+.5vair); x4=x6;
if serifs: x4=.5w-.5u; x5r=hround(w-2.25u);
else: x4=.5w+.5u; x5r=hround(w-u); fi
x4l:=x6l:=x4-.125cap_curve;
fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e;  % lobe
if serifs: pos6'(vair,-90); pos0(cap_stem,180);
 pos8(cap_curve,180); pos9(vair,-90); pos10(hair,0);
 z6'=z6; lft x0r=lft x8r=hround(x5-2/3u-.5cap_curve);
 y8=1/3[y2,y7]; y0=3/5[y2,y7]; x9=.5[x8l,x10r];
 bot y9r=-o; rt x10r=hround(w-.05u); y10=1/4[y2,y7];
 filldraw stroke z6'e{right}..z0e---z8e....z9e{right}..z10e{up};  % tail
 dish_serif(2,1,c,1/3,cap_jut,d,1/3,cap_jut);  % lower serif
else: penpos8(cap_stem-2stem_corr,0); penpos9(cap_stem,0);
 x8=x6+.5u; y8=y6; x9r=hround(w-.5u); y9=0;
 fill z8l--diag_end(8l,9l,.5,1,9r,8r)--z8r--cycle; fi  % tail
left_stem=if monospace:fudged.hair else: cap_hair fi if hefty: -3stem_corr fi;
outer_jut=.8cap_jut; x11l=l+letter_fit+outer_jut+.5u; y11=0;
x12=x1l-apex_corr-if monospace:2 fi\\u; y12=h;
alpha=diag_ratio(1,.5left_stem,y12-y11,x12-x11l);
penpos11(alpha*left_stem,0); penpos12(alpha*left_stem,0);
fill diag_end(12l,11l,1,1,11r,12r)
 --diag_end(11r,12r,1,1,12l,11l)--cycle; % diagonal
y15=h-slab; z15=whatever[z11,z12];
fill z15--(x1,y15)--(x1,h)--z12--cycle;  % link
penpos13(whatever,angle(z2-z1)); z13=whatever[z11,z12];
penpos14(cap_band,90); x14=x7; y13l=y14l; y13r=y14r;
if hefty: y14r=.4h; else: y14=y7; fi
penstroke z13e--z14e; % bar line
if serifs: numeric inner_jut; pickup tiny.nib;
 prime_points_inside(11,12);
 if rt x11'r+cap_jut+.5u+1<=lft x2l-.75cap_jut:
   inner_jut=cap_jut;
 else:
   rt x11'r+inner_jut+.5u+1=lft x2l-.75inner_jut;
 fi
 dish_serif(11',12,i,1/2,outer_jut,j,.6,inner_jut)(dark);  % lower left serif
 nodish_serif(1,2,a,1/3,cap_jut+x1l-x12,b,1/3,.5cap_jut);  % upper serif
fi
math_fit(0,.75ic#);
penlabels(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); endchar;

font_slant slant; font_x_height x_height#;
if monospace: font_normal_space 9u#; % no stretching or shrinking
 font_quad 18u#;
 font_extra_space 9u#;
else: font_normal_space 6u#+2letter_fit#;
 font_normal_stretch 3u#; font_normal_shrink 2u#;
 font_quad 18u#+4letter_fit#;
 font_extra_space 2u#;
fi

bye.