Debian Codegraph @

texmf-dist/fonts/source/public/knuth-local/local.mf

raw
1 % This file can be loaded after plain.mf.
2 % It introduces conventions that are commonly used on my home computer,
3 % while remaining compatible with the plain base.
4 % It also adds some macros added by AMS in their amsmodes.mf, version 2.1a
5 base_version:=base_version&"/art";
6
7 def cand(text q) = startif true q else: false fi enddef;
8 def cor(text q) = startif true true else: q fi enddef;
9 tertiarydef p startif true = if p: enddef;
10
11 def mode_def suffix $ =
12 if known($) cand
13 (numeric $ cand
14 ($<number_of_modes cand
15 (mode_name[$] = (str $ & "_")))):
16 else: if known(mode-$) cand (unknown mode): mode:= fi
17 $:=incr number_of_modes;
18 mode_name[$]:=str$ & "_";
19 fi
20 expandafter quote def scantokens mode_name[$] enddef;
21
22 screen_rows:=1024; screen_cols:=1024;
23
24 % Here are conventions for local output devices:
25
26 mode_def imagen = % imagen mode: for the Imagen 8/300 (Canon engine)
27 proofing:=0; % no, we're not making proofs
28 fontmaking:=1; % yes, we are making a font
29 tracingtitles:=0; % no, don't show titles in the log
30 pixels_per_inch:=300;
31 blacker:=0; % Canon engine is black enough
32 fillin:=.2; % and it tends to fill in diagonals
33 o_correction:=.6; %
34 enddef;
35
36 mode_def aps = % aps mode: for the Autologic APS-Micro5
37 proofing:=0; % no, we're not making proofs
38 fontmaking:=1; % yes, we are making a font
39 tracingtitles:=1; % yes, show titles online
40 pixels_per_inch:=722.909; % that's roughly 10 per pt
41 blacker:=.2; % make pens a teeny bit blacker
42 fillin:=.2; % but compensate for diagonal fillin
43 o_correction:=1; % and keep the full overshoot
44 enddef;
45
46 mode_def linohi = % lino mode: for the Linotronic at 1270dpi
47 proofing:=0; % no, we're not making proofs
48 fontmaking:=1; % yes, we are making a font
49 tracingtitles:=1; % yes, show titles online
50 pixels_per_inch:=1270;
51 blacker:=.2; % make pens a teeny bit blacker
52 fillin:=.2; % but compensate for diagonal fillin
53 o_correction:=1; % and keep the full overshoot
54 enddef;
55
56 mode_def fourc = % for 400dpi printers
57 proofing:=0; % no, we're not making proofs
58 fontmaking:=1; % yes, we are making a font
59 tracingtitles:=0; % no, don't show titles in the log
60 pixels_per_inch:=400;
61 blacker:=0; % engine is black enough
62 fillin:=.2; % and it tends to fill in diagonals
63 o_correction:=.6; %
64 enddef;
65
66 localfont:=imagen;
67
68 % Macros to add mode information specials to fonts. (by Pierre MacKay)
69
70 def mode_special(suffix $) =
71 string s,d;
72 s:=str$; d:=decimal scantokens s;
73 special s&":="&d&";" enddef;
74
75 def font_mode_specials =
76 p_p_i=pixels_per_inch/mag;
77 if fontmaking > 0:
78 begingroup; save d,s,p; save pixels_per_inch;
79 string p;
80 pixels_per_inch:=p_p_i;
81 special jobname;
82 mode_special(mag);
83 if string mode: p:=mode;
84 else: p:=substring(0,length(mode_name[mode])-1) of mode_name[mode]; fi
85 special "mode:="&p&";";
86 mode_special(pixels_per_inch);
87 mode_special(blacker);
88 mode_special(fillin);
89 mode_special(o_correction);
90 endgroup;
91 fi
92 enddef;
93
94 % Finally, here are macros for Xerox-world font info:
95
96 def font_family expr s = % string s names the font family, e.g., "CMR"
97 headerbyte 49: BCPL_string(s,20);
98 special "identifier "&s enddef;
99 def coding_scheme expr s = % string s names the scheme, e.g. "TEX TEXT"
100 headerbyte 9: BCPL_string(s,40);
101 special "codingscheme "&s enddef;
102 def font_face_byte expr x = % integer x gives the family member number,
103 headerbyte 72: x; % which should be between 0 and 255
104 special "fontfacebyte"; numspecial x enddef;
105
106 def BCPL_string(expr s,n)= % string s becomes an n-byte BCPL string
107 for l:=if length(s)>=n: n-1 else: length(s) fi: l
108 for k:=1 upto l: , substring (k-1,k) of s endfor
109 for k:=l+2 upto n: , 0 endfor endfor enddef;
110
111 Xerox_world:=1; % users can say `if known Xerox_world:...fi'
112
113 inner end;
114 def bye=
115 if fontmaking>0: font_family font_identifier_;
116 coding_scheme font_coding_scheme_;
117 font_face_byte max(0,254-round 2designsize);
118 font_mode_specials; fi
119 end
120 enddef;
121
122 outer bye,end;