
It's purely an aesthetic concern rather than a functional one, of course, but all the same…
Code: Select all
*FONT Times New Roman,24,I
PROCPString(100,100, "Hello world")
PRINT "And again Hello!"
END
DEFPROCPString(px%,py%,s$)
LOCAL x%,c$,dx%
VDU 5
FOR x%=0 TO LEN(s$)-1
c$=MID$(s$,x%+1,1)
dx%=WIDTH(c$)+4
px%+=dx%
MOVE px%,py%
PRINT c$
NEXT x%
VDU4
ENDPROC
Ah, i hadn't realised that VDU5 uses transparent character backgrounds. That's solved the problem (this problem was only occurring in a section of the program where i hadn't been using VDU5) - i haven't experienced the issues you found where you needed to print each character individually, it was fine straight away:DDRM wrote: ↑Wed 20 Jun 2018, 08:27 I think the issue is that in the "normal" print mode the background of letters is opaque (overwrites whatever was underneath with background colour).
One solution would be to use VDU 5 mode, when text is written at the graphics cursor. In this mode the character backgrounds are transparent, so won't overwrite the previous character. I tried this, but it doesn't work unless you print each character individually…
There's a double misunderstanding here. One is that to take advantage of the transparent background in VDU 5 mode you must output each character individually: that's not the case, you can output an entire italic string without clipping. The other is that you "have to take responsibility for kerning": BBC BASIC doesn't natively support kerning at all, whether you output characters individually or as a string there will be no kerning! Even the Windows GetTextExtentPoint32 function returns the dimensions of a string without taking into account kerning.