Skip navigation
Currently Being Moderated

Problems with CS5 and font check Function

Aug 3, 2011 1:01 PM

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];

 
Replies
  • Currently Being Moderated
    Aug 3, 2011 6:23 PM   in reply to Gonterman1201

    Hi

     

    I run this script to same documents both CS4 and CS5,

    and insert the snippet to check status.

     

    $.writeln(app.activeDocument.fonts.item(loopvar).status);
     
    

     

    font status return differnt value!

     

    CS4

    missing OpenType Fonts => 1718832705

     

    missing Composite Fonts => 1718834037

     

     

    CS5

     

    missing CpenType Fonts => SUBSTITUTED (1718834037)

    missing Composite Fonts => SUBSTITUTED (1718834037)

    mg

     

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points