06-02-2024, 01:10 AM
(06-02-2024, 12:42 AM)OldMoses Wrote: I noticed this one when it came out in v3.8.0, but I didn't really look into it. Thanks for the writeup. I may start playing with this one. I presume that _UFONTHEIGHT, _ULINESPACING and _UPRINTWIDTH are all related functions to this one.
One question: If one were to just go into a project and blanket replace all _PRINTSTRING commands with _UPRINTSTRING, would it look and act the same? Assuming one left the parameter list the same...
Generally speaking, if that's the only change you made, you probably wouldn't notice much difference. The issue would come up if you rely on spacing with _FontHeight, as you'd still have that cramped in tight poistioning. All the letters would render, without overwriting each other, but you'd end up with them "touching" an awful lot more.
_UPRINTSTRING tends to print an extra pixel above or below what we had with _PRINTSTRING, which would really cram all the letters in there tightly together.
Look at the image above. Pay particular attention to the 5th row as you compare the letters. Notice how that extra spacing makes everything keep from touching? Look at the top (_UPRINTSTRING) and compare the upside down question mark to the bottom (_PRINTSTRING). That's the difference I was talking of with my post above.
Now, look at the picture above here. For this one, I did as you suggested -- simply replaced _PRINTSTRING with _UPRINTSTRING. Everything renders, but look how much overlap there is here!
You're not accounting for the increase space of the font, and since the font is slightly larger, it's going to be packed in there tight as heck using the old size.
If you're going to swap to _UPRINTSTRING, you should also swap from _FONTSIZE to _UFONTSIZE, _PRINTWIDTH to _UPRINTWIDTH, and such...
But that's going to lead to wider/taller columns/rows, which means you may not have as much screen space as previously. You may have had 30 rows of text before, but only 28 rows of text, accounting for that extra space between lines and such...
..and it's up to you to decide how much of a change that might make in your program.
Me personally, my old code is just going to stay the way it's always been. I'm not going to try and go back and sort things out to convert from _PRINTSTRING to _UPRINTSTRING.
I'm just going to make certain that for all forseeable projects, I'm going to end up using the new commands and not the old ones.