Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Problems with CS5 and font check Function

Engaged ,
Aug 03, 2011 Aug 03, 2011

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

610
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 03, 2011 Aug 03, 2011

Copy link to clipboard

Copied

I thought it might be a different status number but its the same in 5. 1718832705

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 03, 2011 Aug 03, 2011

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines