/* $Log: checkfont.c,v $ * Revision 0.8 92/11/23 19:46:37 19:46:37 bt (Bo Thide') * Fixed resolution bug. Portable downloading. Added/changed options. PJXL color support * * Revision 0.7 92/11/13 02:41:21 02:41:21 bt (Bo Thide') * More bug fixes and improvements. Support for PaintJet XL * * Revision 0.6 92/11/10 21:47:38 21:47:38 bt (Bo Thide') * Bug fixes. Added -R option. Better font handling. * * Revision 0.5 92/11/09 16:25:24 16:25:24 bt (Bo Thide') * Rewrite of dospecial.c. Extended \special support * * Revision 0.4 92/11/08 02:45:40 02:45:40 bt (Bo Thide') * Changed to portable bit manipulations. Replaced strrstr for non-POSIX compliant C. Fixed numerous bugs. Added support for more \special's. * * Revision 0.3 92/08/24 12:45:33 12:45:33 bt (Bo Thide') * Fixed 8 bit (dc font) support. * * Revision 0.2 92/08/23 17:28:54 17:28:54 bt (Bo Thide') * Source cleaned up. Changed certain function calls. Removed globals. * * Revision 0.1 92/08/22 23:58:47 23:58:47 bt (Bo Thide') * First Release. * */ #include #include "globals.h" #include "macros.h" static char rcsid[] = "$Header: checkfont.c,v 0.8 92/11/23 19:46:37 bt Exp $"; /* * Check that all font definitions found in the postamble agree with all the * font definitions found during prescan. For any disagreement a warning will * be printed. Those fonts which are not detected during the prescan phase * will be defined now */ checkfont(dvifile,f) FILE *dvifile; int f; { int i; int a, l; fontfmt *font; char *p; char buffer[TERMLINELENGTH]; if(f >= MAXFONTS) fprintf(stderr,"Warning: Only font definitions 0..255 are valid.\n"); else if(!(font = fontptr[f])) definefont(dvifile, f); else { if(getsquad(dvifile) != font->checksum) fprintf(stderr,"Warning: Pre-post disagreement in checksum for font # %d !\n",f); if(getsquad(dvifile) != font->scaled_size) fprintf(stderr,"Warning: Pre-post disagreement in scaled_size for font # %d !\n", f); if(getsquad(dvifile) != font->design_size) fprintf(stderr,"Warning: Pre-post disagreement in design_size for font # %d !\n", f); a = (int)getubyte(dvifile); l = (int)getubyte(dvifile); for(i = 0; i < a ; i++) buffer[i] = getubyte(dvifile); buffer[a] = '\0'; p = names + font->name; if(strcmp(p,buffer)) fprintf(stderr,"Warning: Pre-post disagreement in path_name for font # %d !\n", f); for(i = 0; i < l ; i++) buffer[i] = getubyte(dvifile); buffer[l] = '\0'; p = names + font->name + a + 1; if(strcmp(p,buffer)) fprintf(stderr,"Warning: Pre-post disagreement in font_name for font # %d !\n", f); } }