home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / wp_dtp / atap.lha / ATAP / SourceCode / GetMetricFilename.c < prev    next >
C/C++ Source or Header  |  1992-06-13  |  993b  |  38 lines

  1. char *GetMetricFilename(char typefaceNames[][68])
  2.  
  3. /* An unusual routine that uses the FindBaseName() function below.
  4.    From four or less typeface names it extracts a family base name
  5.    and appends ".metric" to it. If the typefaces belong to the 
  6.    same family you get a filename "familyName.metric". If this
  7.    function returns a null, these types don't belong together. 
  8.  
  9.    This function is overridden only if the user supplies an
  10.    alternate .metric filename back in main().  */
  11.  
  12. {
  13.  
  14. static    char    familyName[68],baseNames[4][68];
  15. static    int    match,index;
  16.  
  17.     match=1;
  18.     familyName[0]=0;
  19.  
  20.     for (index=0;index<4;index++)
  21.         strcpy(baseNames[index],FindBaseName(typefaceNames[index]));
  22.  
  23.     for (index=1;index<3;index++)
  24.         if (strcmp(baseNames[index],baseNames[3])!=0)
  25.             match=0;
  26.  
  27.     if (strcmp(baseNames[0],baseNames[3])!=0)
  28.         if (strcmp(typefaceNames[0],baseNames[3])!=0)
  29.             match=0;
  30.  
  31.     if (match!=0)
  32.     {
  33.         strcpy(familyName,baseNames[3]);
  34.         strcat(familyName,".metric");
  35.     }
  36.     return(familyName);
  37. };
  38.