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

check missing font do not work

Explorer ,
Feb 19, 2015 Feb 19, 2015

Copy link to clipboard

Copied

Hi all,

I have some troubles to check if a font is correcty installed. I'm writting a script who use the property character.appliedFont.location.

1) I would like to check if the fonts in the document are correcty installed (The fonts are installed in the document only -> a folder Document fonts with a package).

- But if I check each font in the document -> every font is installed

- Then if I would like to use my property from a textframe object I figure it out that the font isn't installed

I do not understand why the result of font.status is different when I called it from a textframe?

if (document === undefined) {

   var document = app.activeDocument;

}

var fonts = document.fonts.everyItem().getElements();

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

   if(fonts[i].status !== FontStatus.INSTALLED) {

   //return true;
   alert('no font are uninstalled');

  }

}

var textframes = document.pages[0].textFrames;

/**
* @todo ask why this function do not work!!!
*/
for (var i = 0; i < textframes.length; i++) {

   if (textframes[i].characters[0].appliedFont.status !== FontStatus.INSTALLED) {

   alert('every textframe font are unavailable');

  }

}

return false;

I advance, thank you for the reply

Best regards.

TOPICS
Scripting

Views

788

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 ,
Apr 17, 2019 Apr 17, 2019

Copy link to clipboard

Copied

Hi bastieneichenberger ,

this is an old thread and you may have found what the issue is behind your checks with status !== FontStatus.INSTALLED .

Just did some tests with InDesign CC 2019 on Windows 10.

For the same used font in my document:

app.documents[0].fonts[0].status == FontStatus.INSTALLED // returns true

app.selection[0].characters[0].appliedFont.getElements()[0].status ==  FontStatus.NOT_AVAILABLE // returns true

What's going on here?

The font is available only through the Document fonts folder.

Expected:

app.fonts cannot see this font.

Install the font through e.g. InDesign's Fonts folder in the Application folder and check again:

The value of status is changing to FontStatus.INSTALLED for all three tests:

app.fonts ,

app.documents[0].fonts

app.selection[0].appliedFont

Regards,
Uwe

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
Explorer ,
Apr 23, 2019 Apr 23, 2019

Copy link to clipboard

Copied

LATEST

Hi Laubender​,

Thanks a lot for your message!
I'll check this ASAP.

Best,

Bastien

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