7 |
|
|
8 |
|
#include "copyright.h" |
9 |
|
|
10 |
< |
#include "standard.h" |
10 |
> |
#include <stdlib.h> |
11 |
|
|
12 |
+ |
#include "paths.h" |
13 |
+ |
#include "rtio.h" |
14 |
+ |
#include "rterror.h" |
15 |
|
#include "font.h" |
16 |
|
|
17 |
|
#define galloc(nv) (GLYPH *)malloc(sizeof(GLYPH)+2*sizeof(GORD)*(nv)) |
27 |
|
char *fname; |
28 |
|
{ |
29 |
|
FILE *fp; |
30 |
< |
char *pathname, *err; |
30 |
> |
char *pathname, *err = NULL; |
31 |
|
unsigned wsum, hsum, ngly; |
32 |
|
int gn, ngv, gv; |
33 |
|
register GLYPH *g; |
40 |
|
return(f); |
41 |
|
} |
42 |
|
/* load the font file */ |
43 |
< |
if ((pathname = getpath(fname, getlibpath(), R_OK)) == NULL) { |
43 |
> |
if ((pathname = getpath(fname, getrlibpath(), R_OK)) == NULL) { |
44 |
|
sprintf(errmsg, "cannot find font file \"%s\"", fname); |
45 |
|
error(USER, errmsg); |
46 |
|
} |
120 |
|
error(USER, errmsg); |
121 |
|
memerr: |
122 |
|
error(SYSTEM, "out of memory in fontglyph"); |
123 |
+ |
return NULL; /* pro forma return */ |
124 |
|
} |
125 |
|
|
126 |
|
|
132 |
|
register FONT *fl, *f; |
133 |
|
register int i; |
134 |
|
/* check reference count */ |
135 |
< |
if (fnt != NULL && (fnt->nref-- > 1 | retainfonts)) |
135 |
> |
if (fnt != NULL && ((fnt->nref-- > 1) | retainfonts)) |
136 |
|
return; |
137 |
|
head.next = fontlist; |
138 |
|
fl = &head; |
139 |
|
while ((f = fl->next) != NULL) |
140 |
< |
if ((fnt == NULL | fnt == f)) { |
140 |
> |
if ((fnt == NULL) | (fnt == f)) { |
141 |
|
fl->next = f->next; |
142 |
|
for (i = 0; i < 256; i++) |
143 |
|
if (f->fg[i] != NULL) |
211 |
|
int cis; /* target intercharacter spacing */ |
212 |
|
int nsi; /* minimum number of spaces for indent */ |
213 |
|
{ |
214 |
< |
register char *end, *tab; |
214 |
> |
register char *end, *tab = NULL; |
215 |
|
GLYPH *gp; |
216 |
|
short *nsp; |
217 |
|
int alen, len, width; |