• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Alert Missing Fonts

Enthusiast ,
May 19, 2015 May 19, 2015

Copy link to clipboard

Copied

Hi All,

FYI., new to Illustrator & Illustrator scripting.

Request:

Need alert, if the illustrator document having missing fonts.

In Indesign, we should use the below code:

Missing_Font();

function Missing_Font()

{

    var myUsedFonts = app.activeDocument.fonts;

    for (var i = 0; i < myUsedFonts.length; i++) {

    if (myUsedFonts.status != "1718831470")

    {

        alert("Please Fix Missing Font")

        exit(0);

        }

    }

}

Thanks in advance

Siraj

TOPICS
Scripting

Views

1.0K

Translate

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

correct answers 1 Correct answer

Community Expert , May 20, 2015 May 20, 2015

Here is a reference thread:

https://forums.adobe.com/thread/1075283

However, We can predefine and save  textFonts. When you need to check fonts, Read it and compare Documents font list.

Ten

Votes

Translate

Translate
Adobe
Community Expert ,
May 20, 2015 May 20, 2015

Copy link to clipboard

Copied

Here is a verify document<->system fonts sample code.

function getSysFonts(){

  var f = app.textFonts;

  var fontLst = [];

  for (var i=0;i<f.length;i++){

  fontLst.push(app.textFonts.name);

  }

  return fontLst.join(";");

  }

function getFntsLst (doc){

     var xmlString = new XML(doc.XMPString);

     var fntFace = xmlString.descendants("stFnt:fontName");

     var lst = [];

     for (var i=0; i<fntFace.length(); i++)

  lst.push(fntFace);

     return lst;

  }

var st="";

var ft = getFntsLst (app.activeDocument);

var sysFt = getSysFonts();

for (var i=0;i<ft.length;i++) {

  if (sysFt.indexOf(ft)>-1) st += ft + " : found in system.\n";

  else  st += ft + " : not found in system.\n";

  }

alert (st);

ć‚¹ć‚ÆćƒŖćƒ¼ćƒ³ć‚·ćƒ§ćƒƒćƒˆ 2015-05-20 16.35.00.png

Documents font information in XMP string and System fonts list in textFonts property under the application.

Ten

Votes

Translate

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
Enthusiast ,
May 20, 2015 May 20, 2015

Copy link to clipboard

Copied

Hi Ten,

Thanks for your quick response...

My request is,

if the document having any missing fonts, then the script should alert("Document having missing fonts. Please check")

I tried your script, it will list out all the used fonts only. Not shows missing font.

Script Output Screenshot:

Screen Shot 2015-05-20 at 3.27.38 PM.png

Please look at Document Find Font Screenshot:

Screen Shot 2015-05-20 at 3.27.09 PM.png

Votes

Translate

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
Community Expert ,
May 20, 2015 May 20, 2015

Copy link to clipboard

Copied

mmmm....

Sorry, I think textFonts property not contain missings, But I its wrong.

There seems to not in useful properties in AI.

I'll search another way to detect it...

Ten

Votes

Translate

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
Community Expert ,
May 20, 2015 May 20, 2015

Copy link to clipboard

Copied

Here is a reference thread:

https://forums.adobe.com/thread/1075283

However, We can predefine and save  textFonts. When you need to check fonts, Read it and compare Documents font list.

Ten

Votes

Translate

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
Enthusiast ,
May 20, 2015 May 20, 2015

Copy link to clipboard

Copied

Hi Ten,

Thanks a lot!!!!

No words to say, you did a excellent job for me.

Tested in single file, Works like a charm.

Even though, I need to check with all live jobs.

Again Thanks

Siraj

Votes

Translate

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
Community Beginner ,
Nov 21, 2021 Nov 21, 2021

Copy link to clipboard

Copied

Hey, can someone post the solution here? The reference thread no longer exists.

Votes

Translate

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
Guide ,
Nov 22, 2021 Nov 22, 2021

Copy link to clipboard

Copied

LATEST

Votes

Translate

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