FDK/Tools/Programs/autohint/source/main.c
/* Adds width info to char_table. */
Adds width info to char_table.
Adds width info to char_table .
static void read_char_widths(void)
{
  FILE *fwidth;
#define WIDTHMAXLINE 80
  char cname[50];
  char line[WIDTHMAXLINE + 1];
  int width;
  indx ix;
  init_widthsarray();
  fwidth = ACOpenFile("widths.ps", "r", OPENERROR);
  while (fgets(line, WIDTHMAXLINE, fwidth) != NULL)
  {
    if (((line[0] == '%') || (ix = strindex(line, "/")) == -1))
      continue;
    if (sscanf(&line[ix + 1], " %s %d", cname, &width) != 2)
    {
      sprintf(globmsg, "%s file line: %s can't be parsed.\n  It should have the format: /<char name> <width> WDef\n", "widths.ps", line);
      fclose(fwidth);
      LogMsg(globmsg, LOGERROR, NONFATALERROR, TRUE);
    }
    set_char_width (cname, width);
  }
  fclose(fwidth);
}
static void read_char_widths ( void ) { FILE * fwidth ; #define WIDTHMAXLINE  80 char cname [ 50 ] ; char line [ WIDTHMAXLINE + 1 ] ; int width ; indx ix ; init_widthsarray ( ) ; fwidth = ACOpenFile ( " " , " " , OPENERROR ) ; while ( fgets ( line , WIDTHMAXLINE , fwidth ) != NULL ) { if ( ( ( line [ 0 ] == ' ' ) || ( ix = strindex ( line , " " ) ) == -1 ) ) continue ; if ( sscanf ( & line [ ix + 1 ] , " " , cname , & width ) != 2 ) { sprintf ( globmsg , " \n \n " , " " , line ) ; fclose ( fwidth ) ; LogMsg ( globmsg , LOGERROR , NONFATALERROR , TRUE ) ; } set_char_width ( cname , width ) ; } fclose ( fwidth ) ; }
Adds width info to char_table.
Adds width info to char_table .