blob: 48f48a92c4736dd975f2415c36db718f6cd4c77e (
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
|
% poorman.mf macro file for producing fonts in the
% Poor Man's language series for TeX
% this code is placed in the public domain by Thomas Ridgeway
% and the Humanities and Arts Computing Center, University of Washington
if unknown cmbase: input cmbase fi
mode_setup;
def generate suffix t= enddef;
input cmr10;
crisp#:=0pt#; font_setup;
numeric magfactor; magfactor=1;
font_coding_scheme:="JIS encoded TeX text";
def setupsizes =
numeric cheight; cheight=magfactor*(body_height+.5desc_depth);
numeric hhalf; numeric vhalf; hhalf=cheight/24; vhalf=cheight/24;
% supposing it was a 16x16 font, we would want to say:
%numeric hhalf; numeric vhalf; hhalf=cheight/16; vhalf=cheight/16;
numeric vcent; vcent=.4vhalf; numeric hcent; hcent=.4hhalf;
enddef;
% jc(character code) sets up for a particular character (in two sizes)
def jc(expr thischar) =
% set a character value
numeric subjectchar; subjectchar=thischar;
% then open a definition in a group to accumulate a bunch of jd() calls
begingroup; quote def drawchar = enddef;
def endjc =
% now process the character and end the local group
processit; endgroup; enddef;
def processit =
% build the character once at true size and once at magstep2
% the magstep2 char should be offset by -128
magfactor:=1; setupsizes; makejc; drawchar; endchar;
magfactor:=magstep2; setupsizes; subjectchar:=subjectchar - 128;
makejc; drawchar; endchar;
enddef;
def makejc =
beginchar(subjectchar,magfactor*(body_height#+.5desc_depth#),magfactor*body_height#,.5magfactor*desc_depth#);
normal_adjust_fit(0.75u#,0.75u#); pickup crisp.nib;
enddef;
% draw a single dot in our matrix at coordinates row,col
def jd(expr row,col) =
y.c:=h-(row * vhalf)-vcent; x.c:=hcent+(col * hhalf);
y.a:=y.c+vcent; y.b:=y.c-vcent;
x.a:=x.c-hcent; x.b:=x.c+hcent;
filldraw (x.a,y.b)..(x.a,y.a)..(x.b,y.a)..(x.b,y.b)..cycle;
enddef;
font_slant slant; font_x_height x_height#;
font_normal_space 9u#;
font_quad 18u#;
font_extra_space 9u#;
|