summaryrefslogtreecommitdiff
path: root/fonts/chess/skak/mf/skakf10b.mf
blob: b21bcb32ffafd345c1833494bc10e67f91570568 (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
% This is `skakf10b.mf' version 1.0 as of 6/99
% based on original work by Piet Tutelaers

% Informator symbols added
% by Dirk Baechle, dl9obn@darc.de <2002-11-06>

% generates a font consisting of chess figurines

mode_setup;
font_size 10pt#;

u#:=10pt#;

input skakbase;

def figurine(expr code) =
   beginchar(code, 1.0d#, .8d#, .2d#);
        pickup pencircle scaled fine;
	hairline_pen:=savepen;
	pickup pencircle scaled thin;
	thin_pen:=savepen ; % for drawing pieces
	pickup pencircle scaled thick;
	thick_pen:=savepen; % for drawing inside pieces
	define_whole_pixels(d);
        figshift:=0;
	scantokens code(d, 0, -.2);
	currentpicture:=currentpicture shifted (0,liftfig#);
   endchar;
enddef;

def narrow_figurine(expr code) =
   beginchar(code, 0.8d#, .8d#, .2d#);
        pickup pencircle scaled fine;
	hairline_pen:=savepen;
	pickup pencircle scaled thin;
	thin_pen:=savepen ; % for drawing pieces
	pickup pencircle scaled thick;
	thick_pen:=savepen; % for drawing inside pieces
	define_whole_pixels(d);
        figshift:=-0.1;
	scantokens code(d, 0, -.2);
	currentpicture:=currentpicture shifted (0,liftfig#);
   endchar;
enddef;

M=1; % number of squares
d#:=10pt#/M;   % size per square
lift=0.08;
thin#:=.47pt#;
middle#:=.7pt#;
fine#:=9/10thin#;
thick#:=5/6pt#;
define_blacker_pixels(fine, thin, middle, thick);
light=0; dark=1; white=0; black=1;
background:=light; color:=white;

liftfig#:=0d#;

narrow_figurine("K");
narrow_figurine("R");
narrow_figurine("B");
figurine("N");
figurine("p");
figurine("Q");

input skakinf;

end;