float Font.GetHeight( Graphics graphics);
Here is example of placing text with size 40 in rectangle with height 40
SharpDX.DirectWrite.TextFormat text_format = new SharpDX.DirectWrite.TextFormat(NinjaTrader.Core.Globals.DirectWriteFactory, "Arial",
SharpDX.DirectWrite.FontWeight.Regular, SharpDX.DirectWrite.FontStyle.Normal, SharpDX.DirectWrite.FontStretch.Expanded, 40f);
RectangleF rect = new RectangleF( 50, 50, 1800, 40);
RenderTarget.DrawText( "AaBbCcDdEeFfGgHhJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz", text_format, rect, new DxSolidColorBrush( RenderTarget, DxColor.Black ) );
RenderTarget.DrawRectangle( rect, new DxSolidColorBrush( RenderTarget, DxColor.White ) );
Comment