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

Hot to get height of the highest symbol in selection

New Here ,
Jul 31, 2008 Jul 31, 2008
Subj
TOPICS
Scripting
712
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
New Here ,
Jul 31, 2008 Jul 31, 2008
Hi Roman,

you have to loop through all objects in selection,
compare their height (selObj.geometricBounds[2] - selObj.geometricBounds[0]) and return the maximum!

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
New Here ,
Jul 31, 2008 Jul 31, 2008
Sorry, my question wasn't clear. Under «symbol» I mean «text character» inside text frame. Character does not support property geometricBounds. And I wouldn't like to convert each character to outline.
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
New Here ,
Aug 04, 2008 Aug 04, 2008
Anybody? Tell if it is not possible.
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
Participant ,
Aug 04, 2008 Aug 04, 2008
The information is not directly available.

You can use the baseline and horizontalOffset of a character to get its y and x coordinates on the page (assuming no rotation). You can then use information about pointSize, leading (watch out for autoLeading), ascent and descent to get more information about height (similar but not the same information as you would get by converting to outlines and measuring that).

In CS3 you can get the width by using the endHorizontalOffset of the character. Or you can get the horizontalOffset of the next character (although you have to watch out for line-wraps in that case).

Dave
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
New Here ,
Aug 04, 2008 Aug 04, 2008
Thank you, Dave.
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 ,
Aug 05, 2008 Aug 05, 2008
LATEST
If you need precise information about the position of a specific glyph,
you can use createOutlines() and get the geometric bounds of the
resulting polygon.

Just make sure that you remove the outlines afterwards, and keep in mind
that this type of stuff is very "expensive" in terms of performance.

Harbs
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