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

JS/CS3 or 4:Geometry for texts

Guest
Nov 19, 2009 Nov 19, 2009

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
1.2K
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

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 ();
Translate
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 ();
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
Guest
Nov 20, 2009 Nov 20, 2009
LATEST

Hi Milligramme,

It works perfect.

Many thanks for your timely help.

regards

Masthan

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

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

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

Hi Marc,

Many Thanks for you.

regards

Masthan

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