Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Possible bug: Word-wrap oddity
#10
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
Shoot first and shoot people who ask questions, later.
Reply


Messages In This Thread
Possible bug: Word-wrap oddity - by hanness - 05-04-2022, 06:41 AM
RE: Possible bug: Word-wrap oddity - by Pete - 05-04-2022, 08:38 AM
RE: Possible bug: Word-wrap oddity - by Pete - 05-04-2022, 09:50 AM
RE: Possible bug: Word-wrap oddity - by SMcNeill - 05-04-2022, 10:35 AM
RE: Possible bug: Word-wrap oddity - by hanness - 05-04-2022, 04:35 PM
RE: Possible bug: Word-wrap oddity - by Pete - 05-04-2022, 05:06 PM
RE: Possible bug: Word-wrap oddity - by SMcNeill - 05-04-2022, 05:50 PM
RE: Possible bug: Word-wrap oddity - by hanness - 05-04-2022, 06:15 PM
RE: Possible bug: Word-wrap oddity - by SMcNeill - 05-04-2022, 06:18 PM
RE: Possible bug: Word-wrap oddity - by Pete - 05-04-2022, 06:29 PM
RE: Possible bug: Word-wrap oddity - by SMcNeill - 05-04-2022, 06:50 PM
RE: Possible bug: Word-wrap oddity - by Pete - 05-04-2022, 09:57 PM



Users browsing this thread: 2 Guest(s)