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)) |
41 |
|
} |
42 |
|
/* load the font file */ |
43 |
|
if ((pathname = getpath(fname, getrlibpath(), R_OK)) == NULL) { |
44 |
< |
fprintf(stderr, "cannot find font file \"%s\"\n", fname); |
44 |
> |
sprintf(errmsg, "cannot find font file \"%s\"\n", fname); |
45 |
> |
eputs(errmsg); |
46 |
|
return(NULL); |
47 |
|
} |
48 |
|
if ((fp = fopen(pathname, "r")) == NULL) { |
49 |
< |
fprintf(stderr, "cannot open font file \"%s\"\n", pathname); |
49 |
> |
sprintf(errmsg, "cannot open font file \"%s\"\n", pathname); |
50 |
> |
eputs(errmsg); |
51 |
|
return(NULL); |
52 |
|
} |
53 |
|
f = (FONT *)calloc(1, sizeof(FONT)); |
113 |
|
f->next = fontlist; |
114 |
|
return(fontlist = f); |
115 |
|
nonint: |
116 |
< |
fprintf(stderr, "non-integer in font file \"%s\"\n", pathname); |
116 |
> |
sprintf(errmsg, "non-integer in font file \"%s\"\n", pathname); |
117 |
> |
eputs(errmsg); |
118 |
|
fclose(fp); |
119 |
|
return(NULL); |
120 |
|
fonterr: |
121 |
< |
fprintf(stderr, "%s character (%d) in font file \"%s\"\n", |
121 |
> |
sprintf(errmsg, "%s character (%d) in font file \"%s\"\n", |
122 |
|
err, gn, pathname); |
123 |
+ |
eputs(errmsg); |
124 |
|
fclose(fp); |
125 |
|
return(NULL); |
126 |
|
memerr: |
127 |
< |
fprintf(stderr, "out of memory in getfont()\n"); |
127 |
> |
eputs("out of memory in getfont()\n"); |
128 |
|
fclose(fp); |
129 |
|
return(NULL); |
130 |
|
} |