ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/font.c
(Generate patch)

Comparing ray/src/common/font.c (file contents):
Revision 2.22 by greg, Fri Nov 19 22:51:31 2021 UTC vs.
Revision 2.24 by greg, Sat Nov 20 22:39:01 2021 UTC

# Line 11 | Line 11 | static const char      RCSid[] = "$Id$";
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))
# Line 25 | Line 26 | getfont(                       /* return font fname */
26          char  *fname
27   )
28   {
29 +        char  embuf[512];
30          FILE  *fp;
31          char  *pathname, *err = NULL;
32          unsigned  wsum, hsum, ngly;
# Line 40 | Line 42 | getfont(                       /* return font fname */
42                  }
43                                                  /* load the font file */
44          if ((pathname = getpath(fname, getrlibpath(), R_OK)) == NULL) {
45 <                fprintf(stderr, "cannot find font file \"%s\"\n", fname);
45 >                sprintf(embuf, "cannot find font file \"%s\"\n", fname);
46 >                eputs(embuf);
47                  return(NULL);
48          }
49          if ((fp = fopen(pathname, "r")) == NULL) {
50 <                fprintf(stderr, "cannot open font file \"%s\"\n", pathname);
50 >                sprintf(embuf, "cannot open font file \"%s\"\n", pathname);
51 >                eputs(embuf);
52                  return(NULL);
53          }
54          f = (FONT *)calloc(1, sizeof(FONT));
# Line 110 | Line 114 | getfont(                       /* return font fname */
114          f->next = fontlist;
115          return(fontlist = f);
116   nonint:
117 <        fprintf(stderr, "non-integer in font file \"%s\"\n", pathname);
117 >        sprintf(embuf, "non-integer in font file \"%s\"\n", pathname);
118 >        eputs(embuf);
119          fclose(fp);
120          return(NULL);
121   fonterr:
122 <        fprintf(stderr, "%s character (%d) in font file \"%s\"\n",
122 >        sprintf(embuf, "%s character (%d) in font file \"%s\"\n",
123                          err, gn, pathname);
124 +        eputs(embuf);
125          fclose(fp);
126          return(NULL);
127   memerr:
128 <        fprintf(stderr, "out of memory in getfont()\n");
128 >        eputs("out of memory in getfont()\n");
129          fclose(fp);
130          return(NULL);
131   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines