views:

182

answers:

1

Hello.

I am looking for a way to get the position coordinates for an offset of a Draw2D TextFlow. For example SWT's StyledText supports that directly (getLocationAtOffset), but none of the Draw2D text figures supports this. Any ideas how I could calculate the position with the given methods of TextFlow?

Regards, Kai

A: 

You can try TextUtilities#getTextExtents.

thSoft