Posts: 660
Threads: 142
Joined: Apr 2022
Reputation:
58
09-21-2023, 12:33 AM
(This post was last modified: 09-21-2023, 12:34 AM by James D Jarvis.)
Why am I seeing the colored spaces in this program? Shouldn't _printmode _keepbackground be prohibiting this?
Code: (Select All) Screen _NewImage(512, 384, 32)
rootpath$ = Environ$("SYSTEMROOT") 'normally "C:\WINDOWS"
fontfile$ = rootpath$ + "\Fonts\comic.ttf" 'TTF file in Windows
style$ = "" 'font style is not case sensitive
f& = _LoadFont(fontfile$, 16, style$)
_Font f&
Line (1, 1)-(510, 382), _RGB32(50, 50, 50), BF
_PrintMode _KeepBackground
Color _RGB32(255, 255, 255), _RGB32(170, 70, 70)
Do
Input txt$
Print _PrintWidth(txt$), txt$
Loop Until txt$ = "END"
Posts: 2,696
Threads: 327
Joined: Apr 2022
Reputation:
217
Looks to me like it's a glitch in _PRINTMODE which isn't keeping the background with the Comma spacing.
Try this instead:
Code: (Select All) Screen _NewImage(512, 384, 32)
rootpath$ = Environ$("SYSTEMROOT") 'normally "C:\WINDOWS"
fontfile$ = rootpath$ + "\Fonts\comic.ttf" 'TTF file in Windows
style$ = "" 'font style is not case sensitive
f& = _LoadFont(fontfile$, 16, style$)
_Font f&
Line (1, 1)-(510, 382), _RGB32(50, 50, 50), BF
'_PrintMode _KeepBackground
Color _RGB32(255, 255, 255), 0
Do
Input txt$
Print _PrintWidth(txt$), txt$
Loop Until txt$ = "END"
Posts: 3,966
Threads: 176
Joined: Apr 2022
Reputation:
219
09-21-2023, 01:20 AM
(This post was last modified: 09-21-2023, 01:22 AM by bplus.)
It's not printing when it tabs to column for the comma so the red background is coming up?
Definitely a weird glitch. Tab() works and I bet _PrintString will too.
b = b + ...
Posts: 2,696
Threads: 327
Joined: Apr 2022
Reputation:
217
We're digging into it. At the moment, it appears that TAB() doesn't honor _KEEPBACKGROUND at all. At first glance, this looks like a simple issue to patch quickly and without any major headache.
Posts: 3,966
Threads: 176
Joined: Apr 2022
Reputation:
219
(09-21-2023, 01:27 AM)SMcNeill Wrote: We're digging into it. At the moment, it appears that TAB() doesn't honor _KEEPBACKGROUND at all. At first glance, this looks like a simple issue to patch quickly and without any major headache.
Ha I just tested tab() do you mean comma?
b = b + ...
Posts: 2,696
Threads: 327
Joined: Apr 2022
Reputation:
217
(09-21-2023, 01:29 AM)bplus Wrote: (09-21-2023, 01:27 AM)SMcNeill Wrote: We're digging into it. At the moment, it appears that TAB() doesn't honor _KEEPBACKGROUND at all. At first glance, this looks like a simple issue to patch quickly and without any major headache.
Ha I just tested tab() do you mean comma?
Comma *is* tab().
TAB is func_tab().
Two different beasts in the c-side of things. It's the tab() in libqb.cpp that's glitching, not func_tab().
Posts: 2,696
Threads: 327
Joined: Apr 2022
Reputation:
217
Looks like the fix for this is all worked up and is just waiting for review and approval. It should be in the repo by the weekend at the latest, I'd imagine.
Posts: 1,586
Threads: 59
Joined: Jul 2022
Reputation:
52
@James D Jarvis great find!
The whole screen is cleared to black before `INPUT`. I tried this on Linux. Put in `CLS` just after `_NEWIMAGE` to clear the screen to the red color, then `_PRINTMODE` line. I didn't have "Comic" font available so I used "DejaVuSans" normal in its place. But it should make no difference with any TTF font.
Posts: 1,272
Threads: 119
Joined: Apr 2022
Reputation:
100
(09-21-2023, 02:43 AM)SMcNeill Wrote: Looks like the fix for this is all worked up and is just waiting for review and approval. It should be in the repo by the weekend at the latest, I'd imagine. Wow, that was fast. This is why I recommend the PE version of QB64 ... active development.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Posts: 2,696
Threads: 327
Joined: Apr 2022
Reputation:
217
(09-21-2023, 03:14 AM)TerryRitchie Wrote: (09-21-2023, 02:43 AM)SMcNeill Wrote: Looks like the fix for this is all worked up and is just waiting for review and approval. It should be in the repo by the weekend at the latest, I'd imagine. Wow, that was fast. This is why I recommend the PE version of QB64 ... active development.
We try. Not all things are as quick and easy to fix, but when you guys point stuff out to us, we do try to look into it ASAP.
|