2 Replies Latest reply: Aug 3, 2011 6:23 PM by milligramme RSS

    Problems with CS5 and font check Function

    Gonterman1201 Community Member

      There is a function that I have been using that works from cs to cs4 now with cs5 it does not error it just doesn't find all the missing fonts. If anyone is willing to take a crack at this it would be very helpful. Here is the function:

       

      function myCheckFont(currFile){
          numMissingFonts=0;
          docFonts=app.activeDocument.fonts.everyItem().name;
          appFonts=app.fonts.everyItem().name.join('');
          var numFont = myDocument.fonts.length;
          myFile.write("MISSING FONTS: ");
          for (var loopvar=0; loopvar<docFonts.length; loopvar++){
                  if (appFonts.match(RegExp(docFonts[loopvar]))==null){
                      if (myDocument.fonts.item(loopvar).status=="1718832705"){
                          if (numMissingFonts==0){
                              myFile.write(docFonts[loopvar]);
                              numMissingFonts=numMissingFonts+1;
                              }
                          else{
                              myFile.write(", "+docFonts[loopvar]);
                              numMissingFonts=numMissingFonts+1;
                              }
                          }
                      }
                  }
          if (numMissingFonts==0)
              myFile.write("none");
          myFile.writeln("");
          return [numMissingFonts];