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

Automatically remove underline when text intersects.

Community Beginner ,
Oct 29, 2019 Oct 29, 2019

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.

 

2019-10-29 10_04_14-Window.png

2.4K
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
Community Expert ,
Oct 29, 2019 Oct 29, 2019

Hi. Those underline are a text property or is a line that you drew?

Marlon Ceballos
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
Community Beginner ,
Oct 29, 2019 Oct 29, 2019

It's a text property.

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
Community Expert ,
Oct 29, 2019 Oct 29, 2019

I think is not possible without break the text, but maybe some else has the solution.

Marlon Ceballos
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 ,
Oct 29, 2019 Oct 29, 2019

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?

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
Community Expert ,
Oct 29, 2019 Oct 29, 2019

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.phphttps://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.

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
LEGEND ,
Oct 29, 2019 Oct 29, 2019

You could just turn OFF the "Underline" character attribute for characters with decenders. This could probably be scripted.Screen Shot 2019-10-29 at 11.09.36 AM.png

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

https://www.youtube.com/watch?v=PBqUJNZTbPU

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
Community Expert ,
Oct 29, 2019 Oct 29, 2019

Wow, look at you Ray! I'm impressed, great job!

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
LEGEND ,
Oct 29, 2019 Oct 29, 2019

@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.

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
Community Beginner ,
Oct 30, 2019 Oct 30, 2019
LATEST

That's awesome! I will give this a try.

 

Thank you!

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