How to calculate real font size?

How to calculate real font size?

Anonymous
Not applicable
1,071 Views
2 Replies
Message 1 of 3

How to calculate real font size?

Anonymous
Not applicable


I have point (DBPoint) and I want to draw some text in this point by DrawOverrule.

 

It works fine:

 

Point3d textPosition = ....
wd.Geometry.Text(textPosition, point.Normal, Vector3d.XAxis, myText, true, TextStyle);

 

But how to draw text in two lines?

 

I can't use MText because it's overruled code (or no?).

 

So it's required to caclulate real font size and move second line to font vert-size.


Point3d textPosition = .... // first line
wd.Geometry.Text(textPosition, point.Normal, Vector3d.XAxis, myTextLine1, true, TextStyle);

 

textPosition = textPosition.Add(new Vector3d(???)); // second line
wd.Geometry.Text(textPosition, point.Normal,  Vector3d.XAxis, myTextLine1, true, TextStyle);

 

How to do it?

 

Thanks,
Pavel.

0 Likes
1,072 Views
2 Replies
Replies (2)
Message 2 of 3

Hallex
Advisor
Advisor

See if this article will helps

http://adndevblog.typepad.com/autocad/2012/05/actual-width-and-height-of-a-text-string.html?cid=6a01...

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
0 Likes
Message 3 of 3

Anonymous
Not applicable
Hi Pavle,
 
I have not tested it but to use MText in overrule try something like this in WorldDraw(Drawable d,WorldDraw wd) method
 
Mtext _mText=new Mtext(do constructor here...);
_mText.WorldDraw(wd);
_mText.Dispose();

 

Richard
0 Likes