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

JS/CS3 or 4:Geometry for texts

Guest
Nov 19, 2009 Nov 19, 2009

Copy link to clipboard

Copied

Dear All,


I had a requirement to get the geometric bounds for some key terms in texts (Eg. Key words, URL, etc). Is there any possibility to get the geometric bounds for inline texts? If so, kindly let me know.


regards

Masthan

TOPICS
Scripting

Views

1.0K

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

correct answers 1 Correct answer

Contributor , Nov 19, 2009 Nov 19, 2009

search the "keyword", set textRange,

and creatOutlines(false) method against the textRange.

("false" propety remain original texts objects)

you can get geometricBounds of "keywords" as Polygons

then remove Outlined texts(polygons)

//ex)
var outTxt = app.selection[0].createOutlines (false);
var textBon = outP[0].geometricBounds;
outTxt [0]. remove ();

Votes

Translate

Translate
Contributor ,
Nov 19, 2009 Nov 19, 2009

Copy link to clipboard

Copied

search the "keyword", set textRange,

and creatOutlines(false) method against the textRange.

("false" propety remain original texts objects)

you can get geometricBounds of "keywords" as Polygons

then remove Outlined texts(polygons)

//ex)
var outTxt = app.selection[0].createOutlines (false);
var textBon = outP[0].geometricBounds;
outTxt [0]. remove ();

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
Guest
Nov 20, 2009 Nov 20, 2009

Copy link to clipboard

Copied

LATEST

Hi Milligramme,

It works perfect.

Many thanks for your timely help.

regards

Masthan

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
Guide ,
Nov 20, 2009 Nov 20, 2009

Copy link to clipboard

Copied

Hi, Masthan

In addition to the createOutlines approach illustrated above by milligramme, you can access to various measurement properties provided by Text objects, especially the horizontalOffset property -- which works on InsertionPoint too. It depends on your needs. createOutlines allows you to get the coordinates of a full bounding box (for each line), but it may have significant performance cost.

@+

Marc

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
Guest
Nov 20, 2009 Nov 20, 2009

Copy link to clipboard

Copied

Hi Marc,

Many Thanks for you.

regards

Masthan

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