I have a requirement where I need to print something on a custom media , say 3x5 inches in Ubuntu. I am using the "enscript" tool to print the information.
The number of lines that need to be print in the 3 inches would vary and so would the font size.
Is there any algorithm that I can use to calculate the font size needed to print a given number of lines per page in say 3 inches.
Lets say my font type would always be fixed to "Courier".
I have tried to calculate the font size, based on assuming that 1 inch is 72 points. So 3 inches is 216 points. If I need to print 20 lines in 3 inch space, my font size would be (216/20) which would be 10.8 points.
But this algorithm does not work and does not work for any given number of lines.
Any pointers in solving this would be greatly appreciated.