Skip to main content
Participating Frequently
May 6, 2010
Answered

Getting glyph positions

  • May 6, 2010
  • 1 reply
  • 1190 views

Is there a way to get back all the glyph sizes and positions used to compose a line or block of text?

Assuming I'm trusting FTE to compose my text for me, I'd like to get the details of the composed text so I can reuse t

his information to generate PDF, for example.

I can almost do it with TextLine.textSnapshot.getTextRunInfo(), but the run info returned surprisingly does not include which glyph is positioned!  It includes the index of the originally input character, but often characters or sets of characters get replaced in composition.  Ligatures (e.g., "fi", "ffi", etc.), for example, use a single glyph to render 2 or more characters.  Also, some complex scripts use different glyphs for a character depending on where the character is located within a word.

The run info does give me a transform matrix for each character, which is great.  Any way to get glyph info to go with that?  Or am I not understanding what this info contains?

Thank you!

-pd

This topic has been closed for replies.
Correct answer rdermer

How about TextLine.dump() ?

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextLine.html?allClasses=1#dump%28%29

Richard

1 reply

rdermerCorrect answer
Adobe Employee
May 6, 2010

How about TextLine.dump() ?

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/engine/TextLine.html?allClasses=1#dump%28%29

Richard

pfdstudioAuthor
Participating Frequently
May 6, 2010

TextLine.dump() appears to be just what I need.  I missed that one.  Thank you!

I'm a bit uneasy about the caveat that Adobe reserves the right to change the XML format in non-backwards compatible ways, but hopefully any changes can be coded around.

Thank you.

-pd