Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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();
Copy link to clipboard
Copied
Fast enough (but Silly-V is faster )) ). It remains now to find out what to do next.
Copy link to clipboard
Copied
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);
}
}
Copy link to clipboard
Copied
I wouldn't say 'much better' - only that one goes character-deep to account for variations within a text frame is all
Find more inspiration, events, and resources on the new Adobe Community
Explore Now