0 Replies Latest reply on Feb 19, 2015 11:09 PM by bastieneichenberger

    check missing font do not work

    bastieneichenberger Level 1

      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.