In Autohotkey, I have an edit that is a particular size. I would like to resize the text so that it displays in the visible area of the edit rather than wrapping it and having to scroll down.
Initially I was going to use StrLen("String") function, but that won't help as different characters will affect when the text wraps
String := "This string of text exceeds the visible... area"
font_size = 18
Gui, +AlwaysOnTop
Gui, Font, S%font_size%
Gui, Add, Edit, gText_Size vFr_Text X10 -Border center r2 W270, % String
Gui, Show
return
Text_Size:
;Find out if the text exceeds visible area
;if so Change font size
return
You can use the
+LimitOption to limit the text to the visible space. You can add it to your code like so: