Copy link to clipboard
Copied
Is it possible to automatically remove the underline when text intersects?
I now have to do it by hand, but it would make my job a lot easier if it was done automatically.
Copy link to clipboard
Copied
Hi. Those underline are a text property or is a line that you drew?
Copy link to clipboard
Copied
It's a text property.
Copy link to clipboard
Copied
I think is not possible without break the text, but maybe some else has the solution.
Copy link to clipboard
Copied
I hate to say it but I put background colored boxes over the areas not underlined. I don't know an easy or quick workaround though.
This seems like it is easy IF you know the trick, anyone?
Copy link to clipboard
Copied
You could use GREP in InDesign to set the text there and copy/paste it back into Illustrator if you don't complete the design in InDesign. There are a few ways to do that. Here are a couple of links to GREP solutions in InDesign for the underline https://indesignsecrets.com/breaking-underlines-descenders.php, https://graphicdesign.stackexchange.com/questions/78656/practically-making-interrupted-underlines-th.... If you need help with GREP, you can post questions in the InDesign forum.
Another idea would be to create your own font with custom underlining in something like Fontself.
Copy link to clipboard
Copied
You could just turn OFF the "Underline" character attribute for characters with decenders. This could probably be scripted.
Edit Oct. 30:
I've updated the Javascript to include test for selection and an alert to "Select a text object". On the "var decender" line 2 array entries are commented out. They are "space" and "tab" characters. If you want to include them remove the first "];//" from the line.
var aDoc = app.activeDocument;
if (aDoc.selection.length > 0){
aDoc.selection[0].textRange.characterAttributes.underline = true;
test();
} else {
alert ("Please select a text object.");
}
function test() {
var t = aDoc.selection[0],
thisChar;
var decender = ['g', 'y', 'µ', '(', ')', ';', '[', ']', ',', 'q', '|'];//, ' ', ' ']; //add decender characters to this array
var x = decender.length; //number of dicenders in the array
for (var i = 0; i < t.characters.length; i++) {
thisChar = t.characters[i];//loop through all characters in selection
for (var ii = 0; ii < x; ii++)
if (thisChar.contents == decender[ii]){
thisChar.characterAttributes.underline = false; //if it's a decender subtract underline
}
}
}
Edit: Updated script to first underline selection then skip decenders. Also added a downloadable .jsx you can put in your scripts folder. https://www.dropbox.com/s/vegxuic3j0blb2b/underline_skip_decenders.jsx?dl=0
Copy link to clipboard
Copied
Wow, look at you Ray! I'm impressed, great job!
Copy link to clipboard
Copied
@CarlosCanto,
That's because of all the help (and free scripts) you've given me over the years. Some of it is finally rubbing off. I'm sure I built this from one you, or one of the other scripting gurus provided! Thanks for all the help.
Copy link to clipboard
Copied
That's awesome! I will give this a try.
Thank you!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more