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.6 by greg, Sat Nov 21 21:35:36 1992 UTC vs.
Revision 2.10 by greg, Thu May 25 15:14:03 1995 UTC

# Line 15 | Line 15 | static char SCCSid[] = "$SunId$ LBL";
15   #define galloc(nv)      (GLYPH *)malloc(sizeof(GLYPH)+2*sizeof(GORD)*(nv))
16  
17  
18 < extern char  *libpath;                  /* list of library directories */
18 > extern char  *fgetword(), *getlibpath();
19  
20 extern char  *fgetword();
21
20   static FONT     *fontlist = NULL;       /* list of loaded fonts */
21  
22  
# Line 40 | Line 38 | char  *fname;
38                  if (!strcmp(f->name, fname))
39                          return(f);
40                                                  /* load the font file */
41 <        if ((pathname = getpath(fname, libpath, R_OK)) == NULL) {
41 >        if ((pathname = getpath(fname, getlibpath(), R_OK)) == NULL) {
42                  sprintf(errmsg, "cannot find font file \"%s\"", fname);
43                  error(USER, errmsg);
44          }
# Line 160 | Line 158 | register FONT  *f;             /* font */
158                  if (f->fg[*tp++&0xff] == NULL)
159                          *sp++ = 0;
160                  else
161 <                        linelen += *sp++ = 256;
161 >                        linelen += *sp++ = 255;
162          return(linelen);
163   }
164  
# Line 175 | Line 173 | int  cis;                      /* intercharacter spacing */
173          int  linelen;
174          register GLYPH  *gp;
175  
176 +        linelen = 0;
177          gp = NULL;
178          while (*tp && (gp = f->fg[*tp++&0xff]) == NULL)
179                  *sp++ = 0;
180          cis /= 2;
181 <        linelen = *sp = cis;
181 >        *sp = cis;
182          while (gp != NULL) {
183                  if (gp->nverts) {               /* regular character */
184                          linelen += *sp++ += cis - gp->left;
# Line 214 | Line 213 | int  nsi;                      /* minimum number of spaces for indent */
213                                          /* start by squeezing it */
214          squeeztext(sp, tp, f, cis);
215                                          /* now, realign spacing */
216 <        len = 0;
218 <        width = alen = *sp++;
216 >        width = *sp++;
217          while (*tp) {
218 +                len = alen = 0;
219                  nsp = sp;
220                  for (end = tp; *end; end = tab) {
221                          tab = end + 1;
# Line 240 | Line 239 | int  nsi;                      /* minimum number of spaces for indent */
239                          *sp++ += alen;
240                          len -= alen;
241                  }
243                len = 0;
244                alen = 0;
242                  tp = tab;
243          }
244          return(width);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines