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