Product : Engine, Version : 5.0.1.1034Alpha, ArticleID : 41023753

HowTo : VdText object boundaries

Article41023753
TypeHowTo
ProductEngine
Version5.0.1.1034Alpha
Date Added10/21/2004
Submitted byBob Hosea
Keywords

Subject

VdText object boundaries

Summary


- create a TEXTSTYLE: Use Arial with BOLD, ITALIC and DRAWOUTLINE(1024) set.
- place a VDText object in the diagram using this TEXTSTYLE
- add some text to the VDTEXT object that has an "f" at the end.
- use vdtext.GetBoundryBox or vdtext.GetTextBox to get the
boundaries of the text.
- draw a VDRECT rectangle around the text using the boundary values.

You will see that the box does not go completely around the text line. The
trailing part of the "f" at the end of the text line hangs outside the box. Other characters are
effected also. This usually only appears when the text is ITALICIZED
and is even more evident when it is also BOLD. It does it in all fonts
and at all sizes.

Also, the same problem exists when the text is UNDERLINED. It is most notable
when using Courier New. With Courier New the underline falls way outside the boundaries

Solution

 In our latest version we support explode vdText into a vdPolyhatch.By getting the boundary of this object you can get a very accurate bounding box of a text (including italic etc...)