summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/metafont/misc/3test.mf
blob: 8a62fb1fdd3abe1782845778c1371a18ff495e0f (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
% This tries all characters on TEST.MF using three different sets of parameters
% (appropriate for italic styles)
if unknown cmbase: input cmbase fi % omit if CMMF can be assumed
mag=.5;
mode_setup; let mode_setup=\;

boolean running;
def abort = hide(scrollmode; running:=false) enddef;
def pause=stop "done with char "&decimal charcode&". " enddef;
let iff=always_iff;
def ligtable text t=enddef;
def charlist text t=enddef;
def extensible text t=enddef;

string currenttitle;
let semi=;; let echar=endchar; let endchar=enddef;
def cmchar expr s = currenttitle:=s;
 let;=testchar semi quote def chartext=enddef;
def testchar = semi let;=semi;
 % now `chartext echar' will generate the character to be tested
 running:=true; errorstopmode;
 for k=1 upto 6:
  if running: if known params[k]: scantokens params[k]; font_setup;
    currentwindow:=k;
    currenttitle & ", " & fontname[k];
    chartext echar; fi fi endfor
 pause; enddef;

string params[],fontname[];
params[1]="ital_params"; fontname[1]="cmti10";
params[2]="bold_ital_params"; fontname[2]="cmbxti10";
params[3]="tt_params"; fontname[3]="cmmi10";

w_rows=floor 1/2 screen_rows; w_cols=floor 1/3 screen_cols;
def open(expr k,i,j)=
 openwindow k from ((i-1)*w_rows,(j-1)*w_cols) to (i*w_rows,j*w_cols)
 at (-10,140) enddef;
def openit =
 open(1,1,1); open(2,1,2); open(3,1,3);
 open(4,2,1); open(5,2,2); open(6,2,3); enddef;

begingroup delimiters begintext generate;
 def makedef(expr s)(text t) =
  expandafter def scantokens s = t enddef; flushtext enddef;
 def flushtext suffix t = enddef;
 for k=1 upto 6: if known params[k]:
 makedef(params[k])
  expandafter expandafter expandafter begintext
  scantokens ("input "&fontname[k]); fi endfor
endgroup;

input test
end