summaryrefslogtreecommitdiff
path: root/fonts/malvern/source/maparams.mf
blob: b8ca2fca0f1542ebb286c96297497fd5f27fa946 (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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
% maparams.mf 1.2.0 1994/10/11 -- Set ad-hoc parameters
% Copyright  1991-4 P. Damian Cugley.

%%% @METAFONT-file {
%%%   filename       = "maparams.mf",
%%%   version        = "1.2.0",
%%%   date           = "1994/10/11",
%%%   package        = "Malvern 1.2",
%%%   author         = "P. Damian Cugley",
%%%   email          = "damian.cugley@comlab.ox.ac.uk",
%%%   address        = "Oxford University Computing Laboratory,
%%%                     Parks Road, Oxford  OX1 3QD, UK",
%%%   codetable      = "USASCII",
%%%   keywords       = "Malvern, METAFONT, font, typefont, TeX",
%%%   supported      = "Maybe",
%%%   abstract       = "Define ad-hoc parameters for the Malvern
%%%                     font family.",
%%%   dependencies   = "other program files",
%%% }

%  See the Malvern Handbook (maman.tex) for more info about Malvern.
%  This software is available freely but without warranty.
%  See the file COPYING for details.

%{{{ maparams.mf

%{{{  meta-parameters (should be set before |\input ma|)

boolean italic;     % set if |italicness > 0| -- use italic letter-shapes

if unknown italicness: 
    italic := false;
    italicness := 0;
elseif italicness > 0:
    italic := true;
else:
    italic := false;
fi
% |italicness| is not referred to again

if unknown hratio: hratio := 1; fi

if unknown weight: weight := 1; fi

if unknown slant: slant := 0; fi
currenttransform := identity 
    if slant <> 0: slanted slant fi
    if aspect_ratio <> 1.0: yscaled aspect_ratio fi;

%  Warning message if selected obliqued font
if (slant <> 0) and (not italic):
    message "Please use italic instead of obliqued.";
    message "(Unless you know what you're doing!)";
fi
%}}}  meta-paramaters
%{{{  units of measurement
v# = 1/16 designsize;	    % unit of vertical measurement NB 1/16, not 1/18

u# = v# * hratio 
    if italic: * 0.95 fi; 	    % unit of horizontal measurement

sp# = 1.2u# 
    if designsize < 8pt#: * (8pt#/designsize) fi;  
			    % unit of inter-charcter spacing

ku# = 1/2[u#,sp#];	    % unit of kerning
%}}}  units
%{{{  heights and widths


body_ht# =		    % height of tallest characters
brack_ht# =		    % height of parentheses and other brackets
asc_ht# =		    % height of ascenders on l.c.\ letters like d
cap_ht# =		    % height of capital letters like X
fig_ht# = 12v#;		    % height of ranging figures
x_ht# = 8v#;		    % height of lower case  letters like x
axis_ht# = 5v#;		    % height of maths axis (rarely used)
brack_dp# = 2v#;	    % depth of parentheses etc.
ogonek_dp# = 2.5v#; 	    % depth of Polish ogonek
desc_dp# =		    % depth of descenders on letters like p
body_dp# = 4v#;		    % depth of deepest characters

%  |body_ht + body_dp = 16v = designsize|
%  Large x-height; no built-in leading

mcap_ht# = 7/8cap_ht#;	    % heigth of medium capitals
scap_ht# = 3/4cap_ht#;	    % height of small capitals
%  Adobe's favoured value is |1/3[x_ht#,cap_ht#]|

fig_wd#     = 8u# - 2sp#;			  % width of ranging figures
sfig_ht#    = 9v#;				  % height of superior figures
sfig_wd#    = 2sfig.pn.wd# + 3.75u#;		  % width of same

sup_x_ht# = 5.4v#;	% x-height of superior letters
sup_x_top# = 11v#;  	% superior letters raised so that x-height is here

dot_wd# = 1.25v# * weight;
dot_ht# = min(1.25v# * max(weight, 1), 3v#);

bullet_wd# = (weight - 1)[4v#,6v#]; % not affected by hratio!
bullet_ht# = (weight - 1)[4v#,6v#];

ho# = oo# = 1/5v#;	    % overshoot for letter o
o# = 2/3oo#;		    % overshoot for other curves
apex_o# = 1/2o#;	    % overshoot for apexes
apex_adjust# = 1/3u# * weight; % widen apexes by this much
%}}}
%{{{  pens

% wd = width   ht = height   th = thickness
% pn = pen (pen is a reserved word)

pn.wd#     	= if italic: 0.8v# else: 0.9v# fi 
    	    	    * weight; 	    	% the default pen width 

%  Lores hack:
if italic and (round(pn.wd# * hppp) < 0.75v# * weight * hppp): 
    pn.wd# := 0.9v# * weight; 
fi

comma.pn.th# 	= 4/5pn.wd#;
yen.pn.th# 	= min(3/4pn.wd#, v#); 	% bar in yen sign
ast.pn.th# 	= min(3/5pn.wd#, v#); 	% used in drawing asterisk 
dag.pn.th# 	= min(2/3pn.wd#, v#); 	% used in drawing dagger
acc.pn.th# 	= min(pn.wd#, v#);  	% used drawing marks

define_blacker_pixels(ast.pn.th, comma.pn.th, acc.pn.th);
define_whole_vertical_blacker_pixels(dag.pn.th, yen.pn.th);
pickup pencircle scaled acc.pn.th; mark_pn := savepen;
% the others are used once each so don't |savepn| them

cap.pn.wd# 	= pn.wd#;   %%%% 1.10*pn.wd#;	
mcap.pn.wd# 	= pn.wd#;   %%%% 1.05*pn.wd#;
scap.pn.wd# 	= 1.00*pn.wd#;
sfig.pn.wd#	= 0.90*pn.wd#;

%  ht = wd unless this would cause counters to fill up etc.
forsuffixes $$ = ,cap,mcap,scap:
    $$pn.ht# = min(2v#, $$pn.wd#);
endfor

sfig.pn.ht# = min((sfig_ht# - 2v#)/3, sfig.pn.wd#);

forsuffixes $$ = ,cap,mcap,scap,sfig:
    define_whole_blacker_pixels($$pn.wd);
    define_whole_vertical_blacker_pixels($$pn.ht);
endfor

%  lowres hacks!
if cap.pn.wd/pn.wd > 1.2:
    cap.pn.wd := mcap.pn.wd := scap.pn.wd := pn.wd;
    cap.pn.ht := mcap.pn.ht := scap.pn.ht := pn.ht;
fi

pickup pencircle xscaled pn.wd yscaled pn.ht;
the_pen = savepen;

%}}}
%{{{  usual sizes of marks

cap_mark_t# = body_ht# + 1.25v#;
cap_mark_b# = mcap_ht# + 0.75v#;
lc_mark_t# = body_ht#;
lc_mark_b# = x_ht# + v#;

%  assuming body_ht# = 12v#, mcap_ht# = 10v#, mcap marks go from
%  11v# to 13.5v# (2.5v#), so are flatter than l.c. marks.

acute_wd# = 3u#;
hook_wd# := pn.wd# + 1u#;	% hook for tall letters like "d" and "t"

%  These are all kept unrounded, and rounded later

cedilla_ht# = 3v#; cedilla_wd# = 3u#;
Cedilla_ht# = 4v#; Cedilla_wd# = 4u#;

%}}}
%{{{  define_pixels

define_pixels(sp,u,v);
define_whole_pixels(apex_adjust, acute_wd, hook_wd);
define_whole_vertical_pixels(brack_ht, body_ht, asc_ht, cap_ht, fig_ht, 
    mcap_ht, scap_ht, x_ht, desc_dp, body_dp, brack_dp, ogonek_dp,
    sup_x_ht, sup_x_top,
    sfig_ht, lc_mark_t, lc_mark_b, cap_mark_t, cap_mark_b);

define_whole_blacker_pixels(dot_wd, bullet_wd);
define_whole_vertical_blacker_pixels(dot_ht, bullet_ht);

define_good_y_pixels(axis_ht);

define_corrected_pixels(o, oo, apex_o);
define_horizontal_corrected_pixels(ho);

define_pixels(cedilla_ht, cedilla_wd, Cedilla_ht, Cedilla_wd);
%}}}
%{{{  Spacing of l.c. letters

a_sp = 0.6;
e_sp = o_sp;
f_lsp = 0.35; 
f_rsp = (0.5sp# - 2u#)/sp#;
i_sp = 1.0;
j_sp = (1sp# - 1.75u#)/sp#;
l_sp = 1.0;
n_sp = 0.9;
o_sp = 0.5;
r_sp = 0.4;
s_sp = 0.6;
v_sp = 0.4;
x_sp = 0.5;
%}}}
golden_ratio = 0.618034;
lc_mark_ht = lc_mark_t - lc_mark_b;
%}}} maparams.mf

%Local variables:
%fold-folded-p: t
%End: