.NET

Reply
Active Contributor
pva75
Posts: 48
Registered: ‎07-22-2012
Message 1 of 3 (256 Views)

How to calculate real font size?

256 Views, 2 Replies
11-13-2012 09:44 PM


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.

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 2 of 3 (245 Views)

Re: How to calculate real font size?

11-14-2012 12:05 AM in reply to: pva75

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
Active Contributor
RichardCammeray
Posts: 47
Registered: ‎12-08-2010
Message 3 of 3 (234 Views)

Re: How to calculate real font size?

11-14-2012 02:53 AM in reply to: Hallex
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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community