kazuna8
 ( 42.83% )
- ago
I would like to calculate the pixel width of the text being rendered.
Is there a way to obtain the font information for drawing functions?

I want to draw a text to be left edge aligned at the last bar of the chart.
Something lie this:
CODE:
Font font = GetTextDrawingFont(); Size size = System.Windows.Forms.TextRenderer.MeasureText(text, font); DrawTextVAlign(text, idx, bars.High[idx], VerticalAlignment.Top, WLColor.Red, font.Size, 0, -1 * size);
0
159
Solved
3 Replies

Reply

Bookmark

Sort
Glitch8
 ( 10.10% )
- ago
#1
You can create a WLFont instance and pass it as one of the optional parameters to the DrawText methods. This will let you know the exact font.
0
kazuna8
 ( 42.83% )
- ago
#2
I tried other fonts but preferred the default font, so I wondered how to retrieve the font currently set to the Draw functions.
0
Glitch8
 ( 10.10% )
- ago
#3
The default font is "Arial".
1
Best Answer

Reply

Bookmark

Sort