Hi,
In my app, I have a window(a panel) where I write some text as an overlay :
def \_set\_overlay\(self, win, text, colour=\(192, 192, 192\)\):
dc = wx\.ClientDC\(win\)
odc = wx\.DCOverlay\(self\.overlay, dc\)
odc\.Clear\(\)
ctx = wx\.GraphicsContext\.Create\(dc\)
col = wx\.Colour\(\*colour, 128\)
brush = ctx\.CreateBrush\(wx\.Brush\(wx\.Colour\(\(0,0,0,128\)\)\)\)
font = ctx\.CreateFont\(10, "ARIAL", flags=wx\.FONTFLAG\_DEFAULT, col=col\)
ctx\.SetFont\(font\)
ctx\.DrawText\(text, 10, 10, brush\)
del odc
For now, the font size is fixed. I'd like to compute the font size to make the text half the width of the window.
What is the best way to compute the font size ?
Regards,
Nicolas