kazuna8
 ( 30.35% )
- 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
128
Solved
3 Replies

Reply

Bookmark

Sort
Glitch8
 ( 9.28% )
- 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
 ( 30.35% )
- 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
 ( 9.28% )
- ago
#3
The default font is "Arial".
1
Best Answer

Reply

Bookmark

Sort