Hi all,
Today I was working on a key-mapping utility as part of my larger keyboard scanning function, based on the swift K=Key() command, and I came upon a puzzling absence in the font sets created by the GLbasic utility. The '&' symbol is missing. This isn't a big deal and is easily correct, but I am just curious as to if there is a reason the symbol isn't there.
Here is a bit of code to show the problem. Create a font, name it "smalfont.png", and save it to the Media folder. Then run the following:
SETSCREEN 1366,768,FALSE
GLOBAL sw%,sh%,sm%
GETSCREENSIZE sw,sh
sm = sw/2
SETCURRENTDIR(GETCURRENTDIR$()+"Media")
GLOBAL fontkey = GENFONT(),fw%,fh%
LOADFONT "smalfont.png",fontkey
SETFONT fontkey
GETFONTSIZE fw,fh
PRINT "Ascii code 38 is the 'AND' sign,",50,fh,TRUE
LOCAL a$ = "&"
PRINT "Let a$ = "+CHR$(34)+"&"+CHR$(34)+". Here is a$-> |"+a$+"|",50,fh*2,TRUE
PRINT "It is also CHR$(38). Here is CHR$(38)-> |"+CHR$(38)+"|",50,fh*3,TRUE
PRINT "The symbol is missing from GLbasic font creation utility.",50,fh*5,TRUE
PRINT "Is there a reason, or is it just a minor oversight?",50,fh*6,TRUE
PRINT " Press Key to Exit.",50,fh*8,TRUE
SHOWSCREEN;KEYWAIT
Thanks!
-CW
PS. Attached is a character set with my hand-drawn '&' symbol included, for anyone who might find it handy.