--- ray/src/common/font.c 1993/05/14 11:30:17 2.7 +++ ray/src/common/font.c 1995/05/25 15:14:03 2.10 @@ -15,10 +15,8 @@ static char SCCSid[] = "$SunId$ LBL"; #define galloc(nv) (GLYPH *)malloc(sizeof(GLYPH)+2*sizeof(GORD)*(nv)) -extern char *libpath; /* list of library directories */ +extern char *fgetword(), *getlibpath(); -extern char *fgetword(); - static FONT *fontlist = NULL; /* list of loaded fonts */ @@ -40,7 +38,7 @@ char *fname; if (!strcmp(f->name, fname)) return(f); /* load the font file */ - if ((pathname = getpath(fname, libpath, R_OK)) == NULL) { + if ((pathname = getpath(fname, getlibpath(), R_OK)) == NULL) { sprintf(errmsg, "cannot find font file \"%s\"", fname); error(USER, errmsg); } @@ -160,7 +158,7 @@ register FONT *f; /* font */ if (f->fg[*tp++&0xff] == NULL) *sp++ = 0; else - linelen += *sp++ = 256; + linelen += *sp++ = 255; return(linelen); } @@ -175,11 +173,12 @@ int cis; /* intercharacter spacing */ int linelen; register GLYPH *gp; + linelen = 0; gp = NULL; while (*tp && (gp = f->fg[*tp++&0xff]) == NULL) *sp++ = 0; cis /= 2; - linelen = *sp = cis; + *sp = cis; while (gp != NULL) { if (gp->nverts) { /* regular character */ linelen += *sp++ += cis - gp->left;