File: tfm.c

package info (click to toggle)
vftool 2.0alpha-2
  • links: PTS
  • area: main
  • in suites: sarge, woody
  • size: 376 kB
  • ctags: 770
  • sloc: ansic: 2,748; makefile: 186; sh: 79
file content (52 lines) | stat: -rw-r--r-- 1,179 bytes parent folder | download | duplicates (5)
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
#include	<stdio.h>
/*
#include	"defs.h"
#include	"bifont.h"
*/
typedef unsigned char byte;

byte header[256*4];
byte char_info[256*4];
byte width[256*4];
byte height[256*4];
byte depth[256*4];
byte italic[256*4];
byte lig_kern[1024*4];
byte kern[256*4];
byte exten[256*4];
byte param[32*4];
int lf, lh, bc, ec, nw, nh, nd, ni, nl, nk, ne, np;
int ds;

#define	JFM_ID		11

readtfm(fntfp)
register FILE *fntfp;
{
    if ((lf = getuint(fntfp, 2)) <= JFM_ID)
	return 0;
    lh = getuint(fntfp, 2);
    bc = getuint(fntfp, 2);
    ec = getuint(fntfp, 2);
    nw = getuint(fntfp, 2);
    nh = getuint(fntfp, 2);
    nd = getuint(fntfp, 2);
    ni = getuint(fntfp, 2);
    nl = getuint(fntfp, 2);
    nk = getuint(fntfp, 2);
    ne = getuint(fntfp, 2);
    np = getuint(fntfp, 2);
    getbytes(fntfp, header, lh*4);
    ds = makeuint(header+4, 4);
    getbytes(fntfp, char_info, (ec-bc+1)*4);
    getbytes(fntfp, width, 4*nw);
    getbytes(fntfp, height, 4*nh);
    getbytes(fntfp, depth, 4*nd);
    getbytes(fntfp, italic, 4*ni);
    getbytes(fntfp, lig_kern, 4*nl);
    getbytes(fntfp, kern, 4*nk);
    getbytes(fntfp, exten, 4*ne);
    getbytes(fntfp, param, 4*np);

    return 1;
}