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
|
% This file can be loaded after plain.mf.
% It introduces conventions that are commonly used on my home computer,
% while remaining compatible with the plain base.
% It also adds some macros added by AMS in their amsmodes.mf, version 2.1a
base_version:=base_version&"/art";
def cand(text q) = startif true q else: false fi enddef;
def cor(text q) = startif true true else: q fi enddef;
tertiarydef p startif true = if p: enddef;
def mode_def suffix $ =
if known($) cand
(numeric $ cand
($<number_of_modes cand
(mode_name[$] = (str $ & "_")))):
else: if known(mode-$) cand (unknown mode): mode:= fi
$:=incr number_of_modes;
mode_name[$]:=str$ & "_";
fi
expandafter quote def scantokens mode_name[$] enddef;
screen_rows:=1024; screen_cols:=1024;
% Here are conventions for local output devices:
mode_def imagen = % imagen mode: for the Imagen 8/300 (Canon engine)
proofing:=0; % no, we're not making proofs
fontmaking:=1; % yes, we are making a font
tracingtitles:=0; % no, don't show titles in the log
pixels_per_inch:=300;
blacker:=0; % Canon engine is black enough
fillin:=.2; % and it tends to fill in diagonals
o_correction:=.6; %
enddef;
mode_def aps = % aps mode: for the Autologic APS-Micro5
proofing:=0; % no, we're not making proofs
fontmaking:=1; % yes, we are making a font
tracingtitles:=1; % yes, show titles online
pixels_per_inch:=722.909; % that's roughly 10 per pt
blacker:=.2; % make pens a teeny bit blacker
fillin:=.2; % but compensate for diagonal fillin
o_correction:=1; % and keep the full overshoot
enddef;
mode_def linohi = % lino mode: for the Linotronic at 1270dpi
proofing:=0; % no, we're not making proofs
fontmaking:=1; % yes, we are making a font
tracingtitles:=1; % yes, show titles online
pixels_per_inch:=1270;
blacker:=.2; % make pens a teeny bit blacker
fillin:=.2; % but compensate for diagonal fillin
o_correction:=1; % and keep the full overshoot
enddef;
mode_def fourc = % for 400dpi printers
proofing:=0; % no, we're not making proofs
fontmaking:=1; % yes, we are making a font
tracingtitles:=0; % no, don't show titles in the log
pixels_per_inch:=400;
blacker:=0; % engine is black enough
fillin:=.2; % and it tends to fill in diagonals
o_correction:=.6; %
enddef;
localfont:=imagen;
% Macros to add mode information specials to fonts. (by Pierre MacKay)
def mode_special(suffix $) =
string s,d;
s:=str$; d:=decimal scantokens s;
special s&":="&d&";" enddef;
def font_mode_specials =
p_p_i=pixels_per_inch/mag;
if fontmaking > 0:
begingroup; save d,s,p; save pixels_per_inch;
string p;
pixels_per_inch:=p_p_i;
special jobname;
mode_special(mag);
if string mode: p:=mode;
else: p:=substring(0,length(mode_name[mode])-1) of mode_name[mode]; fi
special "mode:="&p&";";
mode_special(pixels_per_inch);
mode_special(blacker);
mode_special(fillin);
mode_special(o_correction);
endgroup;
fi
enddef;
% Finally, here are macros for Xerox-world font info:
def font_family expr s = % string s names the font family, e.g., "CMR"
headerbyte 49: BCPL_string(s,20);
special "identifier "&s enddef;
def coding_scheme expr s = % string s names the scheme, e.g. "TEX TEXT"
headerbyte 9: BCPL_string(s,40);
special "codingscheme "&s enddef;
def font_face_byte expr x = % integer x gives the family member number,
headerbyte 72: x; % which should be between 0 and 255
special "fontfacebyte"; numspecial x enddef;
def BCPL_string(expr s,n)= % string s becomes an n-byte BCPL string
for l:=if length(s)>=n: n-1 else: length(s) fi: l
for k:=1 upto l: , substring (k-1,k) of s endfor
for k:=l+2 upto n: , 0 endfor endfor enddef;
Xerox_world:=1; % users can say `if known Xerox_world:...fi'
inner end;
def bye=
if fontmaking>0: font_family font_identifier_;
coding_scheme font_coding_scheme_;
font_face_byte max(0,254-round 2designsize);
font_mode_specials; fi
end
enddef;
outer bye,end;
|