Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing font-size in _rgb32 mode
#18
(04-08-2023, 10:49 PM)SMcNeill Wrote:
(04-08-2023, 09:55 PM)mnrvovrfc Wrote: LOCATE was designed originally to position the cursor in text mode SCREEN 0, to set up PRINT. However, people expected the same exact behavior eg. in SCREEN 12, so it was left to its fate.

_PRINTSTRING is a different creature which requires screen pixel coordinates to work, treating the text also given to it as a graphics figure such as line or circle. That's why you have to compute stuff with other functions to be able to center the text, without caring if it's a monospaced font.

LOCATE can be used with PRINT only with monospaced fonts as Steve had said. It limits its use because it doesn't work as well with variable-spaced fonts. In that case _PRINTSTRING is available although it requires more "skill" to use it.

LOCATE was designed to work in SCREEN 12 exactly as it had in SCREEN 0 because it used the EXACT same fonts.  QB45 doesn't have a _LOADFONT command and it doesn't allow you to load variable-width fonts.  Same command for SCREEN 12 as for SCREEN 0, if you wanted to print and position text onto the screen.

_PRINTSCREEN isn't all that different.  The only real difference with it is that it takes graphic coordinates instead of text coordinates, and it doesn't change the print cursor location.

LOCATE works just fine with variable-width fonts.  When did Steve say it didn't?  I just mentioned that the second parameter works with a pixel value rather than a column value -- as variable width columns aren't set at the same position on each line of text. 

LOCATE down, right --- in ALL screen modes and with ALL fonts, that statement works without any issues.  down is always going to be the number of rows down where the text is located.  right, when used with variable width fonts, is going to be the number of pixels right to offset the text.  With monospace fonts, it's going to be the number of characters right to offset the text.

That's the only difference in the behavior with LOCATE.

When used with variable-width fonts, the second parameter for LOCATE relates to pixels instead of characters.  <-- It really is that simple.

Just read trough all those responses, and now my head hurts! But thanks for that great infomation!
Basically, I've got three new commands to experiment with: _Printstring ( a MUST DO for me), _Printwidth, and _Fontheight. My toolbox feels heavier, but I should be able to master these new tools.  Big Grin
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply


Messages In This Thread
RE: Changing font-size in _rgb32 mode - by bplus - 04-08-2023, 01:51 PM
RE: Changing font-size in _rgb32 mode - by bplus - 04-08-2023, 05:10 PM
RE: Changing font-size in _rgb32 mode - by PhilOfPerth - 04-09-2023, 12:19 AM



Users browsing this thread: 2 Guest(s)