I am having a problem with OnRender DrawTextLayout, when trying to set the TextFormat object property "TextAlignment" equal to the enum choice "Trailing"
the text does not render, and no error msg.
If the enum is changed to "Center" or "Leading", the text renders as expected.
// inside OnRender... // try making a format object directly SharpDX.DirectWrite.TextFormat textFormat2 = new SharpDX.DirectWrite.TextFormat( NinjaTrader.Core.Globals.DirectWriteFactory, "Century Gothic", SharpDX.DirectWrite.FontWeight.Bold, SharpDX.DirectWrite.FontStyle.Italic, 32f ); // now try to set the TextAlignment textFormat2.TextAlignment = SharpDX.DirectWrite.TextAlignment.Trailing; // Center, Leading works ok, Trailing fails // Colors // Bid SharpDX.Direct2D1.SolidColorBrush ProfileSizeMax_Bid_Color = new SharpDX.Direct2D1.SolidColorBrush(RenderTarget, SharpDX.Color.Red); // position of text box, X with minus moves left, Y with plus moves down SharpDX.Vector2 ProfileSizeMax_Bid_XYVector = new SharpDX.Vector2(PriceBar_xpos -10, PriceBar_LowPricePixel + 10); // use new textFormat2 object SharpDX.DirectWrite.TextLayout ProfileSizeMax_Bid_TextLayout = new SharpDX.DirectWrite.TextLayout(NinjaTrader.Core.Gl obals.DirectWriteFactory, ProfileSizeMax_Bid_value.ToString(), textFormat2, ChartPanel.X + ChartPanel.W, textFormat2.FontSize ); // do the rendering, XY pixels, TextBox, BrushColor, option nosnap RenderTarget.DrawTextLayout(ProfileSizeMax_Bid_XYVector, ProfileSizeMax_Bid_TextLayout, ProfileSizeMax_Bid_Color, SharpDX.Direct2D1.DrawTextOptions.NoSnap);
I searched the forums, but did not find any bugs reports about this. Can anyone test this code to see if they can render some text ( less than 3 digits) to see if it will work using Trailing?

Comment