05-04-2022, 06:29 PM
You would need a much more sophisticated word-wrap routine to pull this off, before you attempt to calculate the pixel space available. The larger the words get, the fewer can be placed on a line without being broken. In other words, you have to get the limit of characters per line, and chop each sentence accordingly. That would give you a responsive print out. Next you would have to calculate just how large a font could be used to accomplish this to nearly fill the page, and that all depends on the number of rows generated by the wrap routine. I mean a non-math cheat would be to use trial and error, increasing size (without printing or printing on a hidden page) until the last line can't fit. Dial it back one font size and them either print it that way, or dial it back one font size on the hidden page, and then flip that page to the foreground. QB64 is fast enough to pull that off. Another alternative is to use _INSTRREV on the whole string, to calculate the number of rows for any given font height, until the best fit is determined.
Pete
Pete
Shoot first and shoot people who ask questions, later.