`DisplayDimension` bounding box with API

I encountered a similar problem when dealing with this problem. It was related to font height and font width, but the calculated result was not very accurate. Fortunately, the font I used was fixed. I used GetTextInBoxHeightAtIndex and GetTextInBoxWidthAtIndex to offset the value obtained by GetPosition.

@liuning thanks for the input. I used GetTextInBoxWidthAtIndex and found that it still yielded a bounding box with considerably more airspace than I liked. Also I need to try to cater for non-proportional fonts. Are you saying that GetTextInBoxHeightAtIndex yielded the top of the actual string as offset from the y-value of Annotation.GetPosition? It's that y-shift that's my biggest problem. Thanks for chiming in...

I encountered the same problem as you when using GetTextInBoxWidthAtIndex. I offset a value I estimated in the x and y directions respectively (the offset value is also related to the view scale), which only works when my drawing template is fixed. Your situation is complicated. I can't give good advice (English is not my first language)