Home | Reviews | GUIpedia | Forum | Fun500


trollyFont editor for q-step 3
i've done a simple font editor right now
2010-05-115:07 PM

agumaRe:Font editor for q-step 3
awesome!
2010-05-116:55 PM

BrandonRe:Font editor for q-step 3
I might be interested in your font routine (for Fun500) assuming it's mono-spaced and 8x8.
2010-05-118:05 PM

trollyRe:Font editor for q-step 3
it's in freebasic fonts are monospaced and 8pixel width,the code supports both 8x8 and 8x16 fonts   type Font         fontheight as integer         fontdata(0 TO 255, 0 TO 15) AS STRING * 1         declare sub Load(filename as string)         declare sub Save(filename as string)         declare sub DrawText(text as string,x as integer,y as integer,fcolor as integer,bcolor as integer) end type   sub Font.DrawText(text as string,x1 as integer,y1 as integer,fcolor as integer,bcolor as integer)     dim i as integer,x as integer,y as integer, a as integer     IF bcolor > -1 THEN LINE (x1, y1 )-(x1 + len(text)*8-1, y1 + this.FontHeight-1), bcolor,bf     FOR i = 1 TO LEN(Text)         a = ASC(MID$(Text, i, 1))         FOR y = 0 TO this.FontHeight             LINE (x1+((i-1)*8), y1 + y)-(x1 + 8+((i-1)*8), y1 + y), fcolor, , (ASC(fontdata(a, y)) * 128)         NEXT y NEXT i end sub   sub Font.Load(filename as string)     dim fic as integer,i as integer,y as integer     fic = FREEFILE     OPEN filename FOR BINARY AS fic       this.FontHeight=lof(fic)/256       FOR i = 0 TO 255         FOR y = 0 TO this.FontHeight-1             GET #fic, , fontdata(i, y)         NEXT y     NEXT i     CLOSE fic end sub  
2010-05-122:04 AM

BrandonRe:Font editor for q-step 3
Do you have any example fonts, I'm hoping to benchmark your routine against mine.
2010-05-126:50 AM

trollyRe:Font editor for q-step 3
download asgard's binary version (from http://asgard.theguiblog.com) in the zip file, there are the fonts i use .   PS: the code above is for freebasic (i use OOP facilities from freebasic) to use it in QB, you should change the variables in TYPE ... END TYPE into shared variables, and remove all "THIS." in the subs
2010-05-128:02 AM

Blog


2021 Brandon Cornell