aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/tcs/font/mkfile
blob: 0184be9b64539cab60240a97763e87328be29a5a (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
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
<$PLAN9/src/mkhdr
NPROC=3

OBJ=main.$O font.$O \
	kmap.$O kbits.$O kuten208.$O \
	bmap.$O bbits.$O big5.$O \
	gmap.$O gbits.$O qbits.$O gb.$O

$O.out:	$OBJ
	$LD $prereq -lbio -lg

%.$O:	%.c
	$CC -w $stem.c

$O:	hdr.h

kuten208.$O:	../kuten208.c
	$CC -I.. -w ../kuten208.c
big5.$O:	../big5.c
	$CC -I.. -w ../big5.c
gb.$O:	../gb.c
	$CC -I.. -w ../gb.c

kuten208.$O kmap.$O:	../kuten208.h
big5.$O bmap.$O:	../big5.h
gb.$O gmap.$O:		../gb.h

clean:V:
	rm -f [$OS].out *.[$OS] y.tab.? rc.*

poot:V:	merge
	merge /lib/font/bit/gb/*.7000.24 > /dev/null

merge:	merge.c
	$CC -w merge.c && vl -o merge merge.$O && rm merge.$O

fonts:V:	v.out rc.jis rc.big5
	jis.rc
	big5.rc

rc.jis:VQD:
	awk 'BEGIN {
		fontsize = 512		# set this to chars/subfont
		dest = "/lib/font/bit/jis"
		print "#!/bin/rc"
		printf "v.out -s 0x3000 0x303f > %s/jis3000.16\n", dest
		printf "v.out -s 0x30a1 0x30fe > %s/katakana.16\n", dest
		printf "v.out -s 0x3041 0x309e > %s/hiragana.16\n", dest
		printf "v.out 0x3000 0x303f > %s/jis3000.24\n", dest
		printf "v.out 0x30a1 0x30fe > %s/katakana.24\n", dest
		printf "v.out 0x3041 0x309e > %s/hiragana.24\n", dest
		for(i = 19968; i < 40865; i += fontsize)
			printf "v.out -s 0x%x 0x%x > %s/jis%x.16\n", i, i+fontsize-1, dest, i
		for(i = 19968; i < 40865; i += fontsize)
			printf "v.out 0x%x 0x%x > %s/jis%x.24\n", i, i+fontsize-1, dest, i
		exit
	}' > $target
	chmod 775 $target

rc.big5:VQD:
	awk 'BEGIN {
		fontsize = 512		# set this to chars/subfont
		dest = "/lib/font/bit/big5"
		print "#!/bin/rc"
		for(i = 19968; i < 40869; i += fontsize)
			printf "v.out -5 -s 0x%x 0x%x > %s/%x.16\n", i, i+fontsize-1, dest, i
		exit
	}' > $target
	chmod 775 $target

rc.gb:VQD:
	fn g{
	x=$1
	y=$2
	z=$3
	awk 'BEGIN {
		fontsize = 512		# set this to chars/subfont
		dest = "/lib/font/bit/gb/'$"x'."
		opt = "'$"y'"
		sz = "'$"z'"
		print "#!/bin/rc"
		printf "v.out %s 0x3000 0x303f > %s3000.%s\n", opt, dest, sz
		printf "v.out %s 0x30a1 0x30fe > %skatakana.%s\n", opt, dest, sz
		printf "v.out %s 0x3041 0x309e > %shiragana.%s\n", opt, dest, sz
		printf "v.out %s 0x3100 0x312f > %sbopomofo.%s\n", opt, dest, sz
		printf "v.out %s 0x3200 0x32ff > %s3200.%s\n", opt, dest, sz
		for(i = 19968; i < 40869; i += fontsize)
			printf "v.out %s 0x%x 0x%x > %s%x.%s\n", opt, i, i+fontsize-1, dest, i, sz
		exit
	}'
	}
	{
		g TradSong '-q -f ../han/cfan24.ccf' 24
		g FangSong '-q -f ../han/cfang24.ccf' 24
		g Hei '-q -f ../han/chei24.ccf' 24
		g Kai '-q -f ../han/ckai24.ccf' 24
		g Song '-q -f ../han/csong24.ccf' 24
		g Song '-g -s -f ../han/cclib16st.bdf' 16
		g FangSong '-g -s -f ../han/cclib16fs.bdf' 16
	} > $target
	chmod 775 $target

<$PLAN9/src/mkmany