Back to index

wims  3.65+svn20090927
Classes | Defines | Functions | Variables
tfm.c File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  tfm
struct  tfm::f


#define tfmlf   tfmhd[0]
#define tfmlh   tfmhd[1]
#define tfmbc   tfmhd[2]
#define tfmec   tfmhd[3]
#define tfmnw   tfmhd[4]
#define tfmnh   tfmhd[5]
#define tfmnd   tfmhd[6]
#define tfmni   tfmhd[7]
#define tfmnl   tfmhd[8]
#define tfmnk   tfmhd[9]
#define tfmne   tfmhd[10]
#define tfmnp   tfmhd[11]


void loadtfm (char *fname)


struct tfm tfm
short int tfmhd [12]

Class Documentation

struct tfm

Definition at line 20 of file tfm.c.

Collaboration diagram for tfm:
Class Members
int bc
int checksum
int designsize
int ec
struct f f
struct tfm::f

Definition at line 23 of file tfm.c.

Class Members
long int d
long int h
long int w

Define Documentation

#define tfmbc   tfmhd[2]

Definition at line 32 of file tfm.c.

#define tfmec   tfmhd[3]

Definition at line 33 of file tfm.c.

#define tfmlf   tfmhd[0]

Definition at line 30 of file tfm.c.

#define tfmlh   tfmhd[1]

Definition at line 31 of file tfm.c.

#define tfmnd   tfmhd[6]

Definition at line 36 of file tfm.c.

#define tfmne   tfmhd[10]

Definition at line 40 of file tfm.c.

#define tfmnh   tfmhd[5]

Definition at line 35 of file tfm.c.

#define tfmni   tfmhd[7]

Definition at line 37 of file tfm.c.

#define tfmnk   tfmhd[9]

Definition at line 39 of file tfm.c.

#define tfmnl   tfmhd[8]

Definition at line 38 of file tfm.c.

#define tfmnp   tfmhd[11]

Definition at line 41 of file tfm.c.

#define tfmnw   tfmhd[4]

Definition at line 34 of file tfm.c.

Function Documentation

void loadtfm ( char *  fname)

Definition at line 43 of file tfm.c.

    int i, k, t, len, charcnt;
    char namebuf[1024];
    long int *wpbase;
    long int *headp, *fp, *fip, *wp, *hp, *dp;
    unsigned char *tfmbuf, *ftp;

    call_sh("cp `kpsewhich %s.tfm` %s",fname,tmpdir);
    len=getfile(namebuf,&tfmbuf); unlink(namebuf);
    if(len<0) {
       error("Error reading tfm file.");
    for(i=0;i<12;i++) tfmhd[i]=texint(tfmbuf+2*i,2);
    if(charcnt<=0) return;
    wpbase=(long int *) tfmbuf;
    headp=wpbase+6;         /* header */
    fp=headp+tfmlh;         /* font info */
    wp=fp+charcnt;          /* width table */
    hp=wp+tfmnw;            /* height table */
    dp=hp+tfmnh;            /* depth table */
    for(i=0, t=tfmbc;i<charcnt; i++,t++) {
       fip=fp+i; ftp=(unsigned char *) fip;
       k=*ftp; tfm.f[t].w=texint(wp+k,4); ftp++;
       k=((*ftp)>>4)&15; tfm.f[t].h=texint(hp+k,4);
       k=(*ftp)&15; tfm.f[t].d=texint(dp+k,4);

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

struct tfm tfm
short int tfmhd[12]

Definition at line 28 of file tfm.c.