diff options
Diffstat (limited to 'Build/source/texk/dvipsk/fontdef.c')
-rw-r--r-- | Build/source/texk/dvipsk/fontdef.c | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/Build/source/texk/dvipsk/fontdef.c b/Build/source/texk/dvipsk/fontdef.c index b36a769c4c2..254a43112cc 100644 --- a/Build/source/texk/dvipsk/fontdef.c +++ b/Build/source/texk/dvipsk/fontdef.c @@ -21,53 +21,53 @@ fontdesctype* newfontdesc(integer cksum, integer scsize, integer dssize, char *name, char *area) { - register fontdesctype *fp ; + register fontdesctype *fp; - fp = (fontdesctype *)mymalloc((integer)sizeof(fontdesctype)) ; - fp->chardesc = (chardesctype *)mymalloc(256*(integer)sizeof(chardesctype)) ; - fp->maxchars = 256 ; - fp->psname = 0 ; - fp->loaded = 0 ; - fp->checksum = cksum ; - fp->scaledsize = scsize ; - fp->designsize = dssize ; - fp->thinspace = scsize / 6 ; - fp->scalename = NULL ; - fp->psflag = 0 ; - fp->codewidth = 1 ; + fp = (fontdesctype *)mymalloc((integer)sizeof(fontdesctype)); + fp->chardesc = (chardesctype *)mymalloc(256*(integer)sizeof(chardesctype)); + fp->maxchars = 256; + fp->psname = 0; + fp->loaded = 0; + fp->checksum = cksum; + fp->scaledsize = scsize; + fp->designsize = dssize; + fp->thinspace = scsize / 6; + fp->scalename = NULL; + fp->psflag = 0; + fp->codewidth = 1; fp->name = name; #ifdef VMCMS /* IBM: VM/CMS */ { - int i ; - for ( i=0 ; fp->name[i] ; i++ ) - fp->name[i] = ascii2ebcdic[ fp->name[i] ] ; + int i; + for ( i=0; fp->name[i]; i++ ) + fp->name[i] = ascii2ebcdic[ fp->name[i] ]; } #else #ifdef MVSXA /* IBM: MVS/XA */ { - int i ; - for ( i=0 ; fp->name[i] ; i++ ) - fp->name[i] = ascii2ebcdic[ fp->name[i] ] ; + int i; + for ( i=0; fp->name[i]; i++ ) + fp->name[i] = ascii2ebcdic[ fp->name[i] ]; } #endif /* IBM: MVS/XA */ #endif /* IBM: VM/CMS */ fp->area = area; - fp->resfont = NULL ; - fp->localfonts = NULL ; + fp->resfont = NULL; + fp->localfonts = NULL; #ifdef KPATHSEA fp->dpi = kpse_magstep_fix ((halfword)(mag*(float)fp->scaledsize*DPI/ - ((float)fp->designsize*1000.0)+0.5), DPI, NULL) ; + ((float)fp->designsize*1000.0)+0.5), DPI, NULL); #else fp->dpi = dpicheck((halfword)(mag*fp->scaledsize*DPI/ - ((float)fp->designsize*1000.0)+0.5)) ; + ((float)fp->designsize*1000.0)+0.5)); #endif - fp->loadeddpi = fp->dpi ; + fp->loadeddpi = fp->dpi; #ifdef DEBUG if (dd(D_FONTS)) (void)fprintf(stderr,"Defining font (%s) %s at %.1fpt\n", - area, name, (real)scsize/(alpha*0x100000)) ; + area, name, (real)scsize/(alpha*0x100000)); #endif /* DEBUG */ - return fp ; + return fp; } /* * Try to find a font with a given name and approximate scaled size, returning @@ -83,22 +83,22 @@ matchfont(char *name, char *area, integer scsize, char *scname) register fontdesctype *fp; register integer smin, smax; - smin = scsize - fsizetol ; - smax = scsize + fsizetol ; + smin = scsize - fsizetol; + smax = scsize + fsizetol; for (fp=fonthead; fp; fp=fp->next) if (smin < fp->scaledsize && fp->scaledsize < smax && strcmp(name,fp->name)==0 && strcmp(area,fp->area)==0) { if (scname == NULL) { if (fp->scalename!=NULL || scsize==fp->scaledsize) - break ; + break; } else { if (fp->scalename==NULL || strcmp(scname,fp->scalename)==0) - break ; + break; } } #ifdef DEBUG if (dd(D_FONTS) && fp) - (void)fprintf(stderr,"(Already known.)\n") ; + (void)fprintf(stderr,"(Already known.)\n"); #endif /* DEBUG */ return fp; } @@ -109,52 +109,52 @@ matchfont(char *name, char *area, integer scsize, char *scname) void fontdef(int siz) { - register integer i, j, fn ; - register fontdesctype *fp ; - register fontmaptype *cfnt ; - char *name, *area ; - integer cksum, scsize, dssize ; + register integer i, j, fn; + register fontdesctype *fp; + register fontmaptype *cfnt; + char *name, *area; + integer cksum, scsize, dssize; - fn = dvibyte() ; + fn = dvibyte(); while (siz-- > 1) - fn = (fn << 8) + dvibyte() ; + fn = (fn << 8) + dvibyte(); for (cfnt=ffont; cfnt; cfnt = cfnt->next) - if (cfnt->fontnum == fn) goto alreadydefined ; - cfnt = (fontmaptype *)mymalloc((integer)sizeof(fontmaptype)) ; - cfnt->next = ffont ; - ffont = cfnt ; - cfnt->fontnum = fn ; - cksum = signedquad() ; - scsize = signedquad() ; - dssize = signedquad() ; - i = dvibyte() ; j = dvibyte() ; + if (cfnt->fontnum == fn) goto alreadydefined; + cfnt = (fontmaptype *)mymalloc((integer)sizeof(fontmaptype)); + cfnt->next = ffont; + ffont = cfnt; + cfnt->fontnum = fn; + cksum = signedquad(); + scsize = signedquad(); + dssize = signedquad(); + i = dvibyte(); j = dvibyte(); if (nextstring + i + j > maxstring) - error("! out of string space") ; - area = nextstring ; + error("! out of string space"); + area = nextstring; for (; i>0; i--) - *nextstring++ = dvibyte() ; - *nextstring++ = 0 ; - name = nextstring ; + *nextstring++ = dvibyte(); + *nextstring++ = 0; + name = nextstring; for (; j>0; j--) - *nextstring++ = dvibyte() ; - *nextstring++ = 0 ; - fp = matchfont(name, area, scsize, (char *)0) ; + *nextstring++ = dvibyte(); + *nextstring++ = 0; + fp = matchfont(name, area, scsize, (char *)0); if (fp) { - nextstring = name ; - fp->checksum = cksum ; + nextstring = name; + fp->checksum = cksum; } else { - fp = newfontdesc(cksum, scsize, dssize, name, area) ; - fp->next = fonthead ; - fonthead = fp ; + fp = newfontdesc(cksum, scsize, dssize, name, area); + fp->next = fonthead; + fonthead = fp; } - cfnt->desc = fp ; - return ; + cfnt->desc = fp; + return; alreadydefined: /* A DVI file will not define a font twice; but we may be scanning * a font definition twice because a new section has started, * or because of collated copies. */ - skipover(12) ; - skipover(dvibyte()+dvibyte()) ; + skipover(12); + skipover(dvibyte()+dvibyte()); } /* @@ -166,17 +166,17 @@ alreadydefined: int skipnop(void) { - register int cmd ; + register int cmd; while (1) { switch(cmd=dvibyte()) { -case 138: break ; -case 239: skipover((int)dvibyte()) ; break ; /* xxx1 */ -case 240: skipover((int)twobytes()) ; break ; /* xxx2 */ -case 241: skipover((int)threebytes()) ; break ; /* xxx3 */ -case 242: skipover((int)signedquad()) ; break ; /* xxx4 */ -case 243: case 244: case 245: case 246: fontdef(cmd-242) ; break ; -default: return cmd ; +case 138: break; +case 239: skipover((int)dvibyte()); break; /* xxx1 */ +case 240: skipover((int)twobytes()); break; /* xxx2 */ +case 241: skipover((int)threebytes()); break; /* xxx3 */ +case 242: skipover((int)signedquad()); break; /* xxx4 */ +case 243: case 244: case 245: case 246: fontdef(cmd-242); break; +default: return cmd; } } } |