Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extended KotD #17: _UFONTHEIGHT
#1
(I know, it's been a while since the last extended KotD.  I've been distracted with playing around with other stuffs and just hadn't gotten around to continuing on these.  My apologies -- I haven't forgotten my pledge to count down all the way to highlight all the QB64PE now commands.  I'm just lazy/busy/and distractable...  Big Grin )

Now this command is a very simple one, I think, to explain.  Let's start with a link to the wiki for it:

https://qb64phoenix.com/qb64wiki/index.php/UFONTHEIGHT

And a comparable link to our existing _FONTHEIGHT:

https://qb64phoenix.com/qb64wiki/index.php/FONTHEIGHT

And then, let's share the syntax that both of these commands use:

pixelHeight& = _UFONTHEIGHT[(fontHandle&)]
pixelHeight& = _FONTHEIGHT[(fontHandle&)] 

And, as you can see, gosh darn it, there's a lot of differences in these two commands to go over!!

Why, one of them has a U in it, and the other doesn't!!   /GASP!!

 


All joking aside, there really isn't any difference in how one would call, or use, these two commands, with the exception of that "U" being at the front of one.  If you know how to use _FontHeight, then you know how to use _UFontHeight.   They're more or less exactly the same *except*....

Remember the last few keywords that I mentioned that _UPRINTSTRING prints wider and taller characters??   *THIS* command will tell you how tall the characters are that it prints.

_FontHeight tells you how high a font is going to render characters if you use PRINT or _PRINTSTRING.
_UFontHeights tell you how high a font is going to render characters if you use _UPRINTSTRING.

That's honestly the only difference between these commands.   Use this when you need the font height for use with _UPrintString.  Otherwise, just ignore it and keep on doing whatever you've always been doing.

It's that simple of a command.  I don't think anyone should ever have any issues with this one.  Wink
Reply




Users browsing this thread: 2 Guest(s)