Calculating window size based on font size & number of characters?
When specifying a window size, some programs use
--width=
others use
--geometry=
but in either case, I would like to make a text window be set to cover the longest line of the text. Now the longest line can be calculated. Given that I know he font size (say Courier 18 or Monospace 20), does anyone know a formula that would tell me the window width based on line length and font size?
Similarly, window height based on number of lines and font size?
Of course, I'd have to add some for anything else the window displays but those should be fixed.
For my program, this will apply to yad windows.
|