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

Mapping where text overlap?

Participant ,
May 15, 2020 May 15, 2020

Copy link to clipboard

Copied

Hi,

 

This is likely a tricky one involving scripting which I'm now familiar with thanks to many of your here! 😄

 

Here we go...

I have a script that formats and position text based on the number of characters.

I have a whole-page background made up of a repeating pattern of small objects. A mosaic I think is the word?

 

I want to swap all small objects that are covered or partly covered by the text above it to another type of small objects.

 

This would enable me to have a wonderful photoshop-type text effect directly in indesign.

 

Where, oh where, should I start to look presuming this is even possible?

 

THANK YOU! I'll share what I get in the end if there is interest 🙂

 

Antoine in Vancouver

TOPICS
Scripting

Views

478

Translate

Translate

Report

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 ,
May 15, 2020 May 15, 2020

Copy link to clipboard

Copied

Seems like you would need to start by getting the bounds of the text’s words or characters. This function gets the bounds of the text provided as the parameter as an y1,x1,y2,x2 array, which you could then use to position an object below:

 

 

var sel = app.selection[0];
$.writeln("Selected Text Bounds: " + getTextBounds(sel));


function getTextBounds(t){
    var y1, x1, y2, x2
    y1 = t.baseline - sel.ascent;
    x1 = t.horizontalOffset
    y2 = t.baseline + sel.descent;
    x2 = t.endHorizontalOffset
    return [y1,x1,y2,x2]
}

 

 

Votes

Translate

Translate

Report

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 ,
May 15, 2020 May 15, 2020

Copy link to clipboard

Copied

LATEST

Hi BetterColour,

sorry, I have no idea what you are after.

I'd suggest you post some screenshots. Before and after a possible script run.

 

To read out positions of single characters you could outline duplicates of characters and compare the geometric bounds with other objects' geometric bounds.

 

Thanks,
Uwe Laubender

( ACP )

Votes

Translate

Translate

Report

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