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

Font check script?

Explorer ,
Aug 22, 2016 Aug 22, 2016

Hi, I have a minimum font requirement of 8pt. In Indesign you can specify the document to report back when any text is less than 8pt font via the Preflight feature. I would love a script like this for Illustrator. Problem is I know next to nothing about scripts. Any good starting point or best advice on how I can accomplish this font check?

Thank you,

E

TOPICS
Scripting
1.1K
Translate
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
Adobe
Engaged ,
Aug 22, 2016 Aug 22, 2016

If a script, you have to check every character in every frame... If your document has a lot of text, the check will be delayed for a long time.

Translate
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
Valorous Hero ,
Aug 22, 2016 Aug 22, 2016

If they have Indesign, it may be possible to do an over-the-top cross-app script to paste over all text frames and run a font-check. Or maybe I'm just full of crazy-talk

Translate
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
Valorous Hero ,
Aug 22, 2016 Aug 22, 2016

Let's try this test and see how long it takes for your document.

#target illustrator

function test() {

    function checkTextFrameChars(textFrame) {

        var thisChar;

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

            thisChar = textFrame.characters;

            if (thisChar.characterAttributes.size < 8) {

                thisChar.select(true);

            }

        };

    };

    var doc = app.activeDocument,

        thisFrame, startTime = new Date().getTime();

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

        thisFrame = doc.textFrames;

        checkTextFrameChars(thisFrame);

    };

    app.redraw();

    alert("All characters smaller than 8pt should be selected, process took " + ((new Date().getTime() - startTime) / 1000) + " seconds.");

};

test();

2016-08-22 14_27_56-Untitled-1_ @ 69% (CMYK_Preview).png

Translate
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 22, 2016 Aug 22, 2016

Fast enough (but Silly-V is faster )) ). It remains now to find out what to do next.

Translate
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 23, 2016 Aug 23, 2016

I do something similar to this for my documents. I just force anything lower than my minimum....to my minimum. Just thought I would share although Silly-V​ is much better solution.

#target Illustrator 

var doc = app.activeDocument; 

for (i = 0; i < doc.textFrames.length; i++) 

    { 

        var allText = doc.textFrames

        var allTextAttributes = allText.textRange.characterAttributes; 

        //alert(allTextAttributes.size); 

        if (allTextAttributes.size < 8)

  {

        //alert("less than 5");

  allTextAttributes.size = (8);

  }

   }

Translate
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
Valorous Hero ,
Aug 23, 2016 Aug 23, 2016
LATEST

I wouldn't say 'much better' - only that one goes character-deep to account for variations within a text frame is all

Translate
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